Skip to content

Commit

Permalink
fix: fix array java.lang.IndexOutOfBoundsException
Browse files Browse the repository at this point in the history
Signed-off-by: Arnab Dutta <[email protected]>
  • Loading branch information
duttarnab committed Feb 7, 2024
1 parent f784ed3 commit dcfdf06
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import jakarta.inject.Named;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;

Expand Down Expand Up @@ -423,7 +424,7 @@ public List<CustomObjectAttribute> removeInActiveCustomAttribute(List<CustomObje
List<JansAttribute> attList = findAttributeByName(attributeName);
logger.debug("attributeName:{} data is attList: {}", attributeName, attList);

if (!isEmptyOrNullCollection(attList) && !GluuStatus.ACTIVE.getValue().equalsIgnoreCase(attList.get(0).getStatus().getValue())) {
if (CollectionUtils.isNotEmpty(attList) && !GluuStatus.ACTIVE.getValue().equalsIgnoreCase(attList.get(0).getStatus().getValue())) {
logger.info("Removing attribute as it is not active attributeName: {} , status:{}", attributeName, attList.get(0).getStatus().getValue());
it.remove();
}
Expand All @@ -443,8 +444,4 @@ private String getDnForAttribute(String inum) {
}
return String.format("inum=%s,%s", inum, attributesDn);
}

private static boolean isEmptyOrNullCollection(Collection<?> collection) {
return (collection == null || collection.isEmpty());
}
}

0 comments on commit dcfdf06

Please sign in to comment.