Author: reschke
Date: Wed Nov  7 13:35:46 2018
New Revision: 1846007

URL: http://svn.apache.org/viewvc?rev=1846007&view=rev
Log:
OAK-7669: backport of: OAK-7511: get rid of JSR 305 dependency - use jetbrains 
nullability annotations instead - oak-auth-ldap

Modified:
    jackrabbit/oak/branches/1.8/   (props changed)
    jackrabbit/oak/branches/1.8/oak-auth-ldap/pom.xml
    
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java
    
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java
    
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java
    
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java
    
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java

Propchange: jackrabbit/oak/branches/1.8/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Nov  7 13:35:46 2018
@@ -1,3 +1,3 @@
 /jackrabbit/oak/branches/1.0:1665962
-/jackrabbit/oak/trunk:1820660-1820661,1820729,1820734,1820859,1820861,1820878,1820888,1820947,1821027,1821130,1821140-1821141,1821178,1821237,1821240,1821249,1821258,1821325,1821358,1821361-1821362,1821370,1821375,1821393,1821477,1821487,1821516,1821617,1821663,1821665,1821668,1821681,1821847,1821975-1821983,1822121,1822201,1822207,1822527,1822723,1822808,1822850,1822934,1823135,1823163,1823169,1823172,1823655,1823669,1824196,1824198,1824253,1824255,1824896,1824962,1825065,1825362,1825381,1825442,1825448,1825466,1825470-1825471,1825475,1825523,1825525,1825561,1825619-1825621,1825651,1825654,1825992,1826079,1826090,1826096,1826216,1826237,1826338,1826516,1826532,1826551,1826560,1826638,1826640,1826730,1826932,1826957,1827423,1827472,1827486,1827816,1827977,1828349,1828439,1828502,1828529,1828948,1829527,1829534,1829546,1829569,1829587,1829665,1829854,1829864,1829978,1829985,1829987,1829998,1830019,1830048,1830160,1830171,1830197,1830209,1830239,1830347,1830748,1830911,1830923,1831157
 
-1831158,1831163,1831190,1831374,1831560,1831689,1832258,1832376,1832379,1832535,1833308,1833347,1833833,1834112,1834117,1834287,1834291,1834302,1834326,1834328,1834336,1834428,1834468,1834483,1834610,1834648-1834649,1834681,1834823,1834857-1834858,1835060,1835518,1835521,1835635,1835642,1835780,1835819,1836082,1836121,1836167-1836168,1836170,1836487,1836493,1837057,1837274,1837296,1837326,1837475,1837503,1837547,1837569,1837600,1837657,1837718,1837998,1838076,1838637,1839549,1839570,1839637,1839746,1840019,1840024,1840031,1840455,1840574,1841314,1841352,1842089,1842677,1843222,1843231,1843398,1843618,1843652,1843911,1844325,1844549,1844625,1844627,1844642,1844728,1844775,1844932,1845336
+/jackrabbit/oak/trunk:1820660-1820661,1820729,1820734,1820859,1820861,1820878,1820888,1820947,1821027,1821130,1821140-1821141,1821178,1821237,1821240,1821249,1821258,1821325,1821358,1821361-1821362,1821370,1821375,1821393,1821477,1821487,1821516,1821617,1821663,1821665,1821668,1821681,1821847,1821975-1821983,1822121,1822201,1822207,1822527,1822723,1822808,1822850,1822934,1823135,1823163,1823169,1823172,1823655,1823669,1824196,1824198,1824253,1824255,1824896,1824962,1825065,1825362,1825381,1825442,1825448,1825466,1825470-1825471,1825475,1825523,1825525,1825561,1825619-1825621,1825651,1825654,1825992,1826079,1826090,1826096,1826216,1826237,1826338,1826516,1826532,1826551,1826560,1826638,1826640,1826730,1826932,1826957,1827423,1827472,1827486,1827816,1827977,1828349,1828439,1828502,1828529,1828948,1829527,1829534,1829546,1829569,1829587,1829665,1829854,1829864,1829978,1829985,1829987,1829998,1830019,1830048,1830160,1830171,1830197,1830209,1830239,1830347,1830748,1830911,1830923,1831157
 
-1831158,1831163,1831190,1831374,1831560,1831689,1832258,1832376,1832379,1832535,1833308,1833347,1833833,1834112,1834117,1834287,1834291,1834302,1834326,1834328,1834336,1834428,1834468,1834483,1834610,1834648-1834649,1834681,1834823,1834857-1834858,1835060,1835518,1835521,1835635,1835642,1835780,1835819,1836082,1836121,1836167-1836168,1836170-1836171,1836487,1836493,1837057,1837274,1837296,1837326,1837475,1837503,1837547,1837569,1837600,1837657,1837718,1837998,1838076,1838637,1839549,1839570,1839637,1839746,1840019,1840024,1840031,1840455,1840574,1841314,1841352,1842089,1842677,1843222,1843231,1843398,1843618,1843652,1843911,1844325,1844549,1844625,1844627,1844642,1844728,1844775,1844932,1845336
 /jackrabbit/trunk:1345480

Modified: jackrabbit/oak/branches/1.8/oak-auth-ldap/pom.xml
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-auth-ldap/pom.xml?rev=1846007&r1=1846006&r2=1846007&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.8/oak-auth-ldap/pom.xml (original)
+++ jackrabbit/oak/branches/1.8/oak-auth-ldap/pom.xml Wed Nov  7 13:35:46 2018
@@ -185,10 +185,10 @@
             <artifactId>slf4j-api</artifactId>
         </dependency>
 
-        <!-- Findbugs annotations -->
+        <!-- Nullability annotations -->
         <dependency>
-            <groupId>com.google.code.findbugs</groupId>
-            <artifactId>jsr305</artifactId>
+            <groupId>org.jetbrains</groupId>
+            <artifactId>annotations</artifactId>
         </dependency>
 
         <!-- Test Dependencies -->

Modified: 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java?rev=1846007&r1=1846006&r2=1846007&view=diff
==============================================================================
--- 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java
 (original)
+++ 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapGroup.java
 Wed Nov  7 13:35:46 2018
@@ -18,12 +18,11 @@ package org.apache.jackrabbit.oak.securi
 
 import java.util.Map;
 
-import javax.annotation.Nonnull;
-
 import org.apache.directory.api.ldap.model.entry.Entry;
 import 
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalGroup;
 import 
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException;
 import 
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef;
+import org.jetbrains.annotations.NotNull;
 
 public class LdapGroup extends LdapIdentity implements ExternalGroup {
 
@@ -33,7 +32,7 @@ public class LdapGroup extends LdapIdent
         super(provider, ref, id, path, entry);
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public Iterable<ExternalIdentityRef> getDeclaredMembers() throws 
ExternalIdentityException {
         if (members == null) {

Modified: 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java?rev=1846007&r1=1846006&r2=1846007&view=diff
==============================================================================
--- 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java
 (original)
+++ 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentity.java
 Wed Nov  7 13:35:46 2018
@@ -18,12 +18,11 @@ package org.apache.jackrabbit.oak.securi
 
 import java.util.Map;
 
-import javax.annotation.Nonnull;
-
 import org.apache.directory.api.ldap.model.entry.Entry;
 import 
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentity;
 import 
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityException;
 import 
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalIdentityRef;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * Implements an identity that is provided by the {@link LdapIdentityProvider}.
@@ -59,7 +58,7 @@ public abstract class LdapIdentity imple
     /**
      * {@inheritDoc}
      */
-    @Nonnull
+    @NotNull
     @Override
     public ExternalIdentityRef getExternalId() {
         return ref;
@@ -68,7 +67,7 @@ public abstract class LdapIdentity imple
     /**
      * {@inheritDoc}
      */
-    @Nonnull
+    @NotNull
     @Override
     public String getId() {
         return id;
@@ -78,7 +77,7 @@ public abstract class LdapIdentity imple
      * Returns the DN as principal name.
      * @return the DN
      */
-    @Nonnull
+    @NotNull
     @Override
     public String getPrincipalName() {
         return ref.getId();
@@ -95,7 +94,7 @@ public abstract class LdapIdentity imple
     /**
      * {@inheritDoc}
      */
-    @Nonnull
+    @NotNull
     @Override
     public Iterable<ExternalIdentityRef> getDeclaredGroups() throws 
ExternalIdentityException {
         if (groups == null) {
@@ -107,7 +106,7 @@ public abstract class LdapIdentity imple
     /**
      * {@inheritDoc}
      */
-    @Nonnull
+    @NotNull
     @Override
     public Map<String, Object> getProperties() {
         return properties;

Modified: 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java?rev=1846007&r1=1846006&r2=1846007&view=diff
==============================================================================
--- 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java
 (original)
+++ 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProperties.java
 Wed Nov  7 13:35:46 2018
@@ -20,8 +20,7 @@ import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * {@code LdapIdentityProperties} implements a case insensitive hash map that 
preserves the case of the keys but
@@ -88,7 +87,7 @@ public class LdapIdentityProperties exte
         keyMapping.clear();
     }
 
-    @CheckForNull
+    @Nullable
     private String convert(@Nullable Object obj) {
         if (obj == null) {
             return null;
@@ -96,4 +95,4 @@ public class LdapIdentityProperties exte
         String key = obj instanceof String ? (String) obj : 
String.valueOf(obj);
         return key.toUpperCase(Locale.ENGLISH).toLowerCase(Locale.ENGLISH);
     }
-}
\ No newline at end of file
+}

Modified: 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java?rev=1846007&r1=1846006&r2=1846007&view=diff
==============================================================================
--- 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java
 (original)
+++ 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapIdentityProvider.java
 Wed Nov  7 13:35:46 2018
@@ -27,9 +27,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import javax.jcr.Credentials;
 import javax.jcr.SimpleCredentials;
 import javax.net.ssl.SSLContext;
@@ -80,6 +77,8 @@ import org.apache.jackrabbit.oak.spi.sec
 import 
org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser;
 import 
org.apache.jackrabbit.oak.spi.security.authentication.external.PrincipalNameResolver;
 import org.apache.jackrabbit.util.Text;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -142,7 +141,7 @@ public class LdapIdentityProvider implem
      * Constructor for non-OSGi cases.
      * @param config the configuration
      */
-    public LdapIdentityProvider(@Nonnull LdapProviderConfig config) {
+    public LdapIdentityProvider(@NotNull LdapProviderConfig config) {
         this.config = config;
         init();
     }
@@ -185,9 +184,9 @@ public class LdapIdentityProvider implem
     }
 
     //----------------------------------------------< PrincipalNameResolver 
>---
-    @Nonnull
+    @NotNull
     @Override
-    public String fromExternalIdentityRef(@Nonnull ExternalIdentityRef 
externalIdentityRef) throws ExternalIdentityException {
+    public String fromExternalIdentityRef(@NotNull ExternalIdentityRef 
externalIdentityRef) throws ExternalIdentityException {
         if (!isMyRef(externalIdentityRef)) {
             throw new ExternalIdentityException("Foreign IDP " + 
externalIdentityRef.getString());
         }
@@ -195,14 +194,14 @@ public class LdapIdentityProvider implem
     }
 
     //-------------------------------------------< ExternalIdentityProvider 
>---
-    @Nonnull
+    @NotNull
     @Override
     public String getName() {
         return config.getName();
     }
 
     @Override
-    public ExternalIdentity getIdentity(@Nonnull ExternalIdentityRef ref) 
throws ExternalIdentityException {
+    public ExternalIdentity getIdentity(@NotNull ExternalIdentityRef ref) 
throws ExternalIdentityException {
         if (!isMyRef(ref)) {
             return null;
         }
@@ -243,7 +242,7 @@ public class LdapIdentityProvider implem
     }
 
     @Override
-    public ExternalUser getUser(@Nonnull String userId) throws 
ExternalIdentityException {
+    public ExternalUser getUser(@NotNull String userId) throws 
ExternalIdentityException {
         DebugTimer timer = new DebugTimer();
         LdapConnection connection = connect();
         timer.mark("connect");
@@ -266,7 +265,7 @@ public class LdapIdentityProvider implem
     }
 
     @Override
-    public ExternalGroup getGroup(@Nonnull String name) throws 
ExternalIdentityException {
+    public ExternalGroup getGroup(@NotNull String name) throws 
ExternalIdentityException {
         DebugTimer timer = new DebugTimer();
         LdapConnection connection = connect();
         timer.mark("connect");
@@ -288,7 +287,7 @@ public class LdapIdentityProvider implem
         }
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public Iterator<ExternalUser> listUsers() throws ExternalIdentityException 
{
         try {
@@ -312,7 +311,7 @@ public class LdapIdentityProvider implem
         }
     }
 
-    @Nonnull
+    @NotNull
     @Override
     public Iterator<ExternalGroup> listGroups() throws 
ExternalIdentityException {
         try {
@@ -337,7 +336,7 @@ public class LdapIdentityProvider implem
     }
 
     @Override
-    public ExternalUser authenticate(@Nonnull Credentials credentials) throws 
ExternalIdentityException, LoginException {
+    public ExternalUser authenticate(@NotNull Credentials credentials) throws 
ExternalIdentityException, LoginException {
         if (!(credentials instanceof SimpleCredentials)) {
             log.debug("LDAP IDP can only authenticate SimpleCredentials.");
             return null;
@@ -555,7 +554,7 @@ public class LdapIdentityProvider implem
      * Creates a new connection config based on the config.
      * @return the connection config.
      */
-    @Nonnull
+    @NotNull
     private LdapConnectionConfig createConnectionConfig() {
         LdapConnectionConfig cc = new LdapConnectionConfig();
         cc.setLdapHost(config.getHostname());
@@ -575,8 +574,8 @@ public class LdapIdentityProvider implem
         return cc;
     }
 
-    @CheckForNull
-    private Entry getEntry(@Nonnull LdapConnection connection, @Nonnull 
LdapProviderConfig.Identity idConfig, @Nonnull String id, @Nonnull String[] 
customAttributes)
+    @Nullable
+    private Entry getEntry(@NotNull LdapConnection connection, @NotNull 
LdapProviderConfig.Identity idConfig, @NotNull String id, @NotNull String[] 
customAttributes)
             throws CursorException, LdapException {
         String searchFilter = idConfig.getSearchFilter(id);
 
@@ -632,8 +631,8 @@ public class LdapIdentityProvider implem
     }
 
 
-    @Nonnull
-    private SearchResultIterator getEntryIterator(@Nonnull 
LdapProviderConfig.Identity idConfig) throws LdapException, CursorException, 
ExternalIdentityException {
+    @NotNull
+    private SearchResultIterator getEntryIterator(@NotNull 
LdapProviderConfig.Identity idConfig) throws LdapException, CursorException, 
ExternalIdentityException {
         StringBuilder filter = new StringBuilder();
         int num = 0;
         for (String objectClass: idConfig.getObjectClasses()) {
@@ -665,8 +664,8 @@ public class LdapIdentityProvider implem
         private int pos = -1;
 
         public SearchResultIterator(
-                @Nonnull String searchFilter,
-                @Nonnull LdapProviderConfig.Identity idConfig) throws 
LdapException, CursorException, ExternalIdentityException {
+                @NotNull String searchFilter,
+                @NotNull LdapProviderConfig.Identity idConfig) throws 
LdapException, CursorException, ExternalIdentityException {
             this.searchFilter = searchFilter;
             this.idConfig = idConfig;
             findNextEntry();
@@ -700,7 +699,7 @@ public class LdapIdentityProvider implem
 
         //-------------------------------------------------------< internal 
>---
 
-        private SearchRequest createSearchRequest(LdapConnection connection, 
byte[] cookie, @Nonnull String[] userAttributes) throws LdapException {
+        private SearchRequest createSearchRequest(LdapConnection connection, 
byte[] cookie, @NotNull String[] userAttributes) throws LdapException {
             SearchRequest req = new SearchRequestImpl();
             req.setScope(SearchScope.SUBTREE);
             if (userAttributes.length == 0) {
@@ -788,20 +787,20 @@ public class LdapIdentityProvider implem
         }
     }
 
-    @Nonnull
-    private ExternalUser createUser(@Nonnull Entry entry, @CheckForNull String 
id)
+    @NotNull
+    private ExternalUser createUser(@NotNull Entry entry, @Nullable String id)
             throws LdapInvalidAttributeValueException {
         return (ExternalUser) createIdentity(entry, id, false);
     }
 
-    @Nonnull
-    private ExternalGroup createGroup(@Nonnull Entry entry, @CheckForNull 
String id)
+    @NotNull
+    private ExternalGroup createGroup(@NotNull Entry entry, @Nullable String 
id)
             throws LdapInvalidAttributeValueException {
         return (ExternalGroup) createIdentity(entry, id, true);
     }
 
-    @Nonnull
-    private ExternalIdentity createIdentity(@Nonnull Entry entry, 
@CheckForNull String id, boolean isGroup)
+    @NotNull
+    private ExternalIdentity createIdentity(@NotNull Entry entry, @Nullable 
String id, boolean isGroup)
             throws LdapInvalidAttributeValueException {
         LdapProviderConfig.Identity cfg = isGroup ? config.getGroupConfig() : 
config.getUserConfig();
         if (id == null) {
@@ -845,7 +844,7 @@ public class LdapIdentityProvider implem
         }
     }
 
-    @Nonnull
+    @NotNull
     private LdapConnection connect() throws ExternalIdentityException {
         try {
             if (adminPool == null) {
@@ -874,7 +873,7 @@ public class LdapIdentityProvider implem
         }
     }
 
-    private boolean isMyRef(@Nonnull ExternalIdentityRef ref) {
+    private boolean isMyRef(@NotNull ExternalIdentityRef ref) {
         final String refProviderName = ref.getProviderName();
         return refProviderName == null || refProviderName.isEmpty() || 
getName().equals(refProviderName);
     }
@@ -895,9 +894,9 @@ public class LdapIdentityProvider implem
         return path.toString();
     }
 
-    private static ExternalIdentityException lookupFailedException(@Nonnull 
Exception e, @CheckForNull DebugTimer timer) {
+    private static ExternalIdentityException lookupFailedException(@NotNull 
Exception e, @Nullable DebugTimer timer) {
         String msg = "Error during ldap lookup. ";
         log.error(msg + ((timer != null) ? timer.getString() : ""), e);
         return new ExternalIdentityException(msg, e);
     }
-}
\ No newline at end of file
+}

Modified: 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java?rev=1846007&r1=1846006&r2=1846007&view=diff
==============================================================================
--- 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
 (original)
+++ 
jackrabbit/oak/branches/1.8/oak-auth-ldap/src/main/java/org/apache/jackrabbit/oak/security/authentication/ldap/impl/LdapProviderConfig.java
 Wed Nov  7 13:35:46 2018
@@ -20,14 +20,12 @@ import java.util.Arrays;
 import java.util.LinkedList;
 import java.util.List;
 
-import javax.annotation.CheckForNull;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
 import org.apache.directory.api.util.Strings;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * Configuration of the ldap provider.
@@ -459,7 +457,7 @@ public class LdapProviderConfig {
          * Configures the base DN for searches of this kind of identity
          * @return the base DN
          */
-        @Nonnull
+        @NotNull
         public String getBaseDN() {
             return baseDN;
         }
@@ -470,8 +468,8 @@ public class LdapProviderConfig {
          * @return {@code this}
          * @see #getBaseDN()
          */
-        @Nonnull
-        public Identity setBaseDN(@Nonnull String baseDN) {
+        @NotNull
+        public Identity setBaseDN(@NotNull String baseDN) {
             this.baseDN = baseDN;
             return this;
         }
@@ -481,7 +479,7 @@ public class LdapProviderConfig {
          * @return an array of object classes
          * @see #getSearchFilter(String) for more detail about searching and 
filtering
          */
-        @Nonnull
+        @NotNull
         public String[] getObjectClasses() {
             return objectClasses;
         }
@@ -492,8 +490,8 @@ public class LdapProviderConfig {
          * @return {@code this}
          * @see #getObjectClasses()
          */
-        @Nonnull
-        public Identity setObjectClasses(@Nonnull String ... objectClasses) {
+        @NotNull
+        public Identity setObjectClasses(@NotNull String ... objectClasses) {
             this.objectClasses = objectClasses;
             filterTemplate = null;
             memberOfFilterTemplate = null;
@@ -507,7 +505,7 @@ public class LdapProviderConfig {
          * @return the id attribute name
          * @see #getSearchFilter(String) for more detail about searching and 
filtering
          */
-        @Nonnull
+        @NotNull
         public String getIdAttribute() {
             return idAttribute;
         }
@@ -518,8 +516,8 @@ public class LdapProviderConfig {
          * @return {@code this}
          * @see #getIdAttribute()
          */
-        @Nonnull
-        public Identity setIdAttribute(@Nonnull String idAttribute) {
+        @NotNull
+        public Identity setIdAttribute(@NotNull String idAttribute) {
             this.idAttribute = idAttribute;
             filterTemplate = null;
             memberOfFilterTemplate = null;
@@ -532,7 +530,7 @@ public class LdapProviderConfig {
          *
          * @return the extra filter
          */
-        @CheckForNull
+        @Nullable
         public String getExtraFilter() {
             return extraFilter;
         }
@@ -543,7 +541,7 @@ public class LdapProviderConfig {
          * @return {@code this}
          * @see #getExtraFilter()
          */
-        @Nonnull
+        @NotNull
         public Identity setExtraFilter(@Nullable String extraFilter) {
             this.extraFilter = extraFilter;
             filterTemplate = null;
@@ -566,7 +564,7 @@ public class LdapProviderConfig {
          * @return {@code this}
          * @see #makeDnPath()
          */
-        @Nonnull
+        @NotNull
         public Identity setMakeDnPath(boolean makeDnPath) {
             this.makeDnPath = makeDnPath;
             return this;
@@ -585,8 +583,8 @@ public class LdapProviderConfig {
          * @param id the id value
          * @return the search filter
          */
-        @Nonnull
-        public String getSearchFilter(@Nonnull String id) {
+        @NotNull
+        public String getSearchFilter(@NotNull String id) {
             if (filterTemplate == null) {
                 StringBuilder filter = new StringBuilder("(&(")
                         .append(idAttribute)
@@ -650,7 +648,7 @@ public class LdapProviderConfig {
          * @param maxActive the new upper limit of the pool size
          * @return this
          */
-        @Nonnull
+        @NotNull
         public PoolConfig setMaxActive(int maxActive) {
             this.maxActiveSize = maxActive;
             return this;
@@ -674,7 +672,7 @@ public class LdapProviderConfig {
          * @param lookupOnValidate the new value of the lookup on validate flag
          * @return this
          */
-        @Nonnull
+        @NotNull
         public PoolConfig setLookupOnValidate(boolean lookupOnValidate) {
             this.lookupOnValidate = lookupOnValidate;
             return this;
@@ -791,7 +789,7 @@ public class LdapProviderConfig {
      *
      * @return the name.
      */
-    @Nonnull
+    @NotNull
     public String getName() {
         return name;
     }
@@ -802,8 +800,8 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #getName()
      */
-    @Nonnull
-    public LdapProviderConfig setName(@Nonnull String name) {
+    @NotNull
+    public LdapProviderConfig setName(@NotNull String name) {
         this.name = name;
         return this;
     }
@@ -814,7 +812,7 @@ public class LdapProviderConfig {
      *
      * @return the hostname
      */
-    @Nonnull
+    @NotNull
     public String getHostname() {
         return hostname;
     }
@@ -825,8 +823,8 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #getHostname()
      */
-    @Nonnull
-    public LdapProviderConfig setHostname(@Nonnull String hostname) {
+    @NotNull
+    public LdapProviderConfig setHostname(@NotNull String hostname) {
         this.hostname = hostname;
         return this;
     }
@@ -847,7 +845,7 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #getPort()
      */
-    @Nonnull
+    @NotNull
     public LdapProviderConfig setPort(int port) {
         this.port = port;
         return this;
@@ -869,7 +867,7 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #useSSL()
      */
-    @Nonnull
+    @NotNull
     public LdapProviderConfig setUseSSL(boolean useSSL) {
         this.useSSL = useSSL;
         return this;
@@ -891,7 +889,7 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #useTLS()
      */
-    @Nonnull
+    @NotNull
     public LdapProviderConfig setUseTLS(boolean useTLS) {
         this.useTLS = useTLS;
         return this;
@@ -913,7 +911,7 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #noCertCheck()
      */
-    @Nonnull
+    @NotNull
     public LdapProviderConfig setNoCertCheck(boolean noCertCheck) {
         this.noCertCheck = noCertCheck;
         return this;
@@ -924,7 +922,7 @@ public class LdapProviderConfig {
      * anonymous connections are used.
      * @return the bind DN or {@code null}.
      */
-    @CheckForNull
+    @Nullable
     public String getBindDN() {
         return bindDN;
     }
@@ -935,7 +933,7 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #getBindDN()
      */
-    @Nonnull
+    @NotNull
     public LdapProviderConfig setBindDN(@Nullable String bindDN) {
         this.bindDN = bindDN;
         return this;
@@ -945,7 +943,7 @@ public class LdapProviderConfig {
      * Configures the password that is used to bind to the LDAP server. This 
value is not used for anonymous binds.
      * @return the password.
      */
-    @CheckForNull
+    @Nullable
     public String getBindPassword() {
         return bindPassword;
     }
@@ -956,7 +954,7 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #getBindPassword()
      */
-    @Nonnull
+    @NotNull
     public LdapProviderConfig setBindPassword(@Nullable String bindPassword) {
         this.bindPassword = bindPassword;
         return this;
@@ -978,7 +976,7 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #getSearchTimeout()
      */
-    @Nonnull
+    @NotNull
     public LdapProviderConfig setSearchTimeout(long searchTimeout) {
         this.searchTimeout = searchTimeout;
         return this;
@@ -990,7 +988,7 @@ public class LdapProviderConfig {
      *
      * @return the group member attribute
      */
-    @Nonnull
+    @NotNull
     public String getGroupMemberAttribute() {
         return groupMemberAttribute;
     }
@@ -1001,8 +999,8 @@ public class LdapProviderConfig {
      * @return {@code this}
      * @see #getGroupMemberAttribute()
      */
-    @Nonnull
-    public LdapProviderConfig setGroupMemberAttribute(@Nonnull String 
groupMemberAttribute) {
+    @NotNull
+    public LdapProviderConfig setGroupMemberAttribute(@NotNull String 
groupMemberAttribute) {
         this.groupMemberAttribute = groupMemberAttribute;
         return this;
     }
@@ -1012,7 +1010,7 @@ public class LdapProviderConfig {
      *
      * @return true iff the value of the user id (resp. group name) attribute 
will be used to create external identifiers
      */
-    @Nonnull
+    @NotNull
     public boolean getUseUidForExtId() {
         return useUidForExtId;
     }
@@ -1024,7 +1022,7 @@ public class LdapProviderConfig {
      * @param useUidForExtId the new value of #useUidForExtId
      * @return {@code this}
      */
-    @Nonnull
+    @NotNull
     public LdapProviderConfig setUseUidForExtId(boolean useUidForExtId) {
         this.useUidForExtId = useUidForExtId;
         return this;
@@ -1036,7 +1034,7 @@ public class LdapProviderConfig {
      *
      * @return an array of attribute names. The empty array indicates that all 
attributes will be retrieved.
      */
-    @Nonnull
+    @NotNull
     public String[] getCustomAttributes() {
         return customAttributes;
     }
@@ -1047,8 +1045,8 @@ public class LdapProviderConfig {
      * @param customAttributes an array of attribute names
      * @return the Identity instance
      */
-    @Nonnull
-    public LdapProviderConfig setCustomAttributes(@Nonnull String[] 
customAttributes) {
+    @NotNull
+    public LdapProviderConfig setCustomAttributes(@NotNull String[] 
customAttributes) {
         this.customAttributes = this.removeEmptyStrings(customAttributes);
         return this;
     }
@@ -1067,7 +1065,7 @@ public class LdapProviderConfig {
      * @param dn the dn of the identity to search for
      * @return the search filter
      */
-    public String getMemberOfSearchFilter(@Nonnull String dn) {
+    public String getMemberOfSearchFilter(@NotNull String dn) {
         if (memberOfFilterTemplate == null) {
             StringBuilder filter = new StringBuilder("(&(")
                     .append(groupMemberAttribute)
@@ -1090,7 +1088,7 @@ public class LdapProviderConfig {
      * Returns the user specific configuration.
      * @return the user config.
      */
-    @Nonnull
+    @NotNull
     public Identity getUserConfig() {
         return userConfig;
     }
@@ -1099,7 +1097,7 @@ public class LdapProviderConfig {
      * Returns the group specific configuration.
      * @return the groups config.
      */
-    @Nonnull
+    @NotNull
     public Identity getGroupConfig() {
         return groupConfig;
     }
@@ -1108,7 +1106,7 @@ public class LdapProviderConfig {
      * Returns the admin connection pool configuration.
      * @return admin pool config
      */
-    @Nonnull
+    @NotNull
     public PoolConfig getAdminPoolConfig() {
         return adminPoolConfig;
     }
@@ -1117,7 +1115,7 @@ public class LdapProviderConfig {
      * Returns the user connection pool configuration.
      * @return user pool config
      */
-    @Nonnull
+    @NotNull
     public PoolConfig getUserPoolConfig() {
         return userPoolConfig;
     }
@@ -1175,7 +1173,7 @@ public class LdapProviderConfig {
     }
 
     //OAK-5490
-    private String[] removeEmptyStrings(@Nonnull String[] params) {
+    private String[] removeEmptyStrings(@NotNull String[] params) {
         List<String> list = Arrays.asList(params);
         if (!list.contains(Strings.EMPTY_STRING)) {
             return params;


Reply via email to