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

    RoleGroups bug

    rhebe

      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.


        • 1. Re: RoleGroups bug
          rhebe

          Grzegorz Matuszewski wrote on Mar 26, 2009 17:43:


          I think I found a bug in Seam 2.1.2.GA regarding @RoleGroups.



          I meant Seam 2.1.1.GA

          • 2. Re: RoleGroups bug
            norman

            Looks JIRA-worthy to me. 

            • 3. Re: RoleGroups bug
              buckmin.erdem.agaoglu.gmail.com

              i think i found a new bug now in Seam 2.1.2.CR1 which is very close to this one.


              if using roles without @RoleGroups, JpaIdentityStore.listRoleMembers returns null.


              but in JpaIdentityStore.deleteRole(role)


              List<String> roles = listRoleMembers(role);
              for (String r : roles)



              and in JpaIdentityStore.listMembers(String role)


              for (String roleName : listRoleMembers(role))



              so for-each style loop over null throws NPE.


              I dont know if this is a Java 6 problem only.

              • 4. Re: RoleGroups bug
                oyvind

                Erdem Agaoglu wrote on May 12, 2009 17:02:


                i think i found a new bug now in Seam 2.1.2.CR1 which is very close to this one.


                if using roles without @RoleGroups, JpaIdentityStore.listRoleMembers returns null.


                but in JpaIdentityStore.deleteRole(role)

                List<String> roles = listRoleMembers(role);
                for (String r : roles)



                and in JpaIdentityStore.listMembers(String role)

                for (String roleName : listRoleMembers(role))



                so for-each style loop over null throws NPE.


                I dont know if this is a Java 6 problem only.



                This bug still exist in Seam 2.2.0.GA. I haven't found any Jira issues for this. Anyone?

                • 5. Re: RoleGroups bug
                  cinconnu