Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentService - isUserContained - throws ClassCastException #887

Open
rsoika opened this issue Dec 12, 2024 · 1 comment
Open

DocumentService - isUserContained - throws ClassCastException #887

rsoika opened this issue Dec 12, 2024 · 1 comment

Comments

@rsoika
Copy link
Member

rsoika commented Dec 12, 2024

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:

public boolean isUserContained(List<?> nameList) {
    if (nameList == null) {
        return false;
    }
    
    List<String> userNameList = getUserNameList();
    
    for (Object item : nameList) {
        if (item != null) {
            String aName = item.toString();
            if (!aName.isEmpty() && 
                userNameList.stream().anyMatch(aName::equals)) {
                return true;
            }
        }
    }
    return false;
}
@rsoika
Copy link
Member Author

rsoika commented Dec 12, 2024

should be patched for version 6.0x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant