You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we call isUserContained with a mixed list of string and long values (this can be the case in a JSF Front End scenario) we run into ClassCastException problem
Solution:
publicbooleanisUserContained(List<?> nameList) {
if (nameList == null) {
returnfalse;
}
List<String> userNameList = getUserNameList();
for (Objectitem : nameList) {
if (item != null) {
StringaName = item.toString();
if (!aName.isEmpty() &&
userNameList.stream().anyMatch(aName::equals)) {
returntrue;
}
}
}
returnfalse;
}
The text was updated successfully, but these errors were encountered:
When we call
isUserContained
with a mixed list of string and long values (this can be the case in a JSF Front End scenario) we run intoClassCastException
problemSolution:
The text was updated successfully, but these errors were encountered: