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



It might be better to ecapsulate following code into a function, then call it. 
These codes are functionally independent. And the logAuthorizationConext 
function had included lots of line code.
                        RequestType requestType  = context.getRequestType();
                        String          accessType   = 
mapToRangerAccessType(context);
                        Principal       principal        = 
context.getUserPrincipal();

                        String contextString = new 
String("AuthorizationContext: ");
                        contextString  = contextString + 
"context.getResource()= " + ((resource != null ) ? resource : "");
                        contextString  = contextString + ", solarParams= " + (( 
solrParams != null ) ? solrParams : "");
                        contextString  = contextString + ", requestType= " + (( 
requestType != null ) ? requestType : "");
                        contextString  = contextString + ", ranger.requestType= 
" + ((accessType != null ) ? accessType : "");
                        contextString  = contextString + ", userPrincipal= " + 
((principal != null ) ? principal : "");
                        contextString  = contextString + ", userName= "  + 
userName;
                        contextString  = contextString + ", groups= " + groups;
                        contextString  = contextString + ", ipAddress= " + 
ipAddress;
                        contextString  = contextString + ", collections= " + 
collections;
                        contextString  = contextString + ", headers= " + 
headers;

- Qiang Zhang


On 六月 21, 2017, 12:04 a.m., Ramesh Mani wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60256/
> -----------------------------------------------------------
> 
> (Updated 六月 21, 2017, 12:04 a.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-1658
>     https://issues.apache.org/jira/browse/RANGER-1658
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> RANGER-1658: Solr gives NPE while printing the AuthorizationContext in INFO 
> and DEBUG log
> 
> 
> Diffs
> -----
> 
>   
> plugin-solr/src/main/java/org/apache/ranger/authorization/solr/authorizer/RangerSolrAuthorizer.java
>  bf22b47 
> 
> 
> Diff: https://reviews.apache.org/r/60256/diff/1/
> 
> 
> Testing
> -------
> 
> Testing done with Local VM
> 
> 
> Thanks,
> 
> Ramesh Mani
> 
>

Reply via email to