5 Replies Latest reply on Jul 28, 2010 5:58 AM by David D

    RoleGroups bug

    Grzegorz Matuszewski Newbie

      I think I found a bug in Seam 2.1.2.GA regarding @RoleGroups. I have defined a role entity without a @RoleGroup annotation. When I try to delete a role using


      IdentityManager.instance().deleteRole(role)



      I get a NullPointerException. The problem is in the JpaIdentityStore class (listRoleMembers method). On creation the roleGroupsProperty is set to empty instance of AnnotatedBeanProperty class


      if (roleClass != null)
            {         
               roleNameProperty = new AnnotatedBeanProperty(roleClass, RoleName.class);
               roleGroupsProperty = new AnnotatedBeanProperty(roleClass, RoleGroups.class);
               ...
      



      but in the listRoleMembers method it is used like:



      if (roleGroupsProperty != null) // <- wrong test
            {
      ...
            }



      I think the code should use the .isSet method:


      if (roleGroupsProperty.isSet())
            {
      ...
            }



      Problem occurs in methods getRoleGroups and listRoleMembers.
      I can't find a JIRA issue related to this bug.