Skip to content

Commit

Permalink
RANGER-855 - Fix "BooleanInstantiation" issues
Browse files Browse the repository at this point in the history
Signed-off-by: Alok Lal <alok@apache.org>
  • Loading branch information
coheigea authored and aloklal99 committed Mar 25, 2016
1 parent 9a424ce commit e156625
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion dev-support/ranger-pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<exclude name="AvoidBranchingStatementAsLastInLoop" />
<exclude name="AvoidThreadGroup" />
<exclude name="AvoidUsingHardCodedIP" />
<exclude name="BooleanInstantiation" />
<exclude name="ClassCastExceptionWithToArray" />
<exclude name="CollapsibleIfStatements" />
<exclude name="DoubleCheckedLocking" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ public Boolean parseBoolean(String value, String errorMessage,
if (stringUtil.isEmpty(value)) {
return null;
} else {
return new Boolean(value.trim());
return Boolean.valueOf(value.trim());
}
} catch (Throwable t) {
throw createRESTException(errorMessage, messageEnum, objectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void doFilter(ServletRequest request, ServletResponse response,
if (userSession != null) {

Object ssoEnabledObj = request.getAttribute("ssoEnabled");
Boolean ssoEnabled = ssoEnabledObj != null ? new Boolean(String.valueOf(ssoEnabledObj)) : PropertiesUtil.getBooleanProperty("ranger.sso.enabled", false);
Boolean ssoEnabled = ssoEnabledObj != null ? Boolean.valueOf(String.valueOf(ssoEnabledObj)) : PropertiesUtil.getBooleanProperty("ranger.sso.enabled", false);
userSession.setSSOEnabled(ssoEnabled);

if (userSession.getClientTimeOffsetInMinute() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,6 @@ public void syncResponseWithJsonRequest() {
this.setResourceName(null);
this.setRepositoryType(null);
this.setVersion(null);
this.setIsRecursive(new Boolean(null));
this.setIsRecursive(Boolean.FALSE);
}
}

0 comments on commit e156625

Please sign in to comment.