Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KostasTsiounis committed Nov 28, 2023
1 parent d637b49 commit d54d2e9
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -311,22 +311,22 @@ private static void getProfileID(Properties props) {
}
String defaultMatch = null;
for (Object keyObject : props.keySet()) {
// A matching property is found.
if (keyObject instanceof String key) {
if (key.startsWith(potentialProfileID)) {
// Find the property for specifying if this is the default profile.
if (key.endsWith(".desc.default")) {
// Check if property is set to true.
if (Boolean.parseBoolean(props.getProperty(key))) {
// Check if multiple defaults exist and act accordingly.
if (defaultMatch == null) {
defaultMatch = key.split("\\.desc")[0];
} else {
printStackTraceAndExit("Multiple default RestrictedSecurity"
+ " profiles for " + selectedProfile);
}
/* Find the property that pertains to this profileID and indicates whether
* it is the default one.
*/
if (key.startsWith(potentialProfileID) && key.endsWith(".desc.default")) {
// Check if property is set to true.
if (Boolean.parseBoolean(props.getProperty(key))) {
// Check if multiple defaults exist and act accordingly.
if (defaultMatch == null) {
defaultMatch = key.split("\\.desc")[0];
} else {
printStackTraceAndExit("Multiple default RestrictedSecurity"
+ " profiles for " + selectedProfile);
}
}

}
}
}
Expand All @@ -341,11 +341,13 @@ private static void getProfileID(Properties props) {

private static void checkIfKnownProfileSupported() {
if (profileID.contains("NSS") && !isNSSSupported) {
printStackTraceAndExit("NSS profiles are not supported on this platform.");
printStackTraceAndExit("NSS RestrictedSecurity profiles are not supported"
+ " on this platform.");
}

if (profileID.contains("OpenJCEPlus") && !isOpenJCEPlusSupported) {
printStackTraceAndExit("OpenJCEPlus profiles are not supported on this platform.");
printStackTraceAndExit("OpenJCEPlus RestrictedSecurity profiles are not supported"
+ " on this platform.");
}

if (debug != null) {
Expand Down

0 comments on commit d54d2e9

Please sign in to comment.