directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1771656 - /directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/
Date Sun, 27 Nov 2016 22:17:38 GMT
Author: elecharny
Date: Sun Nov 27 22:17:38 2016
New Revision: 1771656

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

Modified:
    directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/AttributeTypeHolder.java
    directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/ObjectClassHolder.java
    directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/Schema.java
    directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaElementImpl.java
    directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java
    directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaToLdif.java

Modified: directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/AttributeTypeHolder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/AttributeTypeHolder.java?rev=1771656&r1=1771655&r2=1771656&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/AttributeTypeHolder.java
(original)
+++ directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/AttributeTypeHolder.java
Sun Nov 27 22:17:38 2016
@@ -306,6 +306,7 @@ public class AttributeTypeHolder extends
      * @return A ldif formatted string
      * @throws org.apache.directory.api.ldap.model.exception.LdapException If something went
wrong
      */
+    @Override
     public String toLdif( String schemaName ) throws LdapException
     {
         StringBuilder sb = new StringBuilder();
@@ -385,6 +386,7 @@ public class AttributeTypeHolder extends
     /**
      * @return a String representing this AttributeType.
      */
+    @Override
     public String toString()
     {
         return getOid();
@@ -397,6 +399,7 @@ public class AttributeTypeHolder extends
      * @param schemaName The schema name
      * @return the Dn associated with this schema in the DIT
      */
+    @Override
     public String dnToLdif( String schemaName ) throws LdapException
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/ObjectClassHolder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/ObjectClassHolder.java?rev=1771656&r1=1771655&r2=1771656&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/ObjectClassHolder.java
(original)
+++ directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/ObjectClassHolder.java
Sun Nov 27 22:17:38 2016
@@ -41,13 +41,13 @@ import org.apache.directory.api.ldap.mod
 public class ObjectClassHolder extends SchemaElementImpl
 {
     /** The list of superiors */
-    private List<String> superiors = new ArrayList<String>();
+    private List<String> superiors = new ArrayList<>();
 
     /** The list of mandatory attributes */
-    private List<String> must = new ArrayList<String>();
+    private List<String> must = new ArrayList<>();
 
     /** The list of optional attributes */
-    private List<String> may = new ArrayList<String>();
+    private List<String> may = new ArrayList<>();
 
     /** The ObjectClass type */
     private ObjectClassTypeEnum classType = ObjectClassTypeEnum.STRUCTURAL;
@@ -148,6 +148,7 @@ public class ObjectClassHolder extends S
      * @return A ldif formatted string
      * @throws org.apache.directory.api.ldap.model.exception.LdapException If something went
wrong
      */
+    @Override
     public String toLdif( String schemaName ) throws LdapException
     {
         StringBuilder sb = new StringBuilder();
@@ -155,7 +156,7 @@ public class ObjectClassHolder extends S
         sb.append( schemaToLdif( schemaName, "metaObjectClass" ) );
 
         // The superiors
-        if ( superiors.size() != 0 )
+        if ( !superiors.isEmpty() )
         {
             for ( String superior : superiors )
             {
@@ -170,7 +171,7 @@ public class ObjectClassHolder extends S
         }
 
         // The 'must'
-        if ( must.size() != 0 )
+        if ( !must.isEmpty() )
         {
             for ( String attr : must )
             {
@@ -179,7 +180,7 @@ public class ObjectClassHolder extends S
         }
 
         // The 'may'
-        if ( may.size() != 0 )
+        if ( !may.isEmpty() )
         {
             for ( String attr : may )
             {
@@ -188,7 +189,7 @@ public class ObjectClassHolder extends S
         }
 
         // The extensions
-        if ( extensions.size() != 0 )
+        if ( !extensions.isEmpty() )
         {
             extensionsToLdif( "m-extensionObjectClass" );
         }
@@ -200,6 +201,7 @@ public class ObjectClassHolder extends S
     /**
      * @return a String representing this ObjectClass.
      */
+    @Override
     public String toString()
     {
         return getOid();
@@ -212,6 +214,7 @@ public class ObjectClassHolder extends S
      * @param schemaName The schema name
      * @return the Dn associated with this schema in the DIT
      */
+    @Override
     public String dnToLdif( String schemaName ) throws LdapException
     {
         StringBuilder sb = new StringBuilder();

Modified: directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/Schema.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/Schema.java?rev=1771656&r1=1771655&r2=1771656&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/Schema.java
(original)
+++ directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/Schema.java
Sun Nov 27 22:17:38 2016
@@ -107,6 +107,7 @@ public class Schema
     /**
      * @see Object#toString()
      */
+    @Override
     public String toString()
     {
         return "Schema " + name + ".schema";

Modified: directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaElementImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaElementImpl.java?rev=1771656&r1=1771655&r2=1771656&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaElementImpl.java
(original)
+++ directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaElementImpl.java
Sun Nov 27 22:17:38 2016
@@ -50,18 +50,19 @@ public abstract class SchemaElementImpl
     protected String description;
 
     /** The list of names for this schemaElements */
-    protected List<String> names = new ArrayList<String>();
+    protected List<String> names = new ArrayList<>();
 
     /** The obsolete flag */
     protected boolean obsolete = false;
 
     /** The optional list of extensions */
-    protected Map<String, List<String>> extensions = new HashMap<String, List<String>>();
+    protected Map<String, List<String>> extensions = new HashMap<>();
 
 
     /**
      * {@inheritDoc}
      */
+    @Override
     public boolean isObsolete()
     {
         return obsolete;
@@ -71,6 +72,7 @@ public abstract class SchemaElementImpl
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setObsolete( boolean obsolete )
     {
         this.obsolete = obsolete;
@@ -80,6 +82,7 @@ public abstract class SchemaElementImpl
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getOid()
     {
         return oid;
@@ -89,6 +92,7 @@ public abstract class SchemaElementImpl
     /**
      * {@inheritDoc}
      */
+    @Override
     public String getDescription()
     {
         return description;
@@ -98,6 +102,7 @@ public abstract class SchemaElementImpl
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setDescription( String description )
     {
         this.description = description;
@@ -107,6 +112,7 @@ public abstract class SchemaElementImpl
     /**
      * @see SchemaElement#getNames()
      */
+    @Override
     public List<String> getNames()
     {
         return names;
@@ -116,6 +122,7 @@ public abstract class SchemaElementImpl
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setNames( List<String> names )
     {
         this.names = names;
@@ -125,6 +132,7 @@ public abstract class SchemaElementImpl
     /**
      * {@inheritDoc}
      */
+    @Override
     public List<String> getExtension( String key )
     {
         return extensions.get( key );
@@ -134,6 +142,7 @@ public abstract class SchemaElementImpl
     /**
      * {@inheritDoc}
      */
+    @Override
     public Map<String, List<String>> getExtensions()
     {
         return extensions;
@@ -143,6 +152,7 @@ public abstract class SchemaElementImpl
     /**
      * {@inheritDoc}
      */
+    @Override
     public void setExtensions( Map<String, List<String>> extensions )
     {
         this.extensions = extensions;
@@ -164,7 +174,7 @@ public abstract class SchemaElementImpl
      */
     private String nameToLdif() throws LdapException
     {
-        if ( names.size() == 0 )
+        if ( names.isEmpty() )
         {
             return "";
         }

Modified: directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java?rev=1771656&r1=1771655&r2=1771656&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java
(original)
+++ directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaParser.java
Sun Nov 27 22:17:38 2016
@@ -208,6 +208,7 @@ public class SchemaParser
         /**
          * {@inheritDoc}
          */
+        @Override
         public void run()
         {
             int count = -1;

Modified: directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaToLdif.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaToLdif.java?rev=1771656&r1=1771655&r2=1771656&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaToLdif.java
(original)
+++ directory/shared/branches/shared-value/ldap/schema/converter/src/main/java/org/apache/directory/api/ldap/schema/converter/SchemaToLdif.java
Sun Nov 27 22:17:38 2016
@@ -74,7 +74,7 @@ public final class SchemaToLdif
     public static void transform( List<Schema> schemas ) throws ParserException
     {
         // Bypass if no schemas have yet been defined 
-        if ( ( schemas == null ) || ( schemas.size() == 0 ) )
+        if ( ( schemas == null ) || schemas.isEmpty() )
         {
             LOG.warn( "No schemas defined!" );
             return;



Mime
View raw message