directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1771441 - in /directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci: ./ protectedItem/
Date Sat, 26 Nov 2016 09:04:55 GMT
Author: elecharny
Date: Sat Nov 26 09:04:55 2016
New Revision: 1771441

URL: http://svn.apache.org/viewvc?rev=1771441&view=rev
Log:
Fixed SonarLint warnings

Modified:
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItem.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemChecker.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemParser.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ItemFirstACIItem.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/Permission.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserFirstACIItem.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AttributeValueItem.java
    directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/RangeOfValuesItem.java

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItem.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItem.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItem.java
Sat Nov 26 09:04:55 2016
@@ -126,7 +126,7 @@ public abstract class ACIItem
      */
     protected static Collection<MicroOperation> toMicroOperations( Collection<GrantAndDenial>
grantsAndDenials )
     {
-        Set<MicroOperation> microOps = new HashSet<MicroOperation>();
+        Set<MicroOperation> microOps = new HashSet<>();
 
         for ( GrantAndDenial grantAndDenial : grantsAndDenials )
         {

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemChecker.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemChecker.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemChecker.java
Sat Nov 26 09:04:55 2016
@@ -26,6 +26,7 @@ import java.text.ParseException;
 
 import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.util.StringConstants;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -82,7 +83,7 @@ public class ACIItemChecker
      */
     public synchronized void parse( String spec ) throws ParseException
     {
-        if ( spec == null || spec.trim().equals( "" ) )
+        if ( spec == null || StringConstants.EMPTY .equals( spec.trim() ) )
         {
             return;
         }

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemParser.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemParser.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemParser.java
Sat Nov 26 09:04:55 2016
@@ -27,6 +27,7 @@ import java.text.ParseException;
 import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.model.schema.normalizers.NameComponentNormalizer;
+import org.apache.directory.api.util.StringConstants;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -112,9 +113,9 @@ public class ACIItemParser
      */
     public synchronized ACIItem parse( String spec ) throws ParseException
     {
-        ACIItem aCIItem = null;
+        ACIItem aCIItem;
 
-        if ( spec == null || spec.trim().equals( "" ) )
+        if ( spec == null || StringConstants.EMPTY .equals( spec.trim() ) )
         {
             return null;
         }

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ACIItemSyntaxChecker.java
Sat Nov 26 09:04:55 2016
@@ -43,7 +43,7 @@ public class ACIItemSyntaxChecker extend
     private static final Logger LOG = LoggerFactory.getLogger( ACIItemSyntaxChecker.class
);
 
     /** An instance of ACI Item Checker */
-    private ACIItemChecker aciItemChecker;
+    private transient ACIItemChecker aciItemChecker;
 
 
     /**
@@ -58,9 +58,10 @@ public class ACIItemSyntaxChecker extend
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isValidSyntax( Object value )
     {
-        String strValue = null;
+        String strValue;
 
         if ( value == null )
         {
@@ -108,6 +109,7 @@ public class ACIItemSyntaxChecker extend
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setSchemaManager( SchemaManager schemaManager )
     {
         aciItemChecker = new ACIItemChecker( schemaManager );

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ItemFirstACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ItemFirstACIItem.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ItemFirstACIItem.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/ItemFirstACIItem.java
Sat Nov 26 09:04:55 2016
@@ -147,9 +147,10 @@ public class ItemFirstACIItem extends AC
      * 
      * @return The list of created Tuples
      */
+    @Override
     public Collection<ACITuple> toTuples()
     {
-        Collection<ACITuple> tuples = new ArrayList<ACITuple>();
+        Collection<ACITuple> tuples = new ArrayList<>();
 
         for ( ItemPermission itemPermission : itemPermissions )
         {
@@ -159,13 +160,13 @@ public class ItemFirstACIItem extends AC
                 ? itemPermission.getPrecedence()
                 : this.getPrecedence();
 
-            if ( grants.size() > 0 )
+            if ( !grants.isEmpty() )
             {
                 tuples.add( new ACITuple( itemPermission.getUserClasses(), getAuthenticationLevel(),
protectedItems,
                     toMicroOperations( grants ), true, precedence ) );
             }
 
-            if ( denials.size() > 0 )
+            if ( !denials.isEmpty() )
             {
                 tuples.add( new ACITuple( itemPermission.getUserClasses(), getAuthenticationLevel(),
protectedItems,
                     toMicroOperations( denials ), false, precedence ) );

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/Permission.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/Permission.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/Permission.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/Permission.java
Sat Nov 26 09:04:55 2016
@@ -59,9 +59,9 @@ public abstract class Permission
     {
         this.precedence = precedence;
 
-        Set<GrantAndDenial> tmpGrantsAndDenials = new HashSet<GrantAndDenial>();
-        Set<GrantAndDenial> tmpGrants = new HashSet<GrantAndDenial>();
-        Set<GrantAndDenial> tmpDenials = new HashSet<GrantAndDenial>();
+        Set<GrantAndDenial> tmpGrantsAndDenials = new HashSet<>();
+        Set<GrantAndDenial> tmpGrants = new HashSet<>();
+        Set<GrantAndDenial> tmpDenials = new HashSet<>();
 
         for ( GrantAndDenial gad : grantsAndDenials )
         {

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserClass.java
Sat Nov 26 09:04:55 2016
@@ -232,6 +232,7 @@ public abstract class UserClass
         /**
          * {@inheritDoc}
          */
+        @Override
         public String toString()
         {
             StringBuilder buffer = new StringBuilder();

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserFirstACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserFirstACIItem.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserFirstACIItem.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/UserFirstACIItem.java
Sat Nov 26 09:04:55 2016
@@ -165,9 +165,10 @@ public class UserFirstACIItem extends AC
     /**
      * {@inheritDoc}
      */
+    @Override
     public Collection<ACITuple> toTuples()
     {
-        Collection<ACITuple> tuples = new ArrayList<ACITuple>();
+        Collection<ACITuple> tuples = new ArrayList<>();
 
         for ( UserPermission userPermission : userPermissions )
         {
@@ -177,12 +178,12 @@ public class UserFirstACIItem extends AC
                 ? userPermission.getPrecedence()
                 : this.getPrecedence();
 
-            if ( grants.size() > 0 )
+            if ( !grants.isEmpty() )
             {
                 tuples.add( new ACITuple( getUserClasses(), getAuthenticationLevel(), userPermission
                     .getProtectedItems(), toMicroOperations( grants ), true, precedence )
);
             }
-            if ( denials.size() > 0 )
+            if ( !denials.isEmpty() )
             {
                 tuples.add( new ACITuple( getUserClasses(), getAuthenticationLevel(), userPermission
                     .getProtectedItems(), toMicroOperations( denials ), false, precedence
) );

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AttributeValueItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AttributeValueItem.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AttributeValueItem.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AttributeValueItem.java
Sat Nov 26 09:04:55 2016
@@ -126,6 +126,7 @@ public class AttributeValueItem extends
     /**
      * {@inheritDoc}
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();

Modified: directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/RangeOfValuesItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/RangeOfValuesItem.java?rev=1771441&r1=1771440&r2=1771441&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/RangeOfValuesItem.java
(original)
+++ directory/shared/trunk/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/RangeOfValuesItem.java
Sat Nov 26 09:04:55 2016
@@ -107,6 +107,7 @@ public class RangeOfValuesItem extends P
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder buf = new StringBuilder();



Mime
View raw message