Skip to content

Commit

Permalink
PageStyleManager: avoid String.toLowerCase() using equalsIgnoreCase
Browse files Browse the repository at this point in the history
Code cleanup
  • Loading branch information
EcljpseB0T authored and akurtakov committed Jun 21, 2023
1 parent 773a421 commit eeb83ef
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,8 @@ private int getIntProperty(String key, int defaulValue) {
}

private boolean getBooleanProperty(String key, boolean defaultValue) {
boolean booleanValue = defaultValue;
String value = getProperty(key);
if (value != null)
booleanValue = value.equalsIgnoreCase("true"); //$NON-NLS-1$
return booleanValue;
return value == null ? defaultValue : Boolean.parseBoolean(value);
}


Expand Down Expand Up @@ -375,9 +372,7 @@ public boolean getShowLinkDescription() {
key = ".show-link-description"; //$NON-NLS-1$
value = getProperty(key);
}
if (value == null)
value = "true"; //$NON-NLS-1$
return value.toLowerCase().equals("true"); //$NON-NLS-1$
return (value == null) || Boolean.parseBoolean(value);
}

public boolean showHomePageNavigation() {
Expand All @@ -387,9 +382,7 @@ public boolean showHomePageNavigation() {
key = ".show-home-page-navigation"; //$NON-NLS-1$
value = getProperty(key);
}
if (value == null)
value = "true"; //$NON-NLS-1$
return value.equalsIgnoreCase("true"); //$NON-NLS-1$
return (value == null) || Boolean.parseBoolean(value);
}


Expand Down

0 comments on commit eeb83ef

Please sign in to comment.