test_class.declarator: groupId = "gr" + UUID.randomUUID()
test_class.modifier: private final
test_class.original_string: private final String groupId = "gr" + UUID.randomUUID();
test_class.type: String
test_class.var_name: groupId
test_class.declarator: uMgr
test_class.modifier: private
test_class.original_string: private UserManagerImpl uMgr;
test_class.type: UserManagerImpl
test_class.var_name: uMgr
test_class.declarator: group
test_class.modifier: private
test_class.original_string: private GroupImpl group;
test_class.type: GroupImpl
test_class.var_name: group
test_class.file: oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/GroupImplTest.java
test_class.identifier: GroupImplTest
test_class.superclass: extends AbstractSecurityTest
test_case.body: @Test
      public void testImpactOfOak8054AddingMembers() throws Exception {
          Tree groupTree = root.getTree(group.getPath());
          groupTree.setProperty(REP_MEMBERS, ImmutableList.of(new UserProvider(root, ConfigurationParameters.EMPTY).getContentID(getTestUser().getID())), Type.STRINGS);
          root.commit();
  
          group.addMember(uMgr.createUser("userid", null));
          root.commit();
  
          groupTree = root.getTree(group.getPath());
          PropertyState membersProp = groupTree.getProperty(REP_MEMBERS);
          assertEquals(Type.WEAKREFERENCES, membersProp.getType());
          assertEquals(2, membersProp.count());
      }
test_case.class_method_signature: GroupImplTest.testImpactOfOak8054AddingMembers()
test_case.full_signature: @Test public void testImpactOfOak8054AddingMembers()
test_case.identifier: testImpactOfOak8054AddingMembers
test_case.invocations: getTree getPath setProperty of getContentID getID getTestUser commit addMember createUser commit getTree getPath getProperty assertEquals getType assertEquals count
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testImpactOfOak8054AddingMembers()
focal_class.declarator: log = LoggerFactory.getLogger(GroupImpl.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(GroupImpl.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.file: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/GroupImpl.java
focal_class.identifier: GroupImpl
focal_class.interfaces: implements Group
focal_class.class_method_signature: GroupImpl.GroupImpl(String id, Tree tree, UserManagerImpl userManager)
focal_class.full_signature:   GroupImpl(String id, Tree tree, UserManagerImpl userManager)
focal_class.identifier: GroupImpl
focal_class.parameters: (String id, Tree tree, UserManagerImpl userManager)
focal_class.signature:  GroupImpl(String id, Tree tree, UserManagerImpl userManager)
focal_class.class_method_signature: GroupImpl.checkValidTree(@NotNull Tree tree)
focal_class.full_signature: @Override void checkValidTree(@NotNull Tree tree)
focal_class.identifier: checkValidTree
focal_class.modifiers: @Override
focal_class.parameters: (@NotNull Tree tree)
focal_class.return: void
focal_class.signature: void checkValidTree(@NotNull Tree tree)
focal_class.class_method_signature: GroupImpl.isGroup()
focal_class.full_signature: @Override public boolean isGroup()
focal_class.identifier: isGroup
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isGroup()
focal_class.class_method_signature: GroupImpl.getPrincipal()
focal_class.full_signature: @NotNull @Override public Principal getPrincipal()
focal_class.identifier: getPrincipal
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: ()
focal_class.return: Principal
focal_class.signature: Principal getPrincipal()
focal_class.class_method_signature: GroupImpl.getDeclaredMembers()
focal_class.full_signature: @NotNull @Override public Iterator<Authorizable> getDeclaredMembers()
focal_class.identifier: getDeclaredMembers
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: ()
focal_class.return: Iterator<Authorizable>
focal_class.signature: Iterator<Authorizable> getDeclaredMembers()
focal_class.class_method_signature: GroupImpl.getMembers()
focal_class.full_signature: @NotNull @Override public Iterator<Authorizable> getMembers()
focal_class.identifier: getMembers
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: ()
focal_class.return: Iterator<Authorizable>
focal_class.signature: Iterator<Authorizable> getMembers()
focal_class.class_method_signature: GroupImpl.isDeclaredMember(@NotNull Authorizable authorizable)
focal_class.full_signature: @Override public boolean isDeclaredMember(@NotNull Authorizable authorizable)
focal_class.identifier: isDeclaredMember
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Authorizable authorizable)
focal_class.return: boolean
focal_class.signature: boolean isDeclaredMember(@NotNull Authorizable authorizable)
focal_class.class_method_signature: GroupImpl.isMember(@NotNull Authorizable authorizable)
focal_class.full_signature: @Override public boolean isMember(@NotNull Authorizable authorizable)
focal_class.identifier: isMember
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Authorizable authorizable)
focal_class.return: boolean
focal_class.signature: boolean isMember(@NotNull Authorizable authorizable)
focal_class.class_method_signature: GroupImpl.addMember(@NotNull Authorizable authorizable)
focal_class.full_signature: @Override public boolean addMember(@NotNull Authorizable authorizable)
focal_class.identifier: addMember
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Authorizable authorizable)
focal_class.return: boolean
focal_class.signature: boolean addMember(@NotNull Authorizable authorizable)
focal_class.class_method_signature: GroupImpl.addMembers(@NotNull String... memberIds)
focal_class.full_signature: @NotNull @Override public Set<String> addMembers(@NotNull String... memberIds)
focal_class.identifier: addMembers
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull String... memberIds)
focal_class.return: Set<String>
focal_class.signature: Set<String> addMembers(@NotNull String... memberIds)
focal_class.class_method_signature: GroupImpl.removeMember(@NotNull Authorizable authorizable)
focal_class.full_signature: @Override public boolean removeMember(@NotNull Authorizable authorizable)
focal_class.identifier: removeMember
focal_class.modifiers: @Override public
focal_class.parameters: (@NotNull Authorizable authorizable)
focal_class.return: boolean
focal_class.signature: boolean removeMember(@NotNull Authorizable authorizable)
focal_class.class_method_signature: GroupImpl.removeMembers(@NotNull String... memberIds)
focal_class.full_signature: @NotNull @Override public Set<String> removeMembers(@NotNull String... memberIds)
focal_class.identifier: removeMembers
focal_class.modifiers: @NotNull @Override public
focal_class.parameters: (@NotNull String... memberIds)
focal_class.return: Set<String>
focal_class.signature: Set<String> removeMembers(@NotNull String... memberIds)
focal_class.class_method_signature: GroupImpl.getMembers(boolean includeInherited)
focal_class.full_signature: @NotNull private Iterator<Authorizable> getMembers(boolean includeInherited)
focal_class.identifier: getMembers
focal_class.modifiers: @NotNull private
focal_class.parameters: (boolean includeInherited)
focal_class.return: Iterator<Authorizable>
focal_class.signature: Iterator<Authorizable> getMembers(boolean includeInherited)
focal_class.class_method_signature: GroupImpl.isMember(@NotNull Authorizable authorizable, boolean includeInherited)
focal_class.full_signature: private boolean isMember(@NotNull Authorizable authorizable, boolean includeInherited)
focal_class.identifier: isMember
focal_class.modifiers: private
focal_class.parameters: (@NotNull Authorizable authorizable, boolean includeInherited)
focal_class.return: boolean
focal_class.signature: boolean isMember(@NotNull Authorizable authorizable, boolean includeInherited)
focal_class.class_method_signature: GroupImpl.updateMembers(boolean isRemove, @NotNull String... memberIds)
focal_class.full_signature: @NotNull private Set<String> updateMembers(boolean isRemove, @NotNull String... memberIds)
focal_class.identifier: updateMembers
focal_class.modifiers: @NotNull private
focal_class.parameters: (boolean isRemove, @NotNull String... memberIds)
focal_class.return: Set<String>
focal_class.signature: Set<String> updateMembers(boolean isRemove, @NotNull String... memberIds)
focal_class.class_method_signature: GroupImpl.isValidMemberId(@NotNull String memberId, int importBehavior)
focal_class.full_signature: private boolean isValidMemberId(@NotNull String memberId, int importBehavior)
focal_class.identifier: isValidMemberId
focal_class.modifiers: private
focal_class.parameters: (@NotNull String memberId, int importBehavior)
focal_class.return: boolean
focal_class.signature: boolean isValidMemberId(@NotNull String memberId, int importBehavior)
focal_class.class_method_signature: GroupImpl.isCyclicMembership(@NotNull Group member)
focal_class.full_signature: private boolean isCyclicMembership(@NotNull Group member)
focal_class.identifier: isCyclicMembership
focal_class.modifiers: private
focal_class.parameters: (@NotNull Group member)
focal_class.return: boolean
focal_class.signature: boolean isCyclicMembership(@NotNull Group member)
focal_class.superclass: extends AuthorizableImpl
focal_method.body: @Override
      public boolean addMember(@NotNull Authorizable authorizable) throws RepositoryException {
          if (!isValidAuthorizableImpl(authorizable)) {
              log.warn("Invalid Authorizable: {}", authorizable);
              return false;
          }
  
          AuthorizableImpl authorizableImpl = ((AuthorizableImpl) authorizable);
          if (isEveryone() || authorizableImpl.isEveryone()) {
              log.debug("Attempt to add member to everyone group or create membership for it.");
              return false;
          }
  
          String memberID = authorizable.getID();
          if (authorizableImpl.isGroup()) {
              if (getID().equals(memberID)) {
                  String msg = "Attempt to add a group as member of itself (" + getID() + ").";
                  log.debug(msg);
                  return false;
              }
              if (isCyclicMembership((Group) authorizable)) {
                  String msg = "Cyclic group membership detected for group " + getID() + " and member " + authorizable.getID();
                  throw new ConstraintViolationException(msg);
              }
          }
  
          boolean success = getMembershipProvider().addMember(getTree(), authorizableImpl.getTree());
  
          if (success) {
              getUserManager().onGroupUpdate(this, false, authorizable);
          }
  
          return success;
      }
focal_method.class_method_signature: GroupImpl.addMember(@NotNull Authorizable authorizable)
focal_method.full_signature: @Override public boolean addMember(@NotNull Authorizable authorizable)
focal_method.identifier: addMember
focal_method.invocations: isValidAuthorizableImpl warn isEveryone isEveryone debug getID isGroup equals getID getID debug isCyclicMembership getID getID addMember getMembershipProvider getTree getTree onGroupUpdate getUserManager
focal_method.modifiers: @Override public
focal_method.parameters: (@NotNull Authorizable authorizable)
focal_method.return: boolean
focal_method.signature: boolean addMember(@NotNull Authorizable authorizable)