RFR: 8259867: Move encoding checks into ZipCoder

eirbjo github.com+300291+eirbjo at openjdk.java.net
Tue Jan 19 01:14:00 UTC 2021

ZipFile.Source.initCEN verifies that entry names are encoding into bytes valid in the entry's encoding. It does so by calling encoding-specific checking methods, so it also needs to determine which check method to call for each entry.

By moving the encoding-variant checks into ZipCoder, initCEN can instead simply call ZipCoder.checkEncoding. This makes the code easier to follow and also removes a duplication of flag checking logic found in zipCoderForPos.


Commit messages:
 - 8242959: Move name encoding checks to ZipCoder (cleanup)

Changes: https://git.openjdk.java.net/jdk/pull/2110/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2110&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8259867
  Stats: 58 lines in 2 files changed: 27 ins; 28 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2110.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2110/head:pull/2110

PR: https://git.openjdk.java.net/jdk/pull/2110

More information about the core-libs-dev mailing list