mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8291954: Use Optional.isEmpty instead of !Optional.isPresent in java.base
Reviewed-by: jpai, alanb, lancea, rriggs, bpb
This commit is contained in:
parent
87cda21c5d
commit
ae52053757
6 changed files with 21 additions and 23 deletions
|
@ -726,7 +726,7 @@ public final class LauncherHelper {
|
|||
// main module is in the boot layer
|
||||
ModuleLayer layer = ModuleLayer.boot();
|
||||
Optional<Module> om = layer.findModule(mainModule);
|
||||
if (!om.isPresent()) {
|
||||
if (om.isEmpty()) {
|
||||
// should not happen
|
||||
throw new InternalError("Module " + mainModule + " not in boot Layer");
|
||||
}
|
||||
|
@ -735,7 +735,7 @@ public final class LauncherHelper {
|
|||
// get main class
|
||||
if (mainClass == null) {
|
||||
Optional<String> omc = m.getDescriptor().mainClass();
|
||||
if (!omc.isPresent()) {
|
||||
if (omc.isEmpty()) {
|
||||
abort(null, "java.launcher.module.error1", mainModule);
|
||||
}
|
||||
mainClass = omc.get();
|
||||
|
@ -1023,7 +1023,7 @@ public final class LauncherHelper {
|
|||
|
||||
// find the module with the FX launcher
|
||||
Optional<Module> om = ModuleLayer.boot().findModule(JAVAFX_GRAPHICS_MODULE_NAME);
|
||||
if (!om.isPresent()) {
|
||||
if (om.isEmpty()) {
|
||||
abort(null, "java.launcher.cls.error5");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue