< prev index next >

src/java.base/share/classes/jdk/internal/loader/ClassLoaders.java

Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb

*** 57,78 **** // Creates the built-in class loaders. static { // -Xbootclasspath/a or -javaagent with Boot-Class-Path attribute String append = VM.getSavedProperty("jdk.boot.class.path.append"); BOOT_LOADER = ! new BootClassLoader((append != null && append.length() > 0) ? new URLClassPath(append, true) : null); PLATFORM_LOADER = new PlatformClassLoader(BOOT_LOADER); // A class path is required when no initial module is specified. // In this case the class path defaults to "", meaning the current // working directory. When an initial module is specified, on the // contrary, we drop this historic interpretation of the empty // string and instead treat it as unspecified. String cp = System.getProperty("java.class.path"); ! if (cp == null || cp.length() == 0) { String initialModuleName = System.getProperty("jdk.module.main"); cp = (initialModuleName == null) ? "" : null; } URLClassPath ucp = new URLClassPath(cp, false); APP_LOADER = new AppClassLoader(PLATFORM_LOADER, ucp); --- 57,78 ---- // Creates the built-in class loaders. static { // -Xbootclasspath/a or -javaagent with Boot-Class-Path attribute String append = VM.getSavedProperty("jdk.boot.class.path.append"); BOOT_LOADER = ! new BootClassLoader((append != null && !append.isEmpty()) ? new URLClassPath(append, true) : null); PLATFORM_LOADER = new PlatformClassLoader(BOOT_LOADER); // A class path is required when no initial module is specified. // In this case the class path defaults to "", meaning the current // working directory. When an initial module is specified, on the // contrary, we drop this historic interpretation of the empty // string and instead treat it as unspecified. String cp = System.getProperty("java.class.path"); ! if (cp == null || cp.isEmpty()) { String initialModuleName = System.getProperty("jdk.module.main"); cp = (initialModuleName == null) ? "" : null; } URLClassPath ucp = new URLClassPath(cp, false); APP_LOADER = new AppClassLoader(PLATFORM_LOADER, ucp);
< prev index next >