directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r572314 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap: aci/ codec/extended/operations/ codec/util/ message/extended/ util/
Date Mon, 03 Sep 2007 13:20:31 GMT
Author: elecharny
Date: Mon Sep  3 06:20:31 2007
New Revision: 572314

URL: http://svn.apache.org/viewvc?rev=572314&view=rev
Log:
Using Generics
Fixed some toString() methods
Removed some useless casts

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java?rev=572314&r1=572313&r2=572314&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemFirstACIItem.java
Mon Sep  3 06:20:31 2007
@@ -149,8 +149,6 @@
 
         for ( ProtectedItem item:protectedItems )
         {
-            item.printToBuffer( buffer );
-            
             if ( isFirst )
             {
                 isFirst = false;
@@ -159,6 +157,8 @@
             {
                 buffer.append( ", " );
             }
+
+            item.printToBuffer( buffer );
         }
 
         // itemPermissions
@@ -168,8 +168,6 @@
         
         for ( ItemPermission permission:itemPermissions )
         {
-            permission.printToBuffer( buffer );
-            
             if ( isFirst )
             {
                 isFirst = false;
@@ -178,6 +176,8 @@
             {
                 buffer.append( ", " );
             }
+
+            permission.printToBuffer( buffer );
         }
 
         buffer.append( " } } }" );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java?rev=572314&r1=572313&r2=572314&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ItemPermission.java
Mon Sep  3 06:20:31 2007
@@ -96,8 +96,6 @@
         
         for ( UserClass userClass:userClasses )
         {
-            userClass.printToBuffer( buffer );
-            
             if ( isFirst ) 
             {
                 isFirst = false;
@@ -106,6 +104,8 @@
             {
                 buffer.append( ", " );
             }
+
+            userClass.printToBuffer( buffer );
         }
         
         buffer.append( " }, grantsAndDenials { " );
@@ -114,8 +114,6 @@
         
         for ( GrantAndDenial grantAndDenial:getGrantsAndDenials() )
         {
-            grantAndDenial.printToBuffer( buffer );
-            
             if ( isFirst )
             {
                 isFirst = false;
@@ -124,6 +122,8 @@
             {
                 buffer.append( ", " );
             }
+
+            grantAndDenial.printToBuffer( buffer );
         }
         
         buffer.append( " } }" );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java?rev=572314&r1=572313&r2=572314&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
Mon Sep  3 06:20:31 2007
@@ -272,22 +272,24 @@
         
         public void printToBuffer( StringBuffer buffer )
         {
-            buffer.append( '{' );
-            buffer.append( ' ' );
+            buffer.append( "{ " );
+            boolean isFirst = true;
             
-            for ( Iterator<String> it = attributeTypes.iterator(); it.hasNext(); )
+            for ( String attributeType:attributeTypes )
             {
-                String attributeType = ( String ) it.next();
-                buffer.append( attributeType );
-                
-                if(it.hasNext()) {
-                    buffer.append( ',' );
-                    buffer.append( ' ' );
+                if ( isFirst ) 
+                {
+                    isFirst = false;
+                }
+                else
+                {
+                    buffer.append( ", " );
                 }
+
+                buffer.append( attributeType );
             }
             
-            buffer.append( ' ' );
-            buffer.append( '}' );
+            buffer.append( " }" );
         }
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java?rev=572314&r1=572313&r2=572314&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/GracefulShutdownDecoder.java
Mon Sep  3 06:20:31 2007
@@ -22,8 +22,6 @@
 
 import java.nio.ByteBuffer;
 
-import javax.naming.NamingException;
-
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -48,7 +46,7 @@
      * @return An GracefulShutdown object
      * @throws DecoderException If the decoding failed
      */
-    public Asn1Object decode( byte[] stream ) throws DecoderException, NamingException
+    public Asn1Object decode( byte[] stream ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( stream );
         GracefulShutdownContainer container = new GracefulShutdownContainer();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java?rev=572314&r1=572313&r2=572314&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/util/LdapURL.java
Mon Sep  3 06:20:31 2007
@@ -1218,7 +1218,6 @@
                 
                 for ( String attribute:attributes )
                 {
-
                     if ( isFirst )
                     {
                         isFirst = false;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java?rev=572314&r1=572313&r2=572314&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownRequest.java
Mon Sep  3 06:20:31 2007
@@ -104,11 +104,6 @@
             log.error( "failed to decode payload", e );
             throw new RuntimeException( e );
         }
-        catch ( NamingException e )
-        {
-            log.error( "failed to decode payload", e );
-            throw new RuntimeException( e );
-        }
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java?rev=572314&r1=572313&r2=572314&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/AttributeSerializerUtils.java
Mon Sep  3 06:20:31 2007
@@ -94,7 +94,7 @@
      * 
      * @see jdbm.helper.Serializer#deserialize(byte[])
      */
-    public static final Object deserialize( byte[] buf ) throws IOException
+    public static final Object deserialize( byte[] buf )
     {
         String id = readString( buf );
         AttributeImpl attr = new AttributeImpl( id );
@@ -131,7 +131,7 @@
      * 
      * @see jdbm.helper.Serializer#deserialize(byte[])
      */
-    public static final DeserializedAttribute deserialize( byte[] buf, int offset ) throws
IOException
+    public static final DeserializedAttribute deserialize( byte[] buf, int offset )
     {
         final String id = readString( buf, offset );
         final AttributeImpl attr = new AttributeImpl( id );



Mime
View raw message