< prev index next >

src/java.base/share/classes/java/lang/ClassLoader.java

Print this page
rev 12062 : 8081674: EmptyStackException at startup if running with extended or unsupported charset

@@ -1732,11 +1732,12 @@
             }
         }
         // Invoked in the VM to determine the context class in
         // JNI_Load/JNI_Unload
         static Class<?> getFromClass() {
-            return ClassLoader.nativeLibraryContext.peek().fromClass;
+            return ClassLoader.nativeLibraryContext.empty() ?
+                null : ClassLoader.nativeLibraryContext.peek().fromClass;
         }
     }
 
     // All native library names we've loaded.
     private static Vector<String> loadedLibraryNames = new Vector<>();
< prev index next >