[ 
https://issues.apache.org/jira/browse/RANGER-1399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Qiang Zhang updated RANGER-1399:
--------------------------------
    Attachment:     (was: 
0001-RANGER-1399-Do-some-code-improvement-in-Java-method-.patch)

> Do some code improvement in Java method SolrUtil.searchResources
> ----------------------------------------------------------------
>
>                 Key: RANGER-1399
>                 URL: https://issues.apache.org/jira/browse/RANGER-1399
>             Project: Ranger
>          Issue Type: Improvement
>          Components: admin
>            Reporter: Qiang Zhang
>            Assignee: Qiang Zhang
>            Priority: Minor
>              Labels: patch
>         Attachments: 
> 0001-RANGER-1399-Do-some-code-improvement-in-Java-method-.patch
>
>   Original Estimate: 12h
>  Remaining Estimate: 12h
>
> In method searchResources of class 
> /security-admin-web/src/main/java/org/apache/ranger/solr/SolrUtil.java,
> there is some code can be improved:
> 1.There is spelling error, "Search file" should be "Search field"
> {code}
> logger.error("Search file is not of java object instanceof Date");
> {code}
> 2.use "query" to replace "query.toString()" when print log
> {code}
> if (logger.isDebugEnabled()) {
>       logger.debug("SOLR QUERY=" + query.toString());
> }
> if (response == null || response.getStatus() != 0) {
>       logger.error("Error running query. query=" + query.toString()
>                       + ", response=" + response);
>       throw restErrorUtil.createRESTException("Error running query",
>                       MessageEnums.ERROR_SYSTEM);
> }
> {code}
> 3.In Java method SolrAccessAuditsService.searchXAccessAudits, there is 
> duplicate code to check response, in fact it would never be called, because 
> response has been checked before returning in SolrUtil.searchResources, so 
> remove it
> {code}
> if (response == null) {
>       logger.warn("Error running search query. searchCriteria="
>                       + searchCriteria.toString());
>       throw restErrorUtil.createRESTException(
>                       "Error running search query", 
> MessageEnums.ERROR_SYSTEM);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to