Merge branch '2.1.x'

Closes gh-17124
This commit is contained in:
Andy Wilkinson 2019-06-12 13:01:40 +01:00
commit 29d1cd3b2d
1 changed files with 8 additions and 2 deletions

View File

@ -118,9 +118,15 @@ public class JarFile extends java.util.jar.JarFile {
this.pathFromRoot = pathFromRoot;
CentralDirectoryParser parser = new CentralDirectoryParser();
this.entries = parser.addVisitor(new JarFileEntries(this, filter));
parser.addVisitor(centralDirectoryVisitor());
this.data = parser.parse(data, filter == null);
this.type = type;
parser.addVisitor(centralDirectoryVisitor());
try {
this.data = parser.parse(data, filter == null);
}
catch (RuntimeException ex) {
close();
throw ex;
}
this.manifestSupplier = (manifestSupplier != null) ? manifestSupplier : () -> {
try (InputStream inputStream = getInputStream(MANIFEST_NAME)) {
if (inputStream == null) {