directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r945440 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap: codec/controls/replication/syncDoneValue/ codec/controls/replication/syncInfoValue/ codec/controls/replication/syncRequestValue/ codec/controls/replic...
Date Mon, 17 May 2010 23:52:06 GMT
Author: elecharny
Date: Mon May 17 23:52:05 2010
New Revision: 945440

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

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteRequestImpl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/SearchResultEntryCodec.java
Mon May 17 23:52:05 2010
@@ -178,7 +178,7 @@ public class SearchResultEntryCodec exte
      * @param type The attribute's name
      */
     // This will suppress PMD.EmptyCatchBlock warnings in this method
-    @SuppressWarnings("PMD.EmptyCatchBlock")
+    @SuppressWarnings( "PMD.EmptyCatchBlock" )
     public void addAttributeValues( String type )
     {
         currentAttributeValue = new DefaultEntryAttribute( type );
@@ -384,20 +384,17 @@ public class SearchResultEntryCodec exte
                     int localValuesLength = valsLength.get( attributeNumber );
                     buffer.put( TLV.getBytes( localValuesLength ) );
 
-                    if ( attribute.size() != 0 )
+                    if ( attribute.size() > 0 )
                     {
-                        if ( attribute.size() > 0 )
+                        for ( org.apache.directory.shared.ldap.entry.Value<?> value
: attribute )
                         {
-                            for ( org.apache.directory.shared.ldap.entry.Value<?> value
: attribute )
+                            if ( !value.isBinary() )
+                            {
+                                Value.encode( buffer, value.getString() );
+                            }
+                            else
                             {
-                                if ( !value.isBinary() )
-                                {
-                                    Value.encode( buffer, value.getString() );
-                                }
-                                else
-                                {
-                                    Value.encode( buffer, value.getBytes() );
-                                }
+                                Value.encode( buffer, value.getBytes() );
                             }
                         }
                     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesControlDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesControlDecoder.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesControlDecoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesControlDecoder.java
Mon May 17 23:52:05 2010
@@ -22,8 +22,6 @@ package org.apache.directory.shared.ldap
 
 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;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/entry/StringValue.java
Mon May 17 23:52:05 2010
@@ -507,13 +507,10 @@ public class StringValue extends Abstrac
         // Read the isNormalized flag
         normalized = in.readBoolean();
         
-        if ( normalized )
+        if ( ( normalized ) && ( in.readBoolean() ) )
         {
             // Read the normalized value, if not null
-            if ( in.readBoolean() )
-            {
-                normalizedValue = in.readUTF();
-            }
+            normalizedValue = in.readUTF();
         }
         
         h = 0;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/filter/SubstringNode.java
Mon May 17 23:52:05 2010
@@ -26,7 +26,6 @@ import java.util.regex.Pattern;
 
 import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -200,8 +199,6 @@ public class SubstringNode extends LeafN
      */
     public final Pattern getRegex( Normalizer normalizer ) throws LdapException
     {
-        boolean isBinary = false;
-        
         if ( ( anyPattern != null ) && ( anyPattern.size() > 0 ) )
         {
             String[] any = new String[anyPattern.size()];

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/CompareRequestImpl.java
Mon May 17 23:52:05 2010
@@ -227,12 +227,9 @@ public class CompareRequestImpl extends 
             return false;
         }
 
-        if ( ( name != null ) && ( reqName != null ) )
+        if ( ( name != null ) && ( reqName != null ) && !name.equals( req.getName()
) )
         {
-            if ( !name.equals( req.getName() ) )
-            {
-                return false;
-            }
+            return false;
         }
 
         String reqId = req.getAttributeId();
@@ -247,12 +244,9 @@ public class CompareRequestImpl extends 
             return false;
         }
 
-        if ( ( attrId != null ) && ( reqId != null ) )
+        if ( ( attrId != null ) && ( reqId != null ) && !attrId.equals( reqId
) )
         {
-            if ( !attrId.equals( reqId ) )
-            {
-                return false;
-            }
+            return false;
         }
 
         Value<?> reqVal = req.getAssertionValue();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteRequestImpl.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteRequestImpl.java
Mon May 17 23:52:05 2010
@@ -155,12 +155,9 @@ public class DeleteRequestImpl extends A
             return false;
         }
 
-        if ( name != null && req.getName() != null )
+        if ( ( name != null ) && ( req.getName() != null ) && !name.equals(
req.getName() ) )
         {
-            if ( !name.equals( req.getName() ) )
-            {
-                return false;
-            }
+            return false;
         }
 
         return true;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java?rev=945440&r1=945439&r2=945440&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ExtendedRequestImpl.java
Mon May 17 23:52:05 2010
@@ -191,40 +191,35 @@ public class ExtendedRequestImpl extends
         }
 
         InternalExtendedRequest req = ( InternalExtendedRequest ) obj;
-        if ( oid != null && req.getOid() == null )
+        
+        if ( ( oid != null ) && ( req.getOid() == null ) )
         {
             return false;
         }
 
-        if ( oid == null && req.getOid() != null )
+        if ( ( oid == null ) && ( req.getOid() != null ) )
         {
             return false;
         }
 
-        if ( oid != null && req.getOid() != null )
+        if ( ( oid != null ) && ( req.getOid() != null ) &&  !oid.equals(
req.getOid() ) )
         {
-            if ( !oid.equals( req.getOid() ) )
-            {
-                return false;
-            }
+            return false;
         }
 
-        if ( payload != null && req.getPayload() == null )
+        if ( ( payload != null ) && ( req.getPayload() == null ) )
         {
             return false;
         }
 
-        if ( payload == null && req.getPayload() != null )
+        if ( ( payload == null ) && ( req.getPayload() != null ) )
         {
             return false;
         }
 
-        if ( payload != null && req.getPayload() != null )
+        if ( ( payload != null ) && ( req.getPayload() != null ) && !Arrays.equals(
payload, req.getPayload() ) )
         {
-            if ( !Arrays.equals( payload, req.getPayload() ) )
-            {
-                return false;
-            }
+            return false;
         }
 
         return true;



Mime
View raw message