directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1003915 - in /directory/shared/trunk: dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ ldap-client-api/src/main/java/org/apache/directory/ldap/clien...
Date Sat, 02 Oct 2010 23:34:30 GMT
Author: elecharny
Date: Sat Oct  2 23:34:29 2010
New Revision: 1003915

URL: http://svn.apache.org/viewvc?rev=1003915&view=rev
Log:
Fixed some Findbugs errors

Modified:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlStates.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
Sat Oct  2 23:34:29 2010
@@ -26,6 +26,7 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
+import org.apache.directory.shared.ldap.util.StringTools;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
 import org.dom4j.QName;
@@ -106,7 +107,7 @@ public class ExtendedResponseDsml extend
             }
             else
             {
-                element.addElement( "response" ).addText( response.toString() );
+                element.addElement( "response" ).addText( StringTools.utf8ToString( (byte[])response
) );
             }
         }
 

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
Sat Oct  2 23:34:29 2010
@@ -2271,19 +2271,9 @@ public final class Dsmlv2Grammar extends
         {
             SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
-            Filter parent = searchRequest.getCurrentFilter().getParent();
+            Filter filter = searchRequest.getCurrentFilter().getParent();
 
-            if ( parent instanceof Filter )
-            {
-                Filter filter = ( Filter ) parent;
-
-                searchRequest.setCurrentFilter( filter );
-            }
-            else
-            {
-                searchRequest.setFilter( searchRequest.getFilter() );
-                searchRequest.setCurrentFilter( null );
-            }
+            searchRequest.setCurrentFilter( filter );
         }
     };
 

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
(original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/future/ResponseFuture.java
Sat Oct  2 23:34:29 2010
@@ -115,7 +115,7 @@ public class ResponseFuture<R extends Re
      * {@inheritDoc}
      * @throws InterruptedException if the operation has been cancelled by client
      */
-    public synchronized void set( R response ) throws InterruptedException, ExecutionException
+    public void set( R response ) throws InterruptedException, ExecutionException
     {
         queue.add( response );
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
Sat Oct  2 23:34:29 2010
@@ -3234,21 +3234,22 @@ public class LdapMessageGrammar extends 
                     {
                         byte[] responseNameBytes = tlv.getValue().getData();
 
-                        try
+                        String oidStr = StringTools.utf8ToString( responseNameBytes );
+
+                        if ( OID.isOID( oidStr ) )
                         {
-                            String oidStr = StringTools.utf8ToString( responseNameBytes );
-                            OID oid = new OID( oidStr );
+                            OID.isOID( oidStr );
                             intermediateResponse.setResponseName( oidStr );
                         }
-                        catch ( DecoderException de )
+                        else
                         {
                             String msg = "The Intermediate Response name is not a valid OID
: "
                                 + StringTools.utf8ToString( responseNameBytes ) + " ("
                                 + StringTools.dumpBytes( responseNameBytes ) + ") is invalid";
-                            log.error( "{} : {}", msg, de.getMessage() );
+                            log.error( "{} : {}", msg, oidStr );
 
                             // Rethrow the exception, we will get a PROTOCOL_ERROR
-                            throw de;
+                            throw new DecoderException( msg );
                         }
                     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlStates.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlStates.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlStates.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlStates.java
Sat Oct  2 23:34:29 2010
@@ -45,7 +45,7 @@ public class PasswordPolicyResponseContr
 
     private static PasswordPolicyResponseControlStates instance = new PasswordPolicyResponseControlStates();
 
-    public static final String[] ppolicyStateString = new String[]
+    private static final String[] PPOLICY_STATE_STRING = new String[]
         { 
           "START_STATE",
           "PPOLICY_TIME_BEFORE_EXPIRATION_STATE",
@@ -98,7 +98,6 @@ public class PasswordPolicyResponseContr
      */
     public String getState( int state )
     {
-        return ( ( state == GRAMMAR_END ) ? "PASSWORD_POLICY_RESPONSE_CONTROL_GRAMMAR" :
ppolicyStateString[state] );
+        return ( ( state == GRAMMAR_END ) ? "PASSWORD_POLICY_RESPONSE_CONTROL_GRAMMAR" :
PPOLICY_STATE_STRING[state] );
     }
-
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java
Sat Oct  2 23:34:29 2010
@@ -49,7 +49,7 @@ public final class SyncDoneValueControlS
     public static final int LAST_SYNC_DONE_VALUE_STATE = 4;
 
     /** A string representation of all the states */
-    public static final String[] SYNC_DONE_VALUE_STRING = new String[]
+    private static final String[] SYNC_DONE_VALUE_STRING = new String[]
        {
            "START_STATE",
            "SYNC_DONE_VALUE_SEQUENCE_STATE",

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/name/DN.java
Sat Oct  2 23:34:29 2010
@@ -1362,7 +1362,7 @@ public class DN implements Cloneable, Se
     {
         if ( obj instanceof String )
         {
-            return normName.equals( obj );
+            return normName.equals( (String)obj );
         }
         else if ( obj instanceof DN )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxChecker.java
Sat Oct  2 23:34:29 2010
@@ -45,7 +45,7 @@ public class ACIItemSyntaxChecker extend
     private static final long serialVersionUID = 1L;
 
     /** An instance of ACI Item Checker */
-    private static ACIItemChecker ACI_ITEM_CHECKER;
+    private ACIItemChecker ACI_ITEM_CHECKER;
 
     /**
      * Creates a new instance of ACIItemSyntaxChecker

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java?rev=1003915&r1=1003914&r2=1003915&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/SubtreeSpecificationSyntaxChecker.java
Sat Oct  2 23:34:29 2010
@@ -46,7 +46,7 @@ public class SubtreeSpecificationSyntaxC
     private static final long serialVersionUID = 1L;
 
     /** The associated checker */ 
-    private static SubtreeSpecificationChecker SUBTREE_SPECIFICATION_CHECKER;
+    private SubtreeSpecificationChecker SUBTREE_SPECIFICATION_CHECKER;
 
     /**
      * Creates an instance of SubtreeSpecificationSyntaxChecker



Mime
View raw message