directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r945412 - in /directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif: LdifEntry.java LdifReader.java LdifRevertor.java
Date Mon, 17 May 2010 22:55:52 GMT
Author: elecharny
Date: Mon May 17 22:55:52 2010
New Revision: 945412

URL: http://svn.apache.org/viewvc?rev=945412&view=rev
Log:
Fixed some PMD reports

Modified:
    directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java
    directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
    directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java

Modified: directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java?rev=945412&r1=945411&r2=945412&view=diff
==============================================================================
--- directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java
(original)
+++ directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifEntry.java
Mon May 17 22:55:52 2010
@@ -43,7 +43,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
-import org.apache.directory.shared.ldap.util.StringTools;
 
 
 /**
@@ -555,93 +554,6 @@ public class LdifEntry implements Clonea
 
         return clone;
     }
-    
-    /**
-     * Dumps the attributes
-     * @return A String representing the attributes
-     */
-    private String dumpAttributes()
-    {
-        StringBuffer sb = new StringBuffer();
-        
-        for ( EntryAttribute attribute:entry )
-        {
-            if ( attribute == null )
-            {
-                sb.append( "        Null attribute\n" );
-                continue;
-            }
-            
-            sb.append( "        ").append( attribute.getId() ).append( ":\n" );
-            
-            for ( Value<?> value:attribute )
-            {
-                if ( !value.isBinary() )
-                {
-                    sb.append(  "            " ).append( value.getString() ).append('\n'
);
-                }
-                else
-                {
-                    sb.append(  "            " ).append( StringTools.dumpBytes( value.getBytes()
) ).append('\n' );
-                }
-            }
-        }
-        
-        return sb.toString();
-    }
-    
-    /**
-     * Dumps the modifications
-     * @return A String representing the modifications
-     */
-    private String dumpModificationItems()
-    {
-        StringBuffer sb = new StringBuffer();
-        
-        for ( Modification modif:modificationList )
-        {
-            sb.append( "            Operation: " );
-            
-            switch ( modif.getOperation() )
-            {
-                case ADD_ATTRIBUTE :
-                    sb.append( "ADD\n" );
-                    break;
-                    
-                case REMOVE_ATTRIBUTE :
-                    sb.append( "REMOVE\n" );
-                    break;
-                    
-                case REPLACE_ATTRIBUTE :
-                    sb.append( "REPLACE \n" );
-                    break;
-                    
-                default :
-                    break; // Do nothing
-            }
-            
-            EntryAttribute attribute = modif.getAttribute();
-            
-            sb.append( "                Attribute: " ).append( attribute.getId() ).append(
'\n' );
-            
-            if ( attribute.size() != 0 )
-            {
-                for ( Value<?> value:attribute )
-                {
-                    if ( !value.isBinary() )
-                    {
-                        sb.append(  "                " ).append( value.getString() ).append('\n'
);
-                    }
-                    else
-                    {
-                        sb.append(  "                " ).append( StringTools.dumpBytes( value.getBytes()
) ).append('\n' );
-                    }
-                }
-            }
-        }
-        
-        return sb.toString();
-    }
 
     
     /**

Modified: directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java?rev=945412&r1=945411&r2=945412&view=diff
==============================================================================
--- directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
(original)
+++ directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
Mon May 17 22:55:52 2010
@@ -850,6 +850,7 @@ public class LdifReader implements Itera
             else if ( StringTools.isCharASCII( controlValue, criticalPos + 1, '<' ) )
             {
                 // File contained value
+                // TODO : Add the missing code
             }
             else
             {

Modified: directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java?rev=945412&r1=945411&r2=945412&view=diff
==============================================================================
--- directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java
(original)
+++ directory/shared/trunk/ldap-ldif/src/main/java/org/apache/directory/shared/ldap/ldif/LdifRevertor.java
Mon May 17 22:55:52 2010
@@ -288,7 +288,7 @@ public class LdifRevertor
     /**
      * A small helper class to compute the simple revert.
      */
-    private static LdifEntry revertEntry( List<LdifEntry> entries, Entry entry, DN
newDn, 
+    private static LdifEntry revertEntry( Entry entry, DN newDn, 
         DN newSuperior, RDN oldRdn, RDN newRdn ) throws LdapInvalidDnException
     {
         LdifEntry reverted = new LdifEntry();
@@ -468,8 +468,7 @@ public class LdifRevertor
                 throw new LdapInvalidDnException( I18n.err( I18n.ERR_12080 ) ); 
             }
 
-            reverted =
-                revertEntry( entries, entry, newDn, newSuperior, oldRdn, newRdn );
+            reverted = revertEntry( entry, newDn, newSuperior, oldRdn, newRdn );
 
             entries.add( reverted );
         }



Mime
View raw message