Skip to content

Commit

Permalink
RANGER-5061: Fix for Admin audit page loading failure
Browse files Browse the repository at this point in the history
Change-Id: Ib7241c3d2673a358c3753cb035e9a14a6e6be5a4
  • Loading branch information
pradeepagrawal8184 committed Jan 21, 2025
1 parent 9f9bf0f commit 6a25e84
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ");
Expand Down Expand Up @@ -623,15 +624,15 @@ 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) {
count++;

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) {
Expand Down

0 comments on commit 6a25e84

Please sign in to comment.