File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
src/main/java/io/quarkus/fs/util Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,19 @@ public class FileSystemProviders {
99 public static final FileSystemProvider ZIP_PROVIDER ;
1010 static {
1111 FileSystemProvider foundZipProvider = null ;
12- for (FileSystemProvider installedProvider : FileSystemProvider .installedProviders ()) {
13- if (installedProvider .getScheme ().equals ("jar" )) {
14- foundZipProvider = installedProvider ;
15- break ;
12+ final ClassLoader ccl = Thread .currentThread ().getContextClassLoader ();
13+ try {
14+ // We are loading "installed" FS providers that are loaded from the system classloader anyway
15+ // To avoid potential ClassCastExceptions we are setting the context classloader to the system one
16+ Thread .currentThread ().setContextClassLoader (ClassLoader .getSystemClassLoader ());
17+ for (FileSystemProvider installedProvider : FileSystemProvider .installedProviders ()) {
18+ if (installedProvider .getScheme ().equals ("jar" )) {
19+ foundZipProvider = installedProvider ;
20+ break ;
21+ }
1622 }
23+ } finally {
24+ Thread .currentThread ().setContextClassLoader (ccl );
1725 }
1826 ZIP_PROVIDER = foundZipProvider ;
1927 }
You can’t perform that action at this time.
0 commit comments