ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm O hEigeartaigh <cohei...@apache.org>
Subject Re: Review Request 65793: RANGER-1991 : fix errors detected by static code analysis
Date Mon, 26 Feb 2018 12:38:27 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65793/#review198280
-----------------------------------------------------------



+                                       String key = (String) entry.getKey();
+                                       String value = (String) entry.getValue();
+                                       if (RANGER_SECTION_NAME.equals(value)) {
+                                               rangerInternalPropertyKeys.add(key);
                                        }

You could move the "key" part here into the if statement.

+                               logger.error("Error creating user: "+vXUser.getName(),ex);

Add spaces around "=" and ","

- Colm O hEigeartaigh


On Feb. 24, 2018, 4:19 p.m., Zsombor Gegesy wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65793/
> -----------------------------------------------------------
> 
> (Updated Feb. 24, 2018, 4:19 p.m.)
> 
> 
> Review request for ranger.
> 
> 
> Bugs: RANGER-1991
>     https://issues.apache.org/jira/browse/RANGER-1991
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> FindBugs/SpotBug detects a couple of problems with the code base:
> * Incorrect class casting - in XXServiceDef.equals
> * Unnecessary NPE checks - for variables which is known to be non-null (for example,
because in other places a method is called on that object). In ServiceREST.java PublicAPIs.java,
ServiceUtil.java and independently in XUserMgr.java
> * Collection.contains method call which is never true - in ServiceDBStore.validatePolicyItems
for policyItem.getAccesses().contains("") - because getAccesses doesn't store String objects
> * Making public partially initialized objects in HadoopConfigHolder.initResourceMap()
> * Calling toString on array, which is not too readable
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/client/HadoopConfigHolder.java
fd925aa4 
>   hdfs-agent/src/test/java/org/apache/ranger/services/hdfs/RangerHdfsAuthorizerTest.java
46f92ecb 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 7aee4336 
>   security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java cecb3f8b 
>   security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java 92b0e031

>   security-admin/src/main/java/org/apache/ranger/common/ServiceUtil.java e82d33d3 
>   security-admin/src/main/java/org/apache/ranger/entity/XXServiceDef.java 3d496831 
>   security-admin/src/main/java/org/apache/ranger/rest/PublicAPIs.java 7818eb59 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 9e4d799b 
> 
> 
> Diff: https://reviews.apache.org/r/65793/diff/1/
> 
> 
> Testing
> -------
> 
> Tested locally
> 
> 
> Thanks,
> 
> Zsombor Gegesy
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message