directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r575340 - in /directory/shared/trunk/ldap/src/main: antlr/ java/org/apache/directory/shared/ldap/ldif/ java/org/apache/directory/shared/ldap/subtree/
Date Thu, 13 Sep 2007 16:04:12 GMT
Author: elecharny
Date: Thu Sep 13 09:04:11 2007
New Revision: 575340

URL: http://svn.apache.org/viewvc?rev=575340&view=rev
Log:
Removed warnings by using generics, cleaning the antlr .g files from useless imports, removed
useless casts.

Modified:
    directory/shared/trunk/ldap/src/main/antlr/SubtreeSpecificationChecker.g
    directory/shared/trunk/ldap/src/main/antlr/TriggerSpecification.g
    directory/shared/trunk/ldap/src/main/antlr/filter-parser.g
    directory/shared/trunk/ldap/src/main/antlr/filter-value-parser.g
    directory/shared/trunk/ldap/src/main/antlr/schema-extension.g
    directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g
    directory/shared/trunk/ldap/src/main/antlr/schema-value.g
    directory/shared/trunk/ldap/src/main/antlr/schema.g
    directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java

Modified: directory/shared/trunk/ldap/src/main/antlr/SubtreeSpecificationChecker.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/SubtreeSpecificationChecker.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/SubtreeSpecificationChecker.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/SubtreeSpecificationChecker.g Thu Sep 13 09:04:11
2007
@@ -23,13 +23,7 @@
 
 package org.apache.directory.shared.ldap.subtree;
 
-import java.util.Set;
-import java.util.Map;
-import java.util.HashSet;
-import java.util.ArrayList;
-
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.FilterParserImpl;
 import org.apache.directory.shared.ldap.util.ComponentsMonitor;
 import org.apache.directory.shared.ldap.util.OptionalComponentsMonitor;

Modified: directory/shared/trunk/ldap/src/main/antlr/TriggerSpecification.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/TriggerSpecification.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/TriggerSpecification.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/TriggerSpecification.g Thu Sep 13 09:04:11
2007
@@ -23,7 +23,6 @@
 
 package org.apache.directory.shared.ldap.trigger;
 
-import javax.naming.NamingException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -73,7 +72,6 @@
     private static final Logger log = LoggerFactory.getLogger( AntlrTriggerSpecificationParser.class
);
     
     private NormalizerMappingResolver resolver;
-    private boolean isNormalizing = false;
     
     private ActionTime triggerActionTime;
     
@@ -98,7 +96,6 @@
     public void setNormalizerMappingResolver( NormalizerMappingResolver resolver )
     {
         this.resolver = resolver;
-        this.isNormalizing = true;
     }
 }
 

Modified: directory/shared/trunk/ldap/src/main/antlr/filter-parser.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/filter-parser.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/filter-parser.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/filter-parser.g Thu Sep 13 09:04:11 2007
@@ -25,8 +25,11 @@
 package org.apache.directory.shared.ldap.filter;
 
 
-import antlr.*;
+import antlr.TokenStreamSelector;
+
+import java.util.List;
 import java.util.ArrayList;
+
 import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.filter.AssertionEnum;
 }
@@ -113,20 +116,6 @@
     {
         this.monitor = monitor;
     }
-
-
-    /**
-     * Monitors FilterParser events where it matches a production.
-     *
-     * @param production the name of the production matched
-     */
-    private void matchedProduction( String production )
-    {
-        if ( this.monitor != null )
-        {
-            this.monitor.matchedProduction( production );
-        }
-    }
 }
 
 // ----------------------------------------------------------------------------
@@ -171,7 +160,7 @@
 {
     node = null;
     ExprNode child;
-    ArrayList children = new ArrayList();
+    List<ExprNode> children = new ArrayList<ExprNode>();
 }
     :
     AMPERSTAND child=filter
@@ -196,7 +185,7 @@
 {
     node = null;
     ExprNode child;
-    ArrayList children = new ArrayList();
+    List<ExprNode> children = new ArrayList<ExprNode>();
 }
     :
     VERTBAR child=filter

Modified: directory/shared/trunk/ldap/src/main/antlr/filter-value-parser.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/filter-value-parser.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/filter-value-parser.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/filter-value-parser.g Thu Sep 13 09:04:11 2007
@@ -24,9 +24,11 @@
  */
 package org.apache.directory.shared.ldap.filter;
 
+import antlr.TokenStreamSelector;
+
+import java.util.List;
+import java.util.ArrayList;
 
-import antlr.*;
-import java.util.*;
 }
 
 
@@ -103,20 +105,6 @@
     {
         this.monitor = monitor;
     }
-
-
-    /**
-     * Monitors FilterParser events where it matches a production.
-     *
-     * @param production the name of the production matched
-     */
-    private void matchedProduction( String production )
-    {
-        if ( this.monitor != null )
-        {
-            this.monitor.matchedProduction( production );
-        }
-    }
 }
 
 
@@ -177,7 +165,7 @@
     node = null;
     String initial = null;
     String fin = null;
-    ArrayList any = new ArrayList();
+    List<String> any = new ArrayList<String>();
 }
     :
     (

Modified: directory/shared/trunk/ldap/src/main/antlr/schema-extension.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/schema-extension.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/schema-extension.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/schema-extension.g Thu Sep 13 09:04:11 2007
@@ -20,8 +20,8 @@
  */
 package org.apache.directory.shared.ldap.schema.syntax;
 
-import java.io.* ;
-import java.util.* ;
+import java.io.StringReader;
+import java.util.List;
 
 }
 

Modified: directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/schema-qdstring.g Thu Sep 13 09:04:11 2007
@@ -20,7 +20,8 @@
  */
 package org.apache.directory.shared.ldap.schema.syntax;
 
-import java.util.* ;
+import java.util.ArrayList;
+import java.util.List;
 
 }
 

Modified: directory/shared/trunk/ldap/src/main/antlr/schema-value.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/schema-value.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/schema-value.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/schema-value.g Thu Sep 13 09:04:11 2007
@@ -20,7 +20,8 @@
  */
 package org.apache.directory.shared.ldap.schema.syntax;
 
-import java.util.* ;
+import java.util.List;
+import java.util.ArrayList;
 
 }
 

Modified: directory/shared/trunk/ldap/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/schema.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/schema.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/schema.g Thu Sep 13 09:04:11 2007
@@ -20,8 +20,12 @@
  */
 package org.apache.directory.shared.ldap.schema.syntax;
 
-import java.io.* ;
-import java.util.* ;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 

Modified: directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g (original)
+++ directory/shared/trunk/ldap/src/main/antlr/subtree-specification.g Thu Sep 13 09:04:11
2007
@@ -26,6 +26,7 @@
 import java.util.Set;
 import java.util.Map;
 import java.util.HashSet;
+import java.util.List;
 import java.util.ArrayList;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -33,12 +34,12 @@
 import org.apache.directory.shared.ldap.filter.LeafNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.filter.BranchNode;
-import org.apache.directory.shared.ldap.filter.AbstractExprNode;
 import org.apache.directory.shared.ldap.filter.AssertionEnum;
 import org.apache.directory.shared.ldap.filter.FilterParserImpl;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationModifier;
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
+import org.apache.directory.shared.ldap.schema.OidNormalizer;
 import org.apache.directory.shared.ldap.util.ComponentsMonitor;
 import org.apache.directory.shared.ldap.util.OptionalComponentsMonitor;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -84,19 +85,19 @@
     
     private NormalizerMappingResolver resolver;
     
-    private Set chopBeforeExclusions = null;
-    private Set chopAfterExclusions = null;
+    private Set<LdapDN> chopBeforeExclusions = null;
+    private Set<LdapDN> chopAfterExclusions = null;
 
     private SubtreeSpecificationModifier ssModifier = null;
     
-    private Map oidsMap;
+    private Map<String, OidNormalizer> oidsMap;
     
     private ComponentsMonitor subtreeSpecificationComponentsMonitor = null;
 
     /**
      * Does nothing.
      */
-    public void init( Map oidsMap )
+    public void init( Map<String, OidNormalizer> oidsMap )
     {
     	this.oidsMap = oidsMap;
     }
@@ -160,8 +161,8 @@
     ssModifier = new SubtreeSpecificationModifier();
     subtreeSpecificationComponentsMonitor = new OptionalComponentsMonitor( 
             new String [] { "base", "specificExclusions", "minimum", "maximum", "specificationFilter"
} );
-    chopBeforeExclusions = new HashSet();
-    chopAfterExclusions = new HashSet();
+    chopBeforeExclusions = new HashSet<LdapDN>();
+    chopAfterExclusions = new HashSet<LdapDN>();
     // always create a new filter parser in case we may have some statefulness problems with
it
     filterParser = new FilterParserImpl();
 }
@@ -316,7 +317,7 @@
     ;
     
     
-filter returns [ ExprNode filterExpr = null; ]
+filter returns [ ExprNode filterExpr = null ]
 {
 	log.debug( "entered filter()" );
 }
@@ -338,10 +339,12 @@
     token:SAFEUTF8STRING
     {
         name = new LdapDN( token.getText() );
+        
         if ( isNormalizing() )
         {
         	name.normalize( oidsMap );
         }
+        
         log.debug( "recognized a DistinguishedName: " + token.getText() );
     }
     ;
@@ -391,12 +394,12 @@
 {
     log.debug( "entered item()" );
     node = null;
-    String l_oid = null;
+    String oid = null;
 }
     :
-    ID_item ( SP )* COLON ( SP )* l_oid=oid
+    ID_item ( SP )* COLON ( SP )* oid=oid
     {
-        node = new SimpleNode( SchemaConstants.OBJECT_CLASS_AT , l_oid , AssertionEnum.EQUALITY
);
+        node = new SimpleNode( SchemaConstants.OBJECT_CLASS_AT , oid , AssertionEnum.EQUALITY
);
     }
     ;
 
@@ -404,7 +407,7 @@
 {
     log.debug( "entered and()" );
     node = null;
-    ArrayList children = null; 
+    List<ExprNode> children = null; 
 }
     :
     ID_and ( SP )* COLON ( SP )* children=refinements
@@ -417,7 +420,7 @@
 {
     log.debug( "entered or()" );
     node = null;
-    ArrayList children = null; 
+    List<ExprNode> children = null; 
 }
     :
     ID_or ( SP )* COLON ( SP )* children=refinements
@@ -430,7 +433,7 @@
 {
     log.debug( "entered not()" );
     node = null;
-    ArrayList children = null;
+    List<ExprNode> children = null;
 }
     :
     ID_not ( SP )* COLON ( SP )* children=refinements
@@ -439,12 +442,12 @@
     }
     ;
 
-refinements returns [ ArrayList children ]
+refinements returns [ List<ExprNode> children ]
 {
     log.debug( "entered refinements()" );
     children = null;
     ExprNode child = null;
-    ArrayList tempChildren = new ArrayList();
+    List<ExprNode> tempChildren = new ArrayList<ExprNode>();
 }
     :
     OPEN_CURLY ( SP )*

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/ldif/LdifReader.java
Thu Sep 13 09:04:11 2007
@@ -1692,7 +1692,7 @@
         // When done, get the entries one by one.
         while ( hasNext() )
         {
-            Entry entry = (Entry) next();
+            Entry entry = next();
 
             if ( error != null )
             {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java?rev=575340&r1=575339&r2=575340&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/subtree/SubtreeSpecificationParser.java
Thu Sep 13 09:04:11 2007
@@ -26,6 +26,7 @@
 import java.util.Map;
 
 import org.apache.directory.shared.ldap.schema.NormalizerMappingResolver;
+import org.apache.directory.shared.ldap.schema.OidNormalizer;
 
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
@@ -55,7 +56,7 @@
     /**
      * Creates a subtree specification parser.
      */
-    public SubtreeSpecificationParser( Map oidsMap )
+    public SubtreeSpecificationParser( Map<String, OidNormalizer> oidsMap )
     {
         StringReader in = new StringReader( "" ); // place holder for the
                                                     // first input
@@ -70,7 +71,7 @@
     /**
      * Creates a normalizing subtree specification parser.
      */
-    public SubtreeSpecificationParser( NormalizerMappingResolver resolver, Map oidsMap  )
+    public SubtreeSpecificationParser( NormalizerMappingResolver resolver, Map<String,
OidNormalizer> oidsMap  )
     {
         StringReader in = new StringReader( "" ); // place holder for the
                                                     // first input



Mime
View raw message