This is an automated email from the ASF dual-hosted git repository.

pradeep pushed a commit to branch RANGER-5061_jan21
in repository https://gitbox.apache.org/repos/asf/ranger.git

commit 6a25e844c0891b42af1c1348ee45495fce961759
Author: Pradeep Agrawal <[email protected]>
AuthorDate: Tue Jan 21 17:04:06 2025 +0530

    RANGER-5061: Fix for Admin audit page loading failure
    
    Change-Id: Ib7241c3d2673a358c3753cb035e9a14a6e6be5a4
---
 .../src/main/java/org/apache/ranger/common/SearchUtil.java         | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java 
b/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java
index 75eac3cdb1..fba44e2723 100644
--- a/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java
+++ b/security-admin/src/main/java/org/apache/ranger/common/SearchUtil.java
@@ -22,6 +22,7 @@
  */
 package org.apache.ranger.common;
 
+import org.apache.commons.collections.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -474,7 +475,7 @@ protected StringBuilder buildWhereClause(SearchCriteria 
searchCriteria, List<Sea
                     intValueList = (Collection<Number>) paramValue;
                 }
 
-                if (!intValueList.isEmpty()) {
+                if (CollectionUtils.isNotEmpty(intValueList)) {
                     if (searchField.getCustomCondition() == null) {
                         if (intValueList.size() <= minInListLength) {
                             whereClause.append(" and ");
@@ -623,7 +624,7 @@ protected void resolveQueryParams(Query query, 
SearchCriteria searchCriteria, Li
                     intValueList = (Collection<Number>) paramValue;
                 }
 
-                if (!intValueList.isEmpty() && intValueList.size() <= 
minInListLength) {
+                if (CollectionUtils.isNotEmpty(intValueList) && 
intValueList.size() <= minInListLength) {
                     int count = -1;
 
                     for (Number value : intValueList) {
@@ -631,7 +632,7 @@ protected void resolveQueryParams(Query query, 
SearchCriteria searchCriteria, Li
 
                         query.setParameter(searchField.getClientFieldName() + 
"_" + count, value);
                     }
-                } else if (intValueList.size() > 1) {
+                } else if (CollectionUtils.isNotEmpty(intValueList) && 
intValueList.size() > 1) {
                     query.setParameter(searchField.getClientFieldName(), 
intValueList);
                 }
             } else if (searchField.getDataType() == 
SearchField.DATA_TYPE.STR_LIST) {

Reply via email to