jpaidentity store null pointer when role collection is not initialezed. should throw
exception.
-----------------------------------------------------------------------------------------------
Key: JBSEAM-4469
URL:
https://jira.jboss.org/jira/browse/JBSEAM-4469
Project: Seam
Issue Type: Bug
Components: Framework
Affects Versions: 2.2.0.GA
Environment: jboss 5.1, linux x64, jdk 1.5
Reporter: Eric Link
jpa identity store requires the roles collection to be initialezed, which is fine. if the
collection is null, then a null pointer is thrown, but it is not clear _why_ w/o looking
at the source. could add guard check and throw exception w/ explanaion
Caused by: java.lang.NullPointerException
at
org.jboss.seam.security.management.JpaIdentityStore.grantRole(JpaIdentityStore.java:374)
at
org.jboss.seam.security.management.IdentityManager.grantRole(IdentityManager.java:136)
if (xrefClass == null)
{
// If this is a Many-To-Many relationship, simply add the role
if ( userRolesProperty.getValue(user) == null ) { //NEW
throw new IllegalStateException("@UserRoles collection is nul, it must
be initialized to grant rolesl"); //NEW
} //NEW
((Collection) userRolesProperty.getValue(user)).add(roleToGrant);
}
else
{
// Otherwise we need to insert a cross-reference entity instance
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira