[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4469) jpaidentity store null pointer when role collection is not initialezed. should throw exception.

Eric Link (JIRA) jira-events at lists.jboss.org
Wed Nov 4 14:56:05 EST 2009


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

        


More information about the seam-issues mailing list