Index: oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/FindAuthorizableWithScopeTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/FindAuthorizableWithScopeTest.java (revision 1865297) +++ oak-benchmarks/src/main/java/org/apache/jackrabbit/oak/benchmark/FindAuthorizableWithScopeTest.java (date 1565950043000) @@ -34,6 +34,7 @@ import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal; import org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl; import org.apache.jackrabbit.util.Text; +import org.jetbrains.annotations.NotNull; public class FindAuthorizableWithScopeTest extends AbstractTest { @@ -119,7 +120,7 @@ private Query createQuery() { return new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setLimit(0, maxCount); builder.nameMatches("testUser%"); if (setScope) { Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/principal/PrincipalProviderImpl.java (date 1565950043000) @@ -200,7 +200,7 @@ final long limit) throws RepositoryException { Query userQuery = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.like('@' +UserConstants.REP_PRINCIPAL_NAME, buildSearchPattern(nameHint))); builder.setSelector(AuthorizableType.getType(searchType).getAuthorizableClass()); builder.setSortOrder(UserConstants.REP_PRINCIPAL_NAME, Direction.ASCENDING); Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/AuthorizableImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/AuthorizableImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/AuthorizableImpl.java (date 1565955726000) @@ -23,6 +23,8 @@ import org.apache.jackrabbit.api.security.user.Authorizable; import org.apache.jackrabbit.api.security.user.Group; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; class AuthorizableImpl implements Authorizable { @@ -43,6 +45,7 @@ } //-------------------------------------------------------< Authorizable >--- + @NotNull @Override public String getID() throws RepositoryException { return dlg.getID(); @@ -53,16 +56,19 @@ return dlg.isGroup(); } + @NotNull @Override public Principal getPrincipal() throws RepositoryException { return dlg.getPrincipal(); } + @NotNull @Override public Iterator declaredMemberOf() throws RepositoryException { return AuthorizableWrapper.createGroupIterator(dlg.declaredMemberOf(), mgr); } + @NotNull @Override public Iterator memberOf() throws RepositoryException { return AuthorizableWrapper.createGroupIterator(dlg.memberOf(), mgr); @@ -77,24 +83,26 @@ } } + @NotNull @Override public Iterator getPropertyNames() throws RepositoryException { return dlg.getPropertyNames(); } + @NotNull @Override - public Iterator getPropertyNames(String s) throws RepositoryException { + public Iterator getPropertyNames(@NotNull String s) throws RepositoryException { return dlg.getPropertyNames(s); } @Override - public boolean hasProperty(String s) throws RepositoryException { + public boolean hasProperty(@NotNull String s) throws RepositoryException { return dlg.hasProperty(s); } @Override - public void setProperty(String s, Value value) throws RepositoryException { + public void setProperty(@NotNull String s, @Nullable Value value) throws RepositoryException { try { dlg.setProperty(s, value); } finally { @@ -103,7 +111,7 @@ } @Override - public void setProperty(String s, Value[] values) throws RepositoryException { + public void setProperty(@NotNull String s, @Nullable Value[] values) throws RepositoryException { try { dlg.setProperty(s, values); } finally { @@ -111,13 +119,14 @@ } } + @Nullable @Override - public Value[] getProperty(String s) throws RepositoryException { + public Value[] getProperty(@NotNull String s) throws RepositoryException { return dlg.getProperty(s); } @Override - public boolean removeProperty(String s) throws RepositoryException { + public boolean removeProperty(@NotNull String s) throws RepositoryException { try { return dlg.removeProperty(s); } finally { @@ -125,6 +134,7 @@ } } + @NotNull @Override public String getPath() throws RepositoryException { return dlg.getPath(); Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/AutoSaveEnabledManager.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/AutoSaveEnabledManager.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/AutoSaveEnabledManager.java (date 1565957340000) @@ -64,43 +64,51 @@ this.root = root; } + @Nullable @Override - public Authorizable getAuthorizable(String id) throws RepositoryException { + public Authorizable getAuthorizable(@NotNull String id) throws RepositoryException { return wrap(dlg.getAuthorizable(id)); } + @Nullable @Override - public T getAuthorizable(String id, Class authorizableClass) throws RepositoryException { + public T getAuthorizable(@NotNull String id, @NotNull Class authorizableClass) throws RepositoryException { return UserUtil.castAuthorizable(wrap(dlg.getAuthorizable(id)), authorizableClass); } + @Nullable @Override - public Authorizable getAuthorizable(Principal principal) throws RepositoryException { + public Authorizable getAuthorizable(@NotNull Principal principal) throws RepositoryException { return wrap(dlg.getAuthorizable(principal)); } + @Nullable @Override - public Authorizable getAuthorizableByPath(String path) throws RepositoryException { + public Authorizable getAuthorizableByPath(@NotNull String path) throws RepositoryException { return wrap(dlg.getAuthorizableByPath(path)); } + @NotNull @Override - public Iterator findAuthorizables(String relPath, String value) throws RepositoryException { + public Iterator findAuthorizables(@NotNull String relPath, @Nullable String value) throws RepositoryException { return AuthorizableWrapper.createIterator(dlg.findAuthorizables(relPath, value), this); } + @NotNull @Override - public Iterator findAuthorizables(String relPath, String value, int searchType) throws RepositoryException { + public Iterator findAuthorizables(@NotNull String relPath, @Nullable String value, int searchType) throws RepositoryException { return AuthorizableWrapper.createIterator(dlg.findAuthorizables(relPath, value, searchType), this); } + @NotNull @Override - public Iterator findAuthorizables(Query query) throws RepositoryException { + public Iterator findAuthorizables(@NotNull Query query) throws RepositoryException { return AuthorizableWrapper.createIterator(dlg.findAuthorizables(query), this); } + @NotNull @Override - public User createUser(String userID, String password) throws RepositoryException { + public User createUser(@NotNull String userID, @Nullable String password) throws RepositoryException { try { return wrap(dlg.createUser(userID, password)); } finally { @@ -108,8 +116,9 @@ } } + @NotNull @Override - public User createUser(String userID, String password, Principal principal, @Nullable String intermediatePath) throws RepositoryException { + public User createUser(@NotNull String userID, @Nullable String password, @NotNull Principal principal, @Nullable String intermediatePath) throws RepositoryException { try { return wrap(dlg.createUser(userID, password, principal, intermediatePath)); } finally { @@ -117,8 +126,9 @@ } } + @NotNull @Override - public User createSystemUser(String userID, String intermediatePath) throws RepositoryException { + public User createSystemUser(@NotNull String userID, @Nullable String intermediatePath) throws RepositoryException { try { return wrap(dlg.createSystemUser(userID, intermediatePath)); } finally { @@ -126,8 +136,9 @@ } } + @NotNull @Override - public Group createGroup(String groupId) throws RepositoryException { + public Group createGroup(@NotNull String groupId) throws RepositoryException { try { return wrap(dlg.createGroup(groupId)); } finally { @@ -135,8 +146,9 @@ } } + @NotNull @Override - public Group createGroup(Principal principal) throws RepositoryException { + public Group createGroup(@NotNull Principal principal) throws RepositoryException { try { return wrap(dlg.createGroup(principal)); } finally { @@ -144,17 +156,19 @@ } } + @NotNull @Override - public Group createGroup(Principal principal, String groupId) throws RepositoryException { + public Group createGroup(@NotNull Principal principal, @Nullable String intermediatePath) throws RepositoryException { try { - return wrap(dlg.createGroup(principal, groupId)); + return wrap(dlg.createGroup(principal, intermediatePath)); } finally { autosave(); } } + @NotNull @Override - public Group createGroup(String groupID, Principal principal, @Nullable String intermediatePath) throws RepositoryException { + public Group createGroup(@NotNull String groupID, @NotNull Principal principal, @Nullable String intermediatePath) throws RepositoryException { try { return wrap(dlg.createGroup(groupID, principal, intermediatePath)); } finally { Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/GroupImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/GroupImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/GroupImpl.java (date 1565956248000) @@ -34,18 +34,20 @@ return (Group) getDlg(); } + @NotNull @Override public Iterator getDeclaredMembers() throws RepositoryException { return AuthorizableWrapper.createIterator(getDelegate().getDeclaredMembers(), getMgr()); } + @NotNull @Override public Iterator getMembers() throws RepositoryException { return AuthorizableWrapper.createIterator(getDelegate().getMembers(), getMgr()); } @Override - public boolean isDeclaredMember(Authorizable authorizable) throws RepositoryException { + public boolean isDeclaredMember(@NotNull Authorizable authorizable) throws RepositoryException { if (isValid(authorizable)) { return getDelegate().isDeclaredMember(((AuthorizableImpl) authorizable).getDlg()); } else { @@ -54,7 +56,7 @@ } @Override - public boolean isMember(Authorizable authorizable) throws RepositoryException { + public boolean isMember(@NotNull Authorizable authorizable) throws RepositoryException { if (isValid(authorizable)) { return getDelegate().isMember(((AuthorizableImpl) authorizable).getDlg()); } else { @@ -63,7 +65,7 @@ } @Override - public boolean addMember(Authorizable authorizable) throws RepositoryException { + public boolean addMember(@NotNull Authorizable authorizable) throws RepositoryException { try { if (isValid(authorizable)) { return getDelegate().addMember(((AuthorizableImpl) authorizable).getDlg()); @@ -75,6 +77,7 @@ } } + @NotNull @Override public Set addMembers(@NotNull String... memberIds) throws RepositoryException { try { @@ -85,7 +88,7 @@ } @Override - public boolean removeMember(Authorizable authorizable) throws RepositoryException { + public boolean removeMember(@NotNull Authorizable authorizable) throws RepositoryException { try { if (isValid(authorizable)) { return getDelegate().removeMember(((AuthorizableImpl) authorizable).getDlg()); @@ -97,6 +100,7 @@ } } + @NotNull @Override public Set removeMembers(@NotNull String... memberIds) throws RepositoryException { try { @@ -106,7 +110,7 @@ } } - private boolean isValid(Authorizable a) { + private boolean isValid(@NotNull Authorizable a) { return a instanceof AuthorizableImpl; } } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/UserImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/UserImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/autosave/UserImpl.java (date 1565957018000) @@ -24,6 +24,8 @@ import org.apache.jackrabbit.api.security.principal.PrincipalIterator; import org.apache.jackrabbit.api.security.user.Impersonation; import org.apache.jackrabbit.api.security.user.User; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; class UserImpl extends AuthorizableImpl implements User { @@ -45,18 +47,20 @@ return getDelegate().isSystemUser(); } + @NotNull @Override public Credentials getCredentials() throws RepositoryException { return getDelegate().getCredentials(); } + @NotNull @Override public Impersonation getImpersonation() throws RepositoryException { return new ImpersonationImpl(getDelegate().getImpersonation()); } @Override - public void changePassword(String pw) throws RepositoryException { + public void changePassword(@Nullable String pw) throws RepositoryException { try { getDelegate().changePassword(pw); } finally { @@ -66,7 +70,7 @@ } @Override - public void changePassword(String pw, String oldPw) throws RepositoryException { + public void changePassword(@Nullable String pw, @NotNull String oldPw) throws RepositoryException { try { getDelegate().changePassword(pw, oldPw); } finally { @@ -75,7 +79,7 @@ } @Override - public void disable(String msg) throws RepositoryException { + public void disable(@Nullable String msg) throws RepositoryException { try { getDelegate().disable(msg); } finally { @@ -88,6 +92,7 @@ return getDelegate().isDisabled(); } + @Nullable @Override public String getDisabledReason() throws RepositoryException { return getDelegate().getDisabledReason(); @@ -100,13 +105,15 @@ private ImpersonationImpl(Impersonation dlg) { this.dlg = dlg; } + + @NotNull @Override public PrincipalIterator getImpersonators() throws RepositoryException { return dlg.getImpersonators(); } @Override - public boolean grantImpersonation(Principal principal) throws RepositoryException { + public boolean grantImpersonation(@NotNull Principal principal) throws RepositoryException { try { return dlg.grantImpersonation(principal); } finally { @@ -115,7 +122,7 @@ } @Override - public boolean revokeImpersonation(Principal principal) throws RepositoryException { + public boolean revokeImpersonation(@NotNull Principal principal) throws RepositoryException { try { return dlg.revokeImpersonation(principal); } finally { @@ -124,7 +131,7 @@ } @Override - public boolean allows(Subject subject) throws RepositoryException { + public boolean allows(@NotNull Subject subject) throws RepositoryException { return dlg.allows(subject); } } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/query/XPathQueryBuilder.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/query/XPathQueryBuilder.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/query/XPathQueryBuilder.java (date 1565956248000) @@ -23,6 +23,8 @@ import org.apache.jackrabbit.api.security.user.QueryBuilder; import org.apache.jackrabbit.api.security.user.User; import org.apache.jackrabbit.oak.spi.security.user.AuthorizableType; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; class XPathQueryBuilder implements QueryBuilder { @@ -39,7 +41,7 @@ //-------------------------------------------------------< QueryBuilder >--- @Override - public void setSelector(Class selector) { + public void setSelector(@NotNull Class selector) { if (User.class.isAssignableFrom(selector)) { selectorType = AuthorizableType.USER; } else if (Group.class.isAssignableFrom(selector)) { @@ -50,30 +52,30 @@ } @Override - public void setScope(String groupID, boolean declaredOnly) { + public void setScope(@NotNull String groupID, boolean declaredOnly) { this.groupID = groupID; declaredMembersOnly = declaredOnly; } @Override - public void setCondition(Condition condition) { + public void setCondition(@NotNull Condition condition) { this.condition = condition; } @Override - public void setSortOrder(String propertyName, Direction direction, boolean ignoreCase) { + public void setSortOrder(@NotNull String propertyName, @NotNull Direction direction, boolean ignoreCase) { sortProperty = propertyName; sortDirection = direction; sortIgnoreCase = ignoreCase; } @Override - public void setSortOrder(String propertyName, Direction direction) { + public void setSortOrder(@NotNull String propertyName, @NotNull Direction direction) { setSortOrder(propertyName, direction, false); } @Override - public void setLimit(Value bound, long maxCount) { + public void setLimit(@Nullable Value bound, long maxCount) { // reset the offset before setting bound value/maxCount offset = 0; this.bound = bound; @@ -88,78 +90,91 @@ setMaxCount(maxCount); } + @NotNull @Override - public Condition nameMatches(String pattern) { + public Condition nameMatches(@NotNull String pattern) { return new Condition.Node(pattern); } + @NotNull @Override - public Condition neq(String relPath, Value value) { + public Condition neq(@NotNull String relPath, @NotNull Value value) { return new Condition.Property(relPath, RelationOp.NE, value); } + @NotNull @Override - public Condition eq(String relPath, Value value) { + public Condition eq(@NotNull String relPath, @NotNull Value value) { return new Condition.Property(relPath, RelationOp.EQ, value); } + @NotNull @Override - public Condition lt(String relPath, Value value) { + public Condition lt(@NotNull String relPath, @NotNull Value value) { return new Condition.Property(relPath, RelationOp.LT, value); } + @NotNull @Override - public Condition le(String relPath, Value value) { + public Condition le(@NotNull String relPath, @NotNull Value value) { return new Condition.Property(relPath, RelationOp.LE, value); } + @NotNull @Override - public Condition gt(String relPath, Value value) { + public Condition gt(@NotNull String relPath, @NotNull Value value) { return new Condition.Property(relPath, RelationOp.GT, value); } + @NotNull @Override - public Condition ge(String relPath, Value value) { + public Condition ge(@NotNull String relPath, @NotNull Value value) { return new Condition.Property(relPath, RelationOp.GE, value); } + @NotNull @Override - public Condition exists(String relPath) { + public Condition exists(@NotNull String relPath) { return new Condition.Property(relPath, RelationOp.EX); } + @NotNull @Override - public Condition like(String relPath, String pattern) { + public Condition like(@NotNull String relPath, @NotNull String pattern) { return new Condition.Property(relPath, RelationOp.LIKE, pattern); } + @NotNull @Override - public Condition contains(String relPath, String searchExpr) { + public Condition contains(@NotNull String relPath, @NotNull String searchExpr) { return new Condition.Contains(relPath, searchExpr); } + @NotNull @Override - public Condition impersonates(String name) { + public Condition impersonates(@NotNull String name) { return new Condition.Impersonation(name); } + @NotNull @Override - public Condition not(Condition condition) { + public Condition not(@NotNull Condition condition) { return new Condition.Not(condition); } + @NotNull @Override - public Condition and(Condition condition1, Condition condition2) { + public Condition and(@NotNull Condition condition1, @NotNull Condition condition2) { return new Condition.And(condition1, condition2); } + @NotNull @Override - public Condition or(Condition condition1, Condition condition2) { + public Condition or(@NotNull Condition condition1, @NotNull Condition condition2) { return new Condition.Or(condition1, condition2); } //-----------------------------------------------------------< internal >--- - Condition property(String relPath, RelationOp op, Value value) { return new Condition.Property(relPath, op, value); } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/AuthorizableImpl.java (date 1565956248000) @@ -68,21 +68,24 @@ abstract void checkValidTree(@NotNull Tree tree) throws RepositoryException; - static boolean isValidAuthorizableImpl(Authorizable authorizable) { + static boolean isValidAuthorizableImpl(@NotNull Authorizable authorizable) { return authorizable instanceof AuthorizableImpl; } //-------------------------------------------------------< Authorizable >--- + @NotNull @Override public String getID() { return id; } + @NotNull @Override public Iterator declaredMemberOf() throws RepositoryException { return getMembership(false); } + @NotNull @Override public Iterator memberOf() throws RepositoryException { return getMembership(true); @@ -99,41 +102,45 @@ getTree().remove(); } + @NotNull @Override public Iterator getPropertyNames() throws RepositoryException { return getPropertyNames("."); } + @NotNull @Override - public Iterator getPropertyNames(String relPath) throws RepositoryException { + public Iterator getPropertyNames(@NotNull String relPath) throws RepositoryException { return getAuthorizableProperties().getNames(relPath); } @Override - public boolean hasProperty(String relPath) throws RepositoryException { + public boolean hasProperty(@NotNull String relPath) throws RepositoryException { return getAuthorizableProperties().hasProperty(relPath); } + @Nullable @Override - public Value[] getProperty(String relPath) throws RepositoryException { + public Value[] getProperty(@NotNull String relPath) throws RepositoryException { return getAuthorizableProperties().getProperty(relPath); } @Override - public void setProperty(String relPath, Value value) throws RepositoryException { + public void setProperty(@NotNull String relPath, @Nullable Value value) throws RepositoryException { getAuthorizableProperties().setProperty(relPath, value); } @Override - public void setProperty(String relPath, Value[] values) throws RepositoryException { + public void setProperty(@NotNull String relPath, @Nullable Value[] values) throws RepositoryException { getAuthorizableProperties().setProperty(relPath, values); } @Override - public boolean removeProperty(String relPath) throws RepositoryException { + public boolean removeProperty(@NotNull String relPath) throws RepositoryException { return getAuthorizableProperties().removeProperty(relPath); } + @NotNull @Override public String getPath() { return userManager.getNamePathMapper().getJcrPath(getTree().getPath()); Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/GroupImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/GroupImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/GroupImpl.java (date 1565956248000) @@ -65,34 +65,37 @@ return true; } + @NotNull @Override public Principal getPrincipal() throws RepositoryException { return new GroupPrincipal(getPrincipalName(), getTree()); } //--------------------------------------------------------------< Group >--- + @NotNull @Override public Iterator getDeclaredMembers() throws RepositoryException { return getMembers(false); } + @NotNull @Override public Iterator getMembers() throws RepositoryException { return getMembers(true); } @Override - public boolean isDeclaredMember(Authorizable authorizable) throws RepositoryException { + public boolean isDeclaredMember(@NotNull Authorizable authorizable) throws RepositoryException { return isMember(authorizable, false); } @Override - public boolean isMember(Authorizable authorizable) throws RepositoryException { + public boolean isMember(@NotNull Authorizable authorizable) throws RepositoryException { return isMember(authorizable, true); } @Override - public boolean addMember(Authorizable authorizable) throws RepositoryException { + public boolean addMember(@NotNull Authorizable authorizable) throws RepositoryException { if (!isValidAuthorizableImpl(authorizable)) { log.warn("Invalid Authorizable: {}", authorizable); return false; @@ -126,13 +129,14 @@ return success; } + @NotNull @Override public Set addMembers(@NotNull String... memberIds) throws RepositoryException { return updateMembers(false, memberIds); } @Override - public boolean removeMember(Authorizable authorizable) throws RepositoryException { + public boolean removeMember(@NotNull Authorizable authorizable) throws RepositoryException { if (!isValidAuthorizableImpl(authorizable)) { log.warn("Invalid Authorizable: {}", authorizable); return false; @@ -155,6 +159,7 @@ } } + @NotNull @Override public Set removeMembers(@NotNull String... memberIds) throws RepositoryException { return updateMembers(true, memberIds); @@ -169,6 +174,7 @@ * @return Iterator of authorizables being member of this group. * @throws RepositoryException If an error occurs. */ + @NotNull private Iterator getMembers(boolean includeInherited) throws RepositoryException { UserManagerImpl userMgr = getUserManager(); if (isEveryone()) { @@ -203,7 +209,7 @@ * member of this group; {@code false} otherwise. * @throws RepositoryException If an error occurs. */ - private boolean isMember(Authorizable authorizable, boolean includeInherited) throws RepositoryException { + private boolean isMember(@NotNull Authorizable authorizable, boolean includeInherited) throws RepositoryException { if (!isValidAuthorizableImpl(authorizable)) { return false; } @@ -237,6 +243,7 @@ * authorizable. * @throws javax.jcr.RepositoryException If another error occurs. */ + @NotNull private Set updateMembers(boolean isRemove, @NotNull String... memberIds) throws RepositoryException { Set failedIds = Sets.newHashSet(memberIds); int importBehavior = UserUtil.getImportBehavior(getUserManager().getConfig()); Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/ImpersonationImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/ImpersonationImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/ImpersonationImpl.java (date 1565949732000) @@ -123,7 +123,7 @@ } @Override - public boolean allows(@Nullable Subject subject) { + public boolean allows(@NotNull Subject subject) { if (subject == null) { return false; } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/SystemUserImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/SystemUserImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/SystemUserImpl.java (date 1565956445000) @@ -23,6 +23,7 @@ import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.spi.security.user.util.UserUtil; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Default implementation for a system user. @@ -58,12 +59,12 @@ } @Override - public void changePassword(String password) throws RepositoryException { + public void changePassword(@Nullable String password) throws RepositoryException { throw new UnsupportedRepositoryOperationException("system user"); } @Override - public void changePassword(String password, String oldPassword) throws RepositoryException { + public void changePassword(@Nullable String password, @NotNull String oldPassword) throws RepositoryException { throw new UnsupportedRepositoryOperationException("system user"); } } Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserImpl.java (date 1565957018000) @@ -65,6 +65,7 @@ return false; } + @NotNull @Override public Principal getPrincipal() throws RepositoryException { Tree userTree = getTree(); @@ -88,6 +89,7 @@ return false; } + @NotNull @Override public Credentials getCredentials() { String pwHash = getPasswordHash(); @@ -98,6 +100,7 @@ } } + @NotNull @Override public Impersonation getImpersonation() { return new ImpersonationImpl(this); @@ -117,7 +120,7 @@ } @Override - public void changePassword(String password, String oldPassword) throws RepositoryException { + public void changePassword(@Nullable String password, @NotNull String oldPassword) throws RepositoryException { // make sure the old password matches. String pwHash = getPasswordHash(); if (!PasswordUtil.isSame(pwHash, oldPassword)) { @@ -127,7 +130,7 @@ } @Override - public void disable(String reason) throws RepositoryException { + public void disable(@Nullable String reason) throws RepositoryException { if (isAdmin) { throw new RepositoryException("The administrator user cannot be disabled."); } @@ -150,6 +153,7 @@ return getTree().hasProperty(REP_DISABLED); } + @Nullable @Override public String getDisabledReason() { PropertyState disabled = getTree().getProperty(REP_DISABLED); Index: oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserManagerImpl.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserManagerImpl.java (revision 1865297) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserManagerImpl.java (date 1565957340000) @@ -106,24 +106,28 @@ } //--------------------------------------------------------< UserManager >--- + @Nullable @Override - public Authorizable getAuthorizable(String id) throws RepositoryException { + public Authorizable getAuthorizable(@NotNull String id) throws RepositoryException { Tree tree = (Strings.isNullOrEmpty(id)) ? null : userProvider.getAuthorizable(id); return getAuthorizable(tree); } + @Nullable @Override - public T getAuthorizable(String id, Class authorizableClass) throws RepositoryException { + public T getAuthorizable(@NotNull String id, @NotNull Class authorizableClass) throws RepositoryException { return UserUtil.castAuthorizable(getAuthorizable(id), authorizableClass); } + @Nullable @Override - public Authorizable getAuthorizable(Principal principal) throws RepositoryException { + public Authorizable getAuthorizable(@NotNull Principal principal) throws RepositoryException { return (principal == null) ? null : getAuthorizable(userProvider.getAuthorizableByPrincipal(principal)); } + @Nullable @Override - public Authorizable getAuthorizableByPath(String path) throws RepositoryException { + public Authorizable getAuthorizableByPath(@NotNull String path) throws RepositoryException { String oakPath = namePathMapper.getOakPath(path); if (oakPath == null) { throw new RepositoryException("Invalid path " + path); @@ -131,29 +135,34 @@ return getAuthorizableByOakPath(oakPath); } + @NotNull @Override - public Iterator findAuthorizables(String relPath, String value) throws RepositoryException { + public Iterator findAuthorizables(@NotNull String relPath, @Nullable String value) throws RepositoryException { return findAuthorizables(relPath, value, SEARCH_TYPE_AUTHORIZABLE); } + @NotNull @Override - public Iterator findAuthorizables(String relPath, String value, int searchType) throws RepositoryException { + public Iterator findAuthorizables(@NotNull String relPath, @Nullable String value, int searchType) throws RepositoryException { return getQueryManager().findAuthorizables(relPath, value, AuthorizableType.getType(searchType)); } + @NotNull @Override - public Iterator findAuthorizables(Query query) throws RepositoryException { + public Iterator findAuthorizables(@NotNull Query query) throws RepositoryException { return getQueryManager().findAuthorizables(query); } + @NotNull @Override - public User createUser(final String userID, String password) throws RepositoryException { + public User createUser(@NotNull final String userID, @Nullable String password) throws RepositoryException { Principal principal = new PrincipalImpl(userID); return createUser(userID, password, principal, null); } + @NotNull @Override - public User createUser(String userID, String password, Principal principal, + public User createUser(@NotNull String userID, @Nullable String password, @NotNull Principal principal, @Nullable String intermediatePath) throws RepositoryException { checkValidId(userID); checkValidPrincipal(principal, false); @@ -174,8 +183,9 @@ return user; } + @NotNull @Override - public User createSystemUser(String userID, String intermediatePath) throws RepositoryException { + public User createSystemUser(@NotNull String userID, @Nullable String intermediatePath) throws RepositoryException { checkValidId(userID); Principal principal = new PrincipalImpl(userID); checkValidPrincipal(principal, false); @@ -189,24 +199,28 @@ return user; } + @NotNull @Override - public Group createGroup(String groupId) throws RepositoryException { + public Group createGroup(@NotNull String groupId) throws RepositoryException { Principal principal = new PrincipalImpl(groupId); return createGroup(groupId, principal, null); } + @NotNull @Override - public Group createGroup(Principal principal) throws RepositoryException { + public Group createGroup(@NotNull Principal principal) throws RepositoryException { return createGroup(principal, null); } + @NotNull @Override - public Group createGroup(Principal principal, @Nullable String intermediatePath) throws RepositoryException { + public Group createGroup(@NotNull Principal principal, @Nullable String intermediatePath) throws RepositoryException { return createGroup(principal.getName(), principal, intermediatePath); } + @NotNull @Override - public Group createGroup(String groupID, Principal principal, @Nullable String intermediatePath) throws RepositoryException { + public Group createGroup(@NotNull String groupID, @NotNull Principal principal, @Nullable String intermediatePath) throws RepositoryException { checkValidId(groupID); checkValidPrincipal(principal, true); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/query/UserQueryManagerTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/query/UserQueryManagerTest.java (revision 1865297) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/query/UserQueryManagerTest.java (date 1565955143000) @@ -256,7 +256,7 @@ public void testQueryMaxCountZero() throws Exception { Query q = new Query() { @Override - public void build(QueryBuilder queryBuilder) { + public void build(@NotNull QueryBuilder queryBuilder) { queryBuilder.setLimit(0, 0); } @@ -269,7 +269,7 @@ String userId = user.getID(); Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.nameMatches(userId)); builder.setScope(EveryonePrincipal.NAME, false); } @@ -288,7 +288,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.eq(propertyName, v)); builder.setScope(EveryonePrincipal.NAME, false); } @@ -307,7 +307,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.eq(propertyName, v)); builder.setScope("eGroup", false); } @@ -326,7 +326,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.eq(propertyName, v)); } }; @@ -343,7 +343,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.eq(propertyName, v)); builder.setScope("g1", false); } @@ -362,7 +362,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.eq(propertyName, v)); builder.setScope("g1", false); } @@ -383,7 +383,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.eq(propertyName, v)); builder.setScope("g1", true); } @@ -404,7 +404,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.eq(propertyName, v)); builder.setScope("g1", false); } @@ -424,7 +424,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setLimit(valueFactory.createValue(100), Long.MAX_VALUE); builder.setCondition(builder.gt(propertyName, valueFactory.createValue(20))); } @@ -445,7 +445,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setLimit(valueFactory.createValue(100), Long.MAX_VALUE); builder.setSortOrder(propertyName, QueryBuilder.Direction.ASCENDING); builder.setCondition(builder.gt(propertyName, valueFactory.createValue(20))); @@ -467,7 +467,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setLimit(valueFactory.createValue(100), Long.MAX_VALUE); builder.setSortOrder(propertyName, QueryBuilder.Direction.ASCENDING); } @@ -488,7 +488,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.exists(propertyName)); builder.setSortOrder(propertyName, QueryBuilder.Direction.DESCENDING, true); } @@ -509,7 +509,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.exists(propertyName)); builder.setSortOrder(propertyName, QueryBuilder.Direction.DESCENDING, false); } @@ -526,7 +526,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.nameMatches("group_with_underscore")); } }; @@ -542,7 +542,7 @@ Query q = new Query() { @Override - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.nameMatches("group_with_underscore")); } }; Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/AuthorizableDelegator.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/AuthorizableDelegator.java (revision 1865297) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/AuthorizableDelegator.java (date 1565959403000) @@ -81,6 +81,7 @@ }); } + @NotNull @Override public String getID() throws RepositoryException { return sessionDelegate.perform(new SessionOperation("getID") { @@ -94,6 +95,7 @@ + @NotNull @Override public Principal getPrincipal() throws RepositoryException { return sessionDelegate.perform(new SessionOperation("getPrincipal") { @@ -105,6 +107,7 @@ }); } + @NotNull @Override public Iterator declaredMemberOf() throws RepositoryException { return sessionDelegate.perform(new SessionOperation>("declaredMemberOf") { @@ -123,6 +126,7 @@ }); } + @NotNull @Override public Iterator memberOf() throws RepositoryException { return sessionDelegate.perform(new SessionOperation>("memberOf") { @@ -151,6 +155,7 @@ }); } + @NotNull @Override public Iterator getPropertyNames() throws RepositoryException { return sessionDelegate.perform(new SessionOperation>("getPropertyNames") { @@ -162,8 +167,9 @@ }); } + @NotNull @Override - public Iterator getPropertyNames(final String relPath) throws RepositoryException { + public Iterator getPropertyNames(@NotNull final String relPath) throws RepositoryException { return sessionDelegate.perform(new SessionOperation>("getPropertyNames") { @NotNull @Override @@ -174,7 +180,7 @@ } @Override - public boolean hasProperty(final String relPath) throws RepositoryException { + public boolean hasProperty(@NotNull final String relPath) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("hasProperty") { @NotNull @Override @@ -185,7 +191,7 @@ } @Override - public void setProperty(final String relPath, final Value value) throws RepositoryException { + public void setProperty(@NotNull final String relPath, @Nullable final Value value) throws RepositoryException { sessionDelegate.performVoid(new SessionOperation("setProperty", true) { @Override public void performVoid() throws RepositoryException { @@ -195,7 +201,7 @@ } @Override - public void setProperty(final String relPath, final Value[] value) throws RepositoryException { + public void setProperty(@NotNull final String relPath, @Nullable final Value[] value) throws RepositoryException { sessionDelegate.performVoid(new SessionOperation("setProperty", true) { @Override public void performVoid() throws RepositoryException { @@ -204,19 +210,19 @@ }); } + @Nullable @Override - public Value[] getProperty(final String relPath) throws RepositoryException { - return sessionDelegate.perform(new SessionOperation("getProperty") { - @NotNull + public Value[] getProperty(@NotNull final String relPath) throws RepositoryException { + return sessionDelegate.performNullable(new SessionOperation("getProperty") { @Override - public Value[] perform() throws RepositoryException { + public Value[] performNullable() throws RepositoryException { return delegate.getProperty(relPath); } }); } @Override - public boolean removeProperty(final String relPath) throws RepositoryException { + public boolean removeProperty(@NotNull final String relPath) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("removeProperty", true) { @NotNull @Override @@ -226,6 +232,7 @@ }); } + @NotNull @Override public String getPath() throws RepositoryException { return sessionDelegate.perform(new SessionOperation("getPath") { Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/GroupDelegator.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/GroupDelegator.java (revision 1865297) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/GroupDelegator.java (date 1565956248000) @@ -65,6 +65,7 @@ } //--------------------------------------------------------------< Group >--- + @NotNull @Override public Iterator getDeclaredMembers() throws RepositoryException { return sessionDelegate.perform(new SessionOperation>("getDeclaredMembers") { @@ -83,6 +84,7 @@ }); } + @NotNull @Override public Iterator getMembers() throws RepositoryException { return sessionDelegate.perform(new SessionOperation>("getMembers") { @@ -102,7 +104,7 @@ } @Override - public boolean isDeclaredMember(final Authorizable authorizable) throws RepositoryException { + public boolean isDeclaredMember(@NotNull final Authorizable authorizable) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("isDeclaredMember") { @NotNull @Override @@ -113,7 +115,7 @@ } @Override - public boolean isMember(final Authorizable authorizable) throws RepositoryException { + public boolean isMember(@NotNull final Authorizable authorizable) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("isMember") { @NotNull @Override @@ -124,7 +126,7 @@ } @Override - public boolean addMember(final Authorizable authorizable) throws RepositoryException { + public boolean addMember(@NotNull final Authorizable authorizable) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("addMember", true) { @NotNull @Override @@ -134,6 +136,7 @@ }); } + @NotNull @Override public Set addMembers(@NotNull final String... memberIds) throws RepositoryException { return sessionDelegate.perform(new SessionOperation>("addMembers", true) { @@ -146,7 +149,7 @@ } @Override - public boolean removeMember(final Authorizable authorizable) throws RepositoryException { + public boolean removeMember(@NotNull final Authorizable authorizable) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("removeMember", true) { @NotNull @Override @@ -156,6 +159,7 @@ }); } + @NotNull @Override public Set removeMembers(@NotNull final String... memberIds) throws RepositoryException { return sessionDelegate.perform(new SessionOperation>("removeMembers", true) { Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/ImpersonationDelegator.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/ImpersonationDelegator.java (revision 1865297) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/ImpersonationDelegator.java (date 1565949732000) @@ -30,6 +30,7 @@ import org.apache.jackrabbit.api.security.user.Impersonation; import org.apache.jackrabbit.oak.jcr.session.operation.SessionOperation; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * This implementation of {@code Impersonation} delegates back to a @@ -55,6 +56,7 @@ } } + @NotNull @Override public PrincipalIterator getImpersonators() throws RepositoryException { return sessionDelegate.perform(new SessionOperation("getImpersonators") { @@ -67,7 +69,7 @@ } @Override - public boolean grantImpersonation(final Principal principal) throws RepositoryException { + public boolean grantImpersonation(@NotNull final Principal principal) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("grantImpersonation", true) { @NotNull @Override @@ -78,7 +80,7 @@ } @Override - public boolean revokeImpersonation(final Principal principal) throws RepositoryException { + public boolean revokeImpersonation(@NotNull final Principal principal) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("revokeImpersonation", true) { @NotNull @Override @@ -89,7 +91,7 @@ } @Override - public boolean allows(final Subject subject) throws RepositoryException { + public boolean allows(@NotNull final Subject subject) throws RepositoryException { return sessionDelegate.perform(new SessionOperation("allows") { @NotNull @Override Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/UserDelegator.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/UserDelegator.java (revision 1865297) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/UserDelegator.java (date 1565957018000) @@ -26,6 +26,7 @@ import org.apache.jackrabbit.api.security.user.User; import org.apache.jackrabbit.oak.jcr.session.operation.SessionOperation; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * This implementation of {@code User} delegates back to a @@ -83,6 +84,7 @@ }); } + @NotNull @Override public Credentials getCredentials() { return sessionDelegate.safePerform(new SessionOperation("getCredentials") { @@ -94,6 +96,7 @@ }); } + @NotNull @Override public Impersonation getImpersonation() { return sessionDelegate.safePerform(new SessionOperation("getImpersonation") { @@ -107,7 +110,7 @@ } @Override - public void changePassword(final String password) throws RepositoryException { + public void changePassword(@Nullable final String password) throws RepositoryException { sessionDelegate.performVoid(new SessionOperation("changePassword", true) { @Override public void performVoid() throws RepositoryException { @@ -117,7 +120,7 @@ } @Override - public void changePassword(final String password, final String oldPassword) throws RepositoryException { + public void changePassword(@Nullable final String password, @NotNull final String oldPassword) throws RepositoryException { sessionDelegate.performVoid(new SessionOperation("changePassword", true) { @Override public void performVoid() throws RepositoryException { @@ -127,7 +130,7 @@ } @Override - public void disable(final String reason) throws RepositoryException { + public void disable(@Nullable final String reason) throws RepositoryException { sessionDelegate.performVoid(new SessionOperation("disable", true) { @Override public void performVoid() throws RepositoryException { @@ -147,6 +150,7 @@ }); } + @Nullable @Override public String getDisabledReason() throws RepositoryException { return sessionDelegate.performNullable(new SessionOperation("getDisabledReason") { Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/UserManagerDelegator.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/UserManagerDelegator.java (revision 1865297) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/UserManagerDelegator.java (date 1565957340000) @@ -56,8 +56,9 @@ this.userManagerDelegate = userManagerDelegate; } + @Nullable @Override - public Authorizable getAuthorizable(final String id) throws RepositoryException { + public Authorizable getAuthorizable(@NotNull final String id) throws RepositoryException { return sessionDelegate.performNullable(new UserManagerOperation(sessionDelegate, "getAuthorizable") { @Override public Authorizable performNullable() throws RepositoryException { @@ -67,8 +68,9 @@ }); } + @Nullable @Override - public T getAuthorizable(final String id, final Class authorizableClass) throws RepositoryException { + public T getAuthorizable(@NotNull final String id, @NotNull final Class authorizableClass) throws RepositoryException { return sessionDelegate.performNullable(new UserManagerOperation(sessionDelegate, "getAuthorizable") { @Override public T performNullable() throws RepositoryException { @@ -80,8 +82,9 @@ ); } + @Nullable @Override - public Authorizable getAuthorizable(final Principal principal) throws RepositoryException { + public Authorizable getAuthorizable(@NotNull final Principal principal) throws RepositoryException { return sessionDelegate.performNullable(new UserManagerOperation(sessionDelegate, "getAuthorizable") { @Override public Authorizable performNullable() throws RepositoryException { @@ -91,8 +94,9 @@ }); } + @Nullable @Override - public Authorizable getAuthorizableByPath(final String path) throws RepositoryException { + public Authorizable getAuthorizableByPath(@NotNull final String path) throws RepositoryException { return sessionDelegate.performNullable(new UserManagerOperation(sessionDelegate, "getAuthorizableByPath") { @Override public Authorizable performNullable() throws RepositoryException { @@ -102,8 +106,9 @@ }); } + @NotNull @Override - public Iterator findAuthorizables(final String relPath, final String value) throws RepositoryException { + public Iterator findAuthorizables(@NotNull final String relPath, @Nullable final String value) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation>(sessionDelegate, "findAuthorizables") { @NotNull @Override @@ -120,8 +125,9 @@ }); } + @NotNull @Override - public Iterator findAuthorizables(final String relPath, final String value, final int searchType) throws RepositoryException { + public Iterator findAuthorizables(@NotNull final String relPath, @Nullable final String value, final int searchType) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation>(sessionDelegate, "findAuthorizables") { @NotNull @Override @@ -138,8 +144,9 @@ }); } + @NotNull @Override - public Iterator findAuthorizables(final Query query) throws RepositoryException { + public Iterator findAuthorizables(@NotNull final Query query) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation>(sessionDelegate, "findAuthorizables") { @NotNull @Override @@ -156,8 +163,9 @@ }); } + @NotNull @Override - public User createUser(final String userID, final String password) throws AuthorizableExistsException, RepositoryException { + public User createUser(@NotNull final String userID, @Nullable final String password) throws AuthorizableExistsException, RepositoryException { return sessionDelegate.perform(new UserManagerOperation(sessionDelegate, "createUser", true) { @NotNull @Override @@ -168,8 +176,9 @@ }); } + @NotNull @Override - public User createUser(final String userID, final String password, final Principal principal, final String intermediatePath) throws RepositoryException { + public User createUser(@NotNull final String userID, @Nullable final String password, @NotNull final Principal principal, @Nullable final String intermediatePath) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation(sessionDelegate, "createUser", true) { @NotNull @Override @@ -180,8 +189,9 @@ }); } + @NotNull @Override - public User createSystemUser(final String userID, final String intermediatePath) throws RepositoryException { + public User createSystemUser(@NotNull final String userID, @Nullable final String intermediatePath) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation(sessionDelegate, "createUser", true) { @NotNull @Override @@ -192,8 +202,9 @@ }); } + @NotNull @Override - public Group createGroup(final String groupID) throws RepositoryException { + public Group createGroup(@NotNull final String groupID) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation(sessionDelegate, "createGroup", true) { @NotNull @Override @@ -204,8 +215,9 @@ }); } + @NotNull @Override - public Group createGroup(final Principal principal) throws RepositoryException { + public Group createGroup(@NotNull final Principal principal) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation(sessionDelegate, "createGroup", true) { @NotNull @Override @@ -216,8 +228,9 @@ }); } + @NotNull @Override - public Group createGroup(final Principal principal, final String intermediatePath) throws RepositoryException { + public Group createGroup(@NotNull final Principal principal, @Nullable final String intermediatePath) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation(sessionDelegate, "createGroup", true) { @NotNull @Override @@ -228,8 +241,9 @@ }); } + @NotNull @Override - public Group createGroup(final String groupID, final Principal principal, final String intermediatePath) throws RepositoryException { + public Group createGroup(@NotNull final String groupID, @NotNull final Principal principal, @Nullable final String intermediatePath) throws RepositoryException { return sessionDelegate.perform(new UserManagerOperation(sessionDelegate, "createGroup", true) { @NotNull @Override Index: oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/AuthorizableTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/AuthorizableTest.java (revision 1865297) +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/AuthorizableTest.java (date 1565955572000) @@ -27,6 +27,7 @@ import org.apache.jackrabbit.api.security.user.Group; import org.apache.jackrabbit.api.security.user.User; import org.apache.jackrabbit.test.NotExecutableException; +import org.jetbrains.annotations.NotNull; import org.junit.Test; /** @@ -86,6 +87,7 @@ Authorizable user3 = new Authorizable() { + @NotNull public String getID() throws RepositoryException { return user.getID(); } @@ -94,14 +96,17 @@ return user.isGroup(); } + @NotNull public Principal getPrincipal() throws RepositoryException { return user.getPrincipal(); } + @NotNull public Iterator declaredMemberOf() throws RepositoryException { return user.declaredMemberOf(); } + @NotNull public Iterator memberOf() throws RepositoryException { return user.memberOf(); } @@ -110,34 +115,37 @@ user.remove(); } + @NotNull public Iterator getPropertyNames() throws RepositoryException { return user.getPropertyNames(); } - public Iterator getPropertyNames(String relPath) throws RepositoryException { + @NotNull + public Iterator getPropertyNames(@NotNull String relPath) throws RepositoryException { return user.getPropertyNames(relPath); } - public boolean hasProperty(String name) throws RepositoryException { + public boolean hasProperty(@NotNull String name) throws RepositoryException { return user.hasProperty(name); } - public void setProperty(String name, Value value) throws RepositoryException { + public void setProperty(@NotNull String name, Value value) throws RepositoryException { user.setProperty(name, value); } - public void setProperty(String name, Value[] values) throws RepositoryException { + public void setProperty(@NotNull String name, Value[] values) throws RepositoryException { user.setProperty(name, values); } - public Value[] getProperty(String name) throws RepositoryException { + public Value[] getProperty(@NotNull String name) throws RepositoryException { return user.getProperty(name); } - public boolean removeProperty(String name) throws RepositoryException { + public boolean removeProperty(@NotNull String name) throws RepositoryException { return user.removeProperty(name); } + @NotNull public String getPath() throws RepositoryException { return user.getPath(); } Index: oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/RemappingTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/RemappingTest.java (revision 1865297) +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/RemappingTest.java (date 1565950268000) @@ -32,6 +32,7 @@ import org.apache.jackrabbit.api.security.user.UserManager; import org.apache.jackrabbit.oak.spi.namespace.NamespaceConstants; import org.apache.jackrabbit.oak.spi.security.user.UserConstants; +import org.jetbrains.annotations.NotNull; import org.junit.Test; /** @@ -147,7 +148,7 @@ @Test public void testQuery() throws Exception { Iterator result = getUserManager(session).findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. eq("@my:property", vf.createValue("value"))); } Index: oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserQueryTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserQueryTest.java (revision 1865297) +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/security/user/UserQueryTest.java (date 1565950268000) @@ -42,6 +42,7 @@ import org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl; import org.apache.jackrabbit.oak.spi.security.user.UserConstants; import org.apache.jackrabbit.util.Text; +import org.jetbrains.annotations.NotNull; import org.junit.Test; /** @@ -193,7 +194,7 @@ @Test public void testAny() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { /* any */ } + public void build(@NotNull QueryBuilder builder) { /* any */ } }); assertSameElements(result, authorizables.iterator()); @@ -208,7 +209,7 @@ for (final Class s : selectors) { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setSelector(s); } }); @@ -228,7 +229,7 @@ Group[] groups = new Group[]{mammals, vertebrates, apes}; for (final Group g : groups) { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { try { builder.setScope(g.getID(), true); } catch (RepositoryException e) { @@ -247,7 +248,7 @@ Group[] groups = new Group[]{mammals, vertebrates, apes}; for (final Group g : groups) { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { try { builder.setScope(g.getID(), false); } catch (RepositoryException e) { @@ -266,7 +267,7 @@ Group[] groups = new Group[]{mammals, vertebrates, apes}; for (final Group g : groups) { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { try { builder.setSelector(User.class); builder.setScope(g.getID(), false); @@ -291,7 +292,7 @@ Group[] groups = new Group[]{mammals, vertebrates, apes}; for (final Group g : groups) { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { try { builder.setSelector(Group.class); builder.setScope(g.getID(), true); @@ -323,7 +324,7 @@ } Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setScope(EveryonePrincipal.NAME, true); } }); @@ -341,7 +342,7 @@ @Test public void testNameMatch() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.nameMatches("a%")); } }); @@ -382,7 +383,7 @@ // search for the authorizable ID Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.nameMatches("moloch")); } }); @@ -393,7 +394,7 @@ // search for the principal name (basically just for backwards compatibility) result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.nameMatches("MolochHorridus")); } }); @@ -404,7 +405,7 @@ // search for the node name result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.nameMatches("thorny_dragon")); } }); @@ -417,7 +418,7 @@ @Test public void testFindProperty1() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. eq("@canFly", vf.createValue(true))); } @@ -442,7 +443,7 @@ @Test public void testFindProperty2() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. gt("profile/@weight", vf.createValue(2000.0))); } @@ -467,7 +468,7 @@ @Test public void testFindProperty3() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. eq("@numberOfLegs", vf.createValue(8))); } @@ -492,7 +493,7 @@ @Test public void testPropertyExistence() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. exists("@poisonous")); } @@ -517,7 +518,7 @@ @Test public void testPropertyLike() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. like("profile/@food", "m%")); } @@ -547,7 +548,7 @@ @Test public void testContains1() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. contains(".", "gold")); } @@ -561,7 +562,7 @@ @Test public void testContains2() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. contains("@color", "gold")); } @@ -575,7 +576,7 @@ @Test public void testContains3() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.contains("profile/.", "grass")); } }); @@ -588,7 +589,7 @@ @Test public void testContains4() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. contains("profile/@food", "grass")); } @@ -602,7 +603,7 @@ @Test public void testCondition1() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. and(builder. eq("profile/@cute", vf.createValue(true)), builder. @@ -632,7 +633,7 @@ @Test public void testCondition2() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. or(builder. eq("profile/@food", vf.createValue("mice")), builder. @@ -660,7 +661,7 @@ @Test public void testImpersonation() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. impersonates("jackrabbit")); } @@ -674,7 +675,7 @@ @Test public void testImpersonationWithBackslash() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. impersonates("foo\\bar")); } @@ -689,7 +690,7 @@ public void testAdminImpersonation() throws Exception { final String adminPrincipalName = userMgr.getAuthorizable(superuser.getUserID()).getPrincipal().getName(); Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.impersonates(adminPrincipalName)); } }); @@ -702,7 +703,7 @@ @Test public void testSortOrderIgnoreCaseDescending() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. exists("@color")); builder.setSortOrder("@color", QueryBuilder.Direction.DESCENDING, true); @@ -724,7 +725,7 @@ @Test public void testSortOrderRespectCaseDescending() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. exists("@color")); builder.setSortOrder("@color", QueryBuilder.Direction.DESCENDING, false); @@ -746,7 +747,7 @@ @Test public void testSortOrderRespectCaseAscendingDoubleValue() throws RepositoryException { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. exists("profile/@weight")); builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING, false); @@ -771,7 +772,7 @@ @Test public void testSortOrderIgnoreCaseAscending() throws Exception { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.exists("@continent")); builder.setSortOrder("@continent", QueryBuilder.Direction.ASCENDING, true); } @@ -795,7 +796,7 @@ @Test() public void testSortOrderRespectCaseAscending() throws Exception { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder.exists("@continent")); builder.setSortOrder("@continent", QueryBuilder.Direction.ASCENDING, false); } @@ -822,14 +823,14 @@ final long offset = offsets[k]; final long count = counts[k]; Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); builder.setLimit(offset, count); } }); Iterator expected = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); } }); @@ -868,7 +869,7 @@ long[] counts = {4, 0, 100000}; for (final long count : counts) { Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setCondition(builder. eq("profile/@cute", vf.createValue(true))); builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING, false); @@ -902,7 +903,7 @@ final int count = 10000; Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setScope("vertebrates", false); builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); builder.setLimit(offset, count); @@ -910,7 +911,7 @@ }); Iterator expected = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setScope("vertebrates", false); builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); } @@ -927,7 +928,7 @@ final int count = 22; Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setScope("vertebrates", false); builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); builder.setLimit(offset, count); @@ -935,7 +936,7 @@ }); Iterator expected = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setScope("vertebrates", false); builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); } @@ -951,14 +952,14 @@ final long countjr2 = -1; // in jackrabbit -1 could be used to set no limit Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); builder.setLimit(0, countjr2); } }); Iterator expected = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); builder.setLimit(0, count); } @@ -974,7 +975,7 @@ final long countjr2 = -1; // in jackrabbit -1 could be used to set no limit Iterator result = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); builder.setScope("vertebrates", false); builder.setLimit(0, countjr2); @@ -982,7 +983,7 @@ }); Iterator expected = userMgr.findAuthorizables(new Query() { - public void build(QueryBuilder builder) { + public void build(@NotNull QueryBuilder builder) { builder.setSortOrder("profile/@weight", QueryBuilder.Direction.ASCENDING); builder.setScope("vertebrates", false); builder.setLimit(0, count); Index: oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/ClearMembershipActionTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/ClearMembershipActionTest.java (revision 1865297) +++ oak-security-spi/src/test/java/org/apache/jackrabbit/oak/spi/security/user/action/ClearMembershipActionTest.java (date 1565955726000) @@ -92,46 +92,51 @@ Set removed = new HashSet<>(); + @NotNull @Override public Iterator getDeclaredMembers() { throw new UnsupportedOperationException(); } + @NotNull @Override public Iterator getMembers() { throw new UnsupportedOperationException(); } @Override - public boolean isDeclaredMember(Authorizable authorizable) { + public boolean isDeclaredMember(@NotNull Authorizable authorizable) { throw new UnsupportedOperationException(); } @Override - public boolean isMember(Authorizable authorizable) { + public boolean isMember(@NotNull Authorizable authorizable) { throw new UnsupportedOperationException(); } @Override - public boolean addMember(Authorizable authorizable) { + public boolean addMember(@NotNull Authorizable authorizable) { throw new UnsupportedOperationException(); } + @NotNull @Override public Set addMembers(@NotNull String... strings) { throw new UnsupportedOperationException(); } @Override - public boolean removeMember(Authorizable authorizable) { + public boolean removeMember(@NotNull Authorizable authorizable) { return removed.add(authorizable); } + @NotNull @Override public Set removeMembers(@NotNull String... strings) { throw new UnsupportedOperationException(); } + @NotNull @Override public String getID() { throw new UnsupportedOperationException(); @@ -142,16 +147,19 @@ throw new UnsupportedOperationException(); } + @NotNull @Override public Principal getPrincipal() { throw new UnsupportedOperationException(); } + @NotNull @Override public Iterator declaredMemberOf() { return Collections.emptyIterator(); } + @NotNull @Override public Iterator memberOf() { throw new UnsupportedOperationException(); @@ -162,41 +170,44 @@ throw new UnsupportedOperationException(); } + @NotNull @Override public Iterator getPropertyNames() { throw new UnsupportedOperationException(); } + @NotNull @Override - public Iterator getPropertyNames(String s) { + public Iterator getPropertyNames(@NotNull String s) { throw new UnsupportedOperationException(); } @Override - public boolean hasProperty(String s) { + public boolean hasProperty(@NotNull String s) { throw new UnsupportedOperationException(); } @Override - public void setProperty(String s, Value value) { + public void setProperty(@NotNull String s, Value value) { throw new UnsupportedOperationException(); } @Override - public void setProperty(String s, Value[] values) { + public void setProperty(@NotNull String s, Value[] values) { throw new UnsupportedOperationException(); } @Override - public Value[] getProperty(String s) { + public Value[] getProperty(@NotNull String s) { throw new UnsupportedOperationException(); } @Override - public boolean removeProperty(String s) { + public boolean removeProperty(@NotNull String s) { throw new UnsupportedOperationException(); } + @NotNull @Override public String getPath() { throw new UnsupportedOperationException();