Skip to content

Commit 546a2a6

Browse files
committed
8286444: javac errors after JDK-8251329 are not helpful enough to find root cause
Backport-of: 29c4b8e80d1860249a79cfd1941354150468fc5b
1 parent 67ad36a commit 546a2a6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -63,6 +63,7 @@
6363
import java.util.Set;
6464
import java.util.stream.Collectors;
6565
import java.util.stream.Stream;
66+
import java.util.zip.ZipException;
6667

6768
import javax.lang.model.SourceVersion;
6869
import javax.tools.FileObject;
@@ -564,7 +565,11 @@ public ArchiveContainer(Path archivePath) throws IOException, ProviderNotFoundEx
564565
Map<String,String> env = Collections.singletonMap("multi-release", multiReleaseValue);
565566
FileSystemProvider jarFSProvider = fsInfo.getJarFSProvider();
566567
Assert.checkNonNull(jarFSProvider, "should have been caught before!");
567-
this.fileSystem = jarFSProvider.newFileSystem(archivePath, env);
568+
try {
569+
this.fileSystem = jarFSProvider.newFileSystem(archivePath, env);
570+
} catch (ZipException ze) {
571+
throw new IOException("ZipException opening \"" + archivePath + "\": " + ze.getMessage(), ze);
572+
}
568573
} else {
569574
this.fileSystem = FileSystems.newFileSystem(archivePath, (ClassLoader)null);
570575
}

0 commit comments

Comments
 (0)