directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1805749 - /directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/
Date Tue, 22 Aug 2017 10:19:33 GMT
Author: elecharny
Date: Tue Aug 22 10:19:32 2017
New Revision: 1805749

URL: http://svn.apache.org/viewvc?rev=1805749&view=rev
Log:
Fixed many Sonar lint warnings

Added:
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerComparator.java
      - copied, changed from r1805748, directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerSorter.java
Removed:
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerSorter.java
Modified:
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AllowFeatureDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthIdRewriteDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthzRegexpDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperLabelProvider.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DisallowFeatureDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DnDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsWrapper.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueWrapper.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/PasswordHashDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SaslSecPropsWrapper.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/ServerIdDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SizeLimitWrapper.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SsfDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/StringValueDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferDecorator.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferWrapper.java
    directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitDecorator.java

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AllowFeatureDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AllowFeatureDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AllowFeatureDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AllowFeatureDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,26 +45,26 @@ public class AllowFeatureDecorator exten
      * Construct the label for an AllowFeature.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof AllowFeatureEnum )
         {
-            String allowFeature = ( ( AllowFeatureEnum ) element ).toString();
-
-            return allowFeature;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthIdRewriteDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthIdRewriteDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthIdRewriteDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthIdRewriteDecorator.java
Tue Aug 22 10:19:32 2017
@@ -36,33 +36,33 @@ public class AuthIdRewriteDecorator exte
      */
     public AuthIdRewriteDecorator( Shell parentShell )
     {
-        //setDialog( new AuthIdRewriteDialog( parentShell ) );
+        // Nothing to do
     }
 
     /**
      * Construct the label for an AuthIdRewriteWrapper.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof AuthIdRewriteWrapper )
         {
-            String authIdRewrite = ( ( AuthIdRewriteWrapper ) element ).toString();
-
-            return authIdRewrite;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthzRegexpDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthzRegexpDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthzRegexpDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/AuthzRegexpDecorator.java
Tue Aug 22 10:19:32 2017
@@ -36,33 +36,33 @@ public class AuthzRegexpDecorator extend
      */
     public AuthzRegexpDecorator( Shell parentShell )
     {
-        //setDialog( new AuthzRegexpWrapperDialog( parentShell ) );
+        // Nothing to do
     }
 
     /**
      * Construct the label for an AuthIdRewriteWrapper.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof AuthzRegexpWrapper )
         {
-            String authzRegexp = ( ( AuthzRegexpWrapper ) element ).toString();
-
-            return authzRegexp;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperLabelProvider.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperLabelProvider.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperLabelProvider.java
Tue Aug 22 10:19:32 2017
@@ -85,7 +85,7 @@ public class DatabaseWrapperLabelProvide
         }
 
         return null;
-    };
+    }
     
     
     /**
@@ -168,7 +168,7 @@ public class DatabaseWrapperLabelProvide
         {
             List<Dn> suffixes = database.getOlcSuffix();
 
-            if ( ( suffixes != null ) && ( suffixes.size() > 0 ) )
+            if ( ( suffixes != null ) && !suffixes.isEmpty() )
             {
                 return suffixes.get( 0 ).toString();
             }

Copied: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerComparator.java
(from r1805748, directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerSorter.java)
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerComparator.java?p2=directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerComparator.java&p1=directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerSorter.java&r1=1805748&r2=1805749&rev=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerSorter.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DatabaseWrapperViewerComparator.java
Tue Aug 22 10:19:32 2017
@@ -22,15 +22,19 @@ package org.apache.directory.studio.open
 import org.apache.directory.studio.openldap.config.OpenLdapConfigurationPluginUtils;
 import org.apache.directory.studio.openldap.config.model.database.OlcDatabaseConfig;
 import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
 
 /**
  * This class defines a sorter for a database wrapper viewer.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DatabaseWrapperViewerSorter extends ViewerSorter
+public class DatabaseWrapperViewerComparator extends ViewerComparator
 {
+    /**
+     * {@inheritDoc}
+     */
+    @Override
     public int compare( Viewer viewer, Object e1, Object e2 )
     {
         if ( ( e1 instanceof DatabaseWrapper ) && ( e2 instanceof DatabaseWrapper
) )

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,17 +45,16 @@ public class DbIndexDecorator extends Ta
      * Construct the label for an DbIndex.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof DbIndexWrapper )
         {
-            String dbIndex = ( ( DbIndexWrapper ) element ).toString();
-
-            return dbIndex;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
@@ -63,10 +62,11 @@ public class DbIndexDecorator extends Ta
      * 
      * {@inheritDoc}
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DbIndexWrapper.java
Tue Aug 22 10:19:32 2017
@@ -19,7 +19,6 @@
  */
 package org.apache.directory.studio.openldap.config.editor.wrappers;
 
-import java.util.Comparator;
 import java.util.Iterator;
 import java.util.Set;
 import java.util.TreeSet;
@@ -47,10 +46,7 @@ public class DbIndexWrapper implements C
     private boolean isDefault;
 
     /** The set of configured attributes */
-    private Set<String> attributes = new TreeSet<String>( new Comparator<String>()
-        {
-            @Override
-            public int compare( String string1, String string2 )
+    private Set<String> attributes = new TreeSet<>( ( string1, string2 ) ->
             {
                 if ( string1 == null )
                 {
@@ -63,11 +59,10 @@ public class DbIndexWrapper implements C
 
                 return string1.compareTo( string2 );
             }
-        }
     );
     
     /** The set of configured attributes */
-    private Set<DbIndexTypeEnum> indexTypes = new TreeSet<DbIndexTypeEnum>();
+    private Set<DbIndexTypeEnum> indexTypes = new TreeSet<>();
         
     /**
      * Build a DbIndexWrapper from a String containing the description of the index.
@@ -101,11 +96,8 @@ public class DbIndexWrapper implements C
                 }
                 
                 // Check that it's a valid Attribute
-                //if ( SchemaUtils.isAttributeNameValid( attrStr ) )
-                {
-                    attributes.add( Strings.toLowerCase( attrStr ) );
-                    startPos = pos + 1;
-                }
+                attributes.add( Strings.toLowerCaseAscii( attrStr ) );
+                startPos = pos + 1;
             }
             
             if ( endAttributes )
@@ -218,11 +210,11 @@ public class DbIndexWrapper implements C
             DbIndexWrapper clone = (DbIndexWrapper)super.clone();
             
             // Clone the attributes 
-            clone.attributes = new TreeSet<String>();
+            clone.attributes = new TreeSet<>();
             clone.attributes.addAll( attributes );
             
             // Clone the indexTypes
-            clone.indexTypes = new TreeSet<DbIndexTypeEnum>();
+            clone.indexTypes = new TreeSet<>();
             clone.indexTypes.addAll( indexTypes );
             
             return clone;
@@ -310,7 +302,7 @@ public class DbIndexWrapper implements C
         // first, the Attribute, if it's not default
         if ( isDefault )
         {
-            if ( indexTypes.size() == 0 )
+            if ( indexTypes.isEmpty() )
             {
                 // No types either ? return a blank String
                 return "";
@@ -340,7 +332,7 @@ public class DbIndexWrapper implements C
         // A space before the indexTypes
         sb.append( ' ' );
         
-        if ( indexTypes.size() == 0 )
+        if ( indexTypes.isEmpty() )
         {
             // No type ? Use default
             sb.append( "default" );

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DisallowFeatureDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DisallowFeatureDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DisallowFeatureDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DisallowFeatureDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,26 +45,26 @@ public class DisallowFeatureDecorator ex
      * Construct the label for an DisallowFeature.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof DisallowFeatureEnum )
         {
-            String disallowFeature = ( ( DisallowFeatureEnum ) element ).toString();
-
-            return disallowFeature;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DnDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DnDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DnDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/DnDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,17 +45,16 @@ public class DnDecorator extends TableDe
      * Construct the label for an DisallowFeature.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof DisallowFeatureEnum )
         {
-            String disallowFeature = ( ( DisallowFeatureEnum ) element ).toString();
-
-            return disallowFeature;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
@@ -63,10 +62,11 @@ public class DnDecorator extends TableDe
      * 
      * {@inheritDoc}
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,22 +45,22 @@ public class LimitDecorator extends Tabl
      * Construct the label for a TimeLimit. It can be one of :
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof LimitWrapper )
         {
-            String limitText = ( ( LimitWrapper ) element ).toString();
-
-            return limitText;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none (may be we could add one for URLs ?)
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
@@ -72,5 +72,5 @@ public class LimitDecorator extends Tabl
     {
         // TODO Auto-generated method stub
         return 0;
-    };
+    }
 }

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,26 +45,26 @@ public class LimitsDecorator extends Tab
      * Construct the label for a Limit.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof LimitWrapper )
         {
-            String limitText = ( ( LimitWrapper ) element ).toString();
-
-            return limitText;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsWrapper.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsWrapper.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/LimitsWrapper.java
Tue Aug 22 10:19:32 2017
@@ -75,7 +75,7 @@ public class LimitsWrapper implements Cl
     private String attributeType;
     
     /** The list of limits, as Strings */
-    private List<LimitWrapper> limits = new ArrayList<LimitWrapper>();
+    private List<LimitWrapper> limits = new ArrayList<>();
     
     /** A flag to tell if the limits is valid or not */
     private boolean isValid = true;

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueDecorator.java
Tue Aug 22 10:19:32 2017
@@ -46,24 +46,26 @@ public class OrderedStringValueDecorator
      * Construct the label for a String.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof StringValueWrapper )
         {
-            return ( ( StringValueWrapper ) element ).toString();
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueWrapper.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueWrapper.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/OrderedStringValueWrapper.java
Tue Aug 22 10:19:32 2017
@@ -172,12 +172,9 @@ public class OrderedStringValueWrapper i
         {
             OrderedStringValueWrapper thatInstance = (OrderedStringValueWrapper)that;
             
-            if ( prefix != null )
+            if ( ( prefix != null ) && ( prefix != thatInstance.prefix ) )
             {
-                if ( prefix != thatInstance.prefix )
-                {
-                    return false;
-                }
+                return false;
             }
             
             if ( caseSensitive )

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/PasswordHashDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/PasswordHashDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/PasswordHashDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/PasswordHashDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,26 +45,26 @@ public class PasswordHashDecorator exten
      * Construct the label for a PasswordHash.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof PasswordHashEnum )
         {
-            String passwordHash = ( ( PasswordHashEnum ) element ).toString();
-
-            return passwordHash;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none (may be we could add one for URLs ?)
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RequireConditionDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,26 +45,26 @@ public class RequireConditionDecorator e
      * Construct the label for an RequireCondition.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof RequireConditionEnum )
         {
-            String requireCondition = ( ( RequireConditionEnum ) element ).toString();
-
-            return requireCondition;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/RestrictOperationDecorator.java
Tue Aug 22 10:19:32 2017
@@ -45,26 +45,26 @@ public class RestrictOperationDecorator
      * Construct the label for an RestrictOperation.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof RestrictOperationEnum )
         {
-            String restrictOperation = ( ( RestrictOperationEnum ) element ).toString();
-
-            return restrictOperation;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SaslSecPropsWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SaslSecPropsWrapper.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SaslSecPropsWrapper.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SaslSecPropsWrapper.java
Tue Aug 22 10:19:32 2017
@@ -36,7 +36,7 @@ import org.apache.directory.studio.openl
 public class SaslSecPropsWrapper implements Cloneable
 {
     /** The flags for properties with no arguments */
-    private Set<SaslSecPropEnum> flags = new HashSet<SaslSecPropEnum>();
+    private Set<SaslSecPropEnum> flags = new HashSet<>();
 
     /** The value of the minSSF parameter */
     private Integer minSsf;
@@ -108,7 +108,7 @@ public class SaslSecPropsWrapper impleme
                     
                     try
                     {
-                        int value = Integer.valueOf( Strings.trim( property.substring( pos
+ 1 ) ) );
+                        int value = Integer.parseInt( Strings.trim( property.substring( pos
+ 1 ) ) );
                         
                         if ( value >= 0 )
                         {
@@ -203,7 +203,7 @@ public class SaslSecPropsWrapper impleme
                     
                     try
                     {
-                        int value = Integer.valueOf( Strings.trim( property.substring( pos
+ 1 ) ) );
+                        int value = Integer.parseInt( Strings.trim( property.substring( pos
+ 1 ) ) );
                         
                         if ( value < 0 )
                         {

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/ServerIdDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/ServerIdDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/ServerIdDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/ServerIdDecorator.java
Tue Aug 22 10:19:32 2017
@@ -43,26 +43,26 @@ public class ServerIdDecorator extends T
     /**
      * Construct the label for a ServerID. It can be a number in [0..999], or an URL
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof ServerIdWrapper )
         {
-            String serverIdtext = ( ( ServerIdWrapper ) element ).toString();
-
-            return serverIdtext;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none (may be we could add one for URLs ?)
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SizeLimitWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SizeLimitWrapper.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SizeLimitWrapper.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SizeLimitWrapper.java
Tue Aug 22 10:19:32 2017
@@ -147,16 +147,13 @@ public class SizeLimitWrapper extends Ab
                                 {
                                     softLimit = tmp.softLimit;
                                     
-                                    if ( hardLimit != null )
+                                    if ( ( hardLimit != null ) && ( hardLimit.equals(
HARD_SOFT ) || hardLimit.equals( softLimit ) ) )
                                     {
-                                        if ( hardLimit.equals( HARD_SOFT ) || hardLimit.equals(
softLimit ) )
-                                        {
-                                            // Special case : we have had a size.hard=soft
before,
-                                            // or the hard and soft limit are equals : we
set the global limit
-                                            globalLimit = softLimit;
-                                            softLimit = null;
-                                            hardLimit = null;
-                                        }
+                                        // Special case : we have had a size.hard=soft before,
+                                        // or the hard and soft limit are equals : we set
the global limit
+                                        globalLimit = softLimit;
+                                        softLimit = null;
+                                        hardLimit = null;
                                     }
                                 }
                                 else if ( tmp.hardLimit != null )
@@ -215,6 +212,7 @@ public class SizeLimitWrapper extends Ab
     /**
      * Clear the SizeLimitWrapper (reset all the values to null)
      */
+    @Override
     public void clear()
     {
         super.clear();
@@ -670,6 +668,7 @@ public class SizeLimitWrapper extends Ab
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SsfDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SsfDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SsfDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/SsfDecorator.java
Tue Aug 22 10:19:32 2017
@@ -44,26 +44,26 @@ public class SsfDecorator extends TableD
      * Construct the label for a SSF. It can be one of :
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof SsfWrapper )
         {
-            String ssfText = ( ( SsfWrapper ) element ).toString();
-
-            return ssfText;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/StringValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/StringValueDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/StringValueDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/StringValueDecorator.java
Tue Aug 22 10:19:32 2017
@@ -60,6 +60,7 @@ public class StringValueDecorator extend
      * @param element the Element for which we want the value
      * @return a String representation of the element
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof StringValueWrapper )
@@ -68,7 +69,7 @@ public class StringValueDecorator extend
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
@@ -77,10 +78,11 @@ public class StringValueDecorator extend
      * @param element The element for which we want the image
      * @return The associated Image, or Null
      */
+    @Override
     public Image getImage( Object element )
     {
         return image;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferDecorator.java
Tue Aug 22 10:19:32 2017
@@ -44,26 +44,26 @@ public class TcpBufferDecorator extends
      * Construct the label for a TCPBuffer.
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof TcpBufferWrapper )
         {
-            String tcpBufferText = ( ( TcpBufferWrapper ) element ).toString();
-
-            return tcpBufferText;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none (may be we could add one for URLs ?)
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferWrapper.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferWrapper.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TcpBufferWrapper.java
Tue Aug 22 10:19:32 2017
@@ -240,7 +240,7 @@ public class TcpBufferWrapper implements
         {
             try
             {
-                long size = Long.valueOf( sizeStr );
+                long size = Long.parseLong( sizeStr );
             
                 if ( ( size < 0L ) || ( size > MAX_TCP_BUFFER_SIZE ) )
                 {

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitDecorator.java?rev=1805749&r1=1805748&r2=1805749&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitDecorator.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/wrappers/TimeLimitDecorator.java
Tue Aug 22 10:19:32 2017
@@ -44,26 +44,26 @@ public class TimeLimitDecorator extends
      * Construct the label for a TimeLimit. It can be one of :
      * 
      */
+    @Override
     public String getText( Object element )
     {
         if ( element instanceof TimeLimitWrapper )
         {
-            String timeLimitText = ( ( TimeLimitWrapper ) element ).toString();
-
-            return timeLimitText;
+            return element.toString();
         }
 
         return super.getText( element );
-    };
+    }
 
 
     /**
      * Get the image. We have none (may be we could add one for URLs ?)
      */
+    @Override
     public Image getImage( Object element )
     {
         return null;
-    };
+    }
 
     
     /**



Mime
View raw message