Skip to content

Commit

Permalink
Update according to code review
Browse files Browse the repository at this point in the history
  • Loading branch information
taoliult committed Mar 20, 2023
1 parent eab79e1 commit 734165e
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ private void initProviders() {
String providerInfo = securityProps
.getProperty(propsPrefix + ".jce.provider." + pNum);

if (providerInfo == null || providerInfo.trim().isEmpty()) {
if ((providerInfo == null) || providerInfo.trim().isEmpty()) {
break;
}

Expand Down Expand Up @@ -849,14 +849,14 @@ boolean isRestrictedProviderAllowed(String providerName) {
debug.println("Checking the provider " + providerName + " in restricted security mode.");
}

// Remove the provider class package name if there is.
int pos = providerName.lastIndexOf('.');
providerName = (pos < 0) ? providerName : providerName.substring(pos + 1, providerName.length());

// Remove argument, e.g. -NSS-FIPS, if there is.
pos = providerName.indexOf('-');
int pos = providerName.indexOf('-');
providerName = (pos < 0) ? providerName : providerName.substring(0, pos);

// Remove the provider class package name if there is.
pos = providerName.lastIndexOf('.');
providerName = (pos < 0) ? providerName : providerName.substring(pos + 1, providerName.length());

// Check if the provider is in restricted security provider list.
// If not, the provider won't be registered.
if (providersSimpleName.contains(providerName)) {
Expand Down Expand Up @@ -890,7 +890,7 @@ private void listAudit() {

for (int num = 1;; ++num) {
String desc = securityProps.getProperty("RestrictedSecurity" + num + ".desc.name");
if (desc == null || desc.trim().isEmpty()) {
if ((desc == null) || desc.trim().isEmpty()) {
break;
}
System.out.println("RestrictedSecurity" + num + ".desc.name: "
Expand Down

0 comments on commit 734165e

Please sign in to comment.