Skip to content

Commit 15ac91d

Browse files
committed
Update according to code review
1 parent 81d196e commit 15ac91d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

closed/src/java.base/share/classes/openj9/internal/security/RestrictedSecurity.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public final class RestrictedSecurity {
6868

6969
private static final boolean isNSSSupported;
7070
private static final boolean isOpenJCEPlusSupported;
71-
private static boolean isOpenJCEPlusModuleExist;
71+
private static final boolean isOpenJCEPlusModuleExist;
7272

7373
private static final boolean userSetProfile;
7474
private static final boolean shouldEnableSecurity;
@@ -140,12 +140,9 @@ public String[] run() {
140140
isOpenJCEPlusSupported = isOsSupported && isArchSupported;
141141

142142
// Check whether the OpenJCEPlus module exists.
143-
isOpenJCEPlusModuleExist = false;
144143
ModuleLayer layer = ModuleLayer.boot();
145144
Optional<Module> module = layer.findModule("openjceplus");
146-
if (module.isPresent()) {
147-
isOpenJCEPlusModuleExist = true;
148-
}
145+
isOpenJCEPlusModuleExist = module.isPresent();
149146

150147
// Check the default solution to see if FIPS is supported.
151148
isFIPSSupported = isNSSSupported;
@@ -397,7 +394,7 @@ private static void checkIfKnownProfileSupported() {
397394
+ " on this platform.");
398395
}
399396

400-
if (profileID.contains("OpenJCEPlus") && !isOpenJCEPlusModuleExist) {
397+
if (!isOpenJCEPlusModuleExist && profileID.contains("OpenJCEPlus")) {
401398
printStackTraceAndExit("FIPS 140-3 profile specified. Required OpenJCEPlus"
402399
+ " module not found.");
403400
}

0 commit comments

Comments
 (0)