Description
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"
logger.error("Search file is not of java object instanceof Date");
2.use "query" to replace "query.toString()" when print log
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); }
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
if (response == null) { logger.warn("Error running search query. searchCriteria=" + searchCriteria.toString()); throw restErrorUtil.createRESTException( "Error running search query", MessageEnums.ERROR_SYSTEM); }
Attachments
Attachments
Issue Links
- links to