8198653: ClassLoader::getSystemClassLoader throws InternalError when called after shutdown
authormchung
Sat, 24 Feb 2018 09:41:42 -0800
changeset 48984 b5d1fb0701d4
parent 48983 df25d1a5d78a
child 48985 3fbc7f109dad
8198653: ClassLoader::getSystemClassLoader throws InternalError when called after shutdown Reviewed-by: dholmes
src/java.base/share/classes/java/lang/ClassLoader.java
--- a/src/java.base/share/classes/java/lang/ClassLoader.java	Mon Feb 19 04:50:50 2018 +0100
+++ b/src/java.base/share/classes/java/lang/ClassLoader.java	Sat Feb 24 09:41:42 2018 -0800
@@ -1922,7 +1922,7 @@
             case 3:
                 String msg = "getSystemClassLoader cannot be called during the system class loader instantiation";
                 throw new IllegalStateException(msg);
-            case 4:
+            default:
                 // system fully initialized
                 assert VM.isBooted() && scl != null;
                 SecurityManager sm = System.getSecurityManager();
@@ -1930,8 +1930,6 @@
                     checkClassLoaderPermission(scl, Reflection.getCallerClass());
                 }
                 return scl;
-            default:
-                throw new InternalError("should not reach here");
         }
     }