This is an automated email from the ASF dual-hosted git repository.
abhi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git
The following commit(s) were added to refs/heads/master by this push:
new a828d3f645 RANGER-5061: Fix for Admin audit page loading failure (#514)
a828d3f645 is described below
commit a828d3f645c1e8eca66bbac1a0ed5bbc7f7ba906
Author: PradeeP AgrawaL <[email protected]>
AuthorDate: Sun Jan 26 10:17:57 2025 +0530
RANGER-5061: Fix for Admin audit page loading failure (#514)
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 b9ef53aaad..ff701661c2 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;
@@ -477,7 +478,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 ");
@@ -628,7 +629,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) {
@@ -636,7 +637,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) {