< prev index next >

src/java.base/share/classes/sun/launcher/LauncherHelper.java

Print this page
rev 14279 : [mq]: 8140281-deprecation-optional.get

*** 527,545 **** Optional<Module> om = layer.findModule(mainModule); if (!om.isPresent()) { // should not happen throw new InternalError("Module " + mainModule + " not in boot Layer"); } ! Module m = om.get(); // get main class if (mainClass == null) { Optional<String> omc = m.getDescriptor().mainClass(); if (!omc.isPresent()) { abort(null, "java.launcher.module.error1", mainModule); } ! mainClass = omc.get(); } // load the class from the module Class<?> c = Class.forName(m, mainClass); if (c == null && System.getProperty("os.name", "").contains("OS X") --- 527,545 ---- Optional<Module> om = layer.findModule(mainModule); if (!om.isPresent()) { // should not happen throw new InternalError("Module " + mainModule + " not in boot Layer"); } ! Module m = om.getWhenPresent(); // get main class if (mainClass == null) { Optional<String> omc = m.getDescriptor().mainClass(); if (!omc.isPresent()) { abort(null, "java.launcher.module.error1", mainModule); } ! mainClass = omc.getWhenPresent(); } // load the class from the module Class<?> c = Class.forName(m, mainClass); if (c == null && System.getProperty("os.name", "").contains("OS X")
*** 814,824 **** if (!om.isPresent()) { abort(null, "java.launcher.cls.error5"); } // load the FX launcher class ! fxLauncherClass = Class.forName(om.get(), JAVAFX_LAUNCHER_CLASS_NAME); if (fxLauncherClass == null) { abort(null, "java.launcher.cls.error5"); } try { --- 814,824 ---- if (!om.isPresent()) { abort(null, "java.launcher.cls.error5"); } // load the FX launcher class ! fxLauncherClass = Class.forName(om.getWhenPresent(), JAVAFX_LAUNCHER_CLASS_NAME); if (fxLauncherClass == null) { abort(null, "java.launcher.cls.error5"); } try {
< prev index next >