directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r531071 - in /directory/sandbox/adc/asn1-compiler: ./ asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/codegen/ asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/parser/ asn1-gen-c/ asn1-gen-cplus/ asn1-gen-csharp/ asn1...
Date Sat, 21 Apr 2007 18:02:44 GMT
Author: adc
Date: Sat Apr 21 11:02:43 2007
New Revision: 531071

URL: http://svn.apache.org/viewvc?view=rev&rev=531071
Log:
Removing dust bunnies...

Modified:
    directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/codegen/CodeGeneratorStage.java
    directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/parser/ParseStage.java
    directory/sandbox/adc/asn1-compiler/asn1-gen-c/pom.xml
    directory/sandbox/adc/asn1-compiler/asn1-gen-cplus/pom.xml
    directory/sandbox/adc/asn1-compiler/asn1-gen-csharp/pom.xml
    directory/sandbox/adc/asn1-compiler/asn1-gen-java/pom.xml
    directory/sandbox/adc/asn1-compiler/asn1-runtime/pom.xml
    directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/EncodingFactory.java
    directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/ASN1ObjectIdentifierEncoder.java
    directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/Util.java
    directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/runtime/ASN1ObjectIdentifier.java
    directory/sandbox/adc/asn1-compiler/pom.xml

Modified: directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/codegen/CodeGeneratorStage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/codegen/CodeGeneratorStage.java?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/codegen/CodeGeneratorStage.java
(original)
+++ directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/codegen/CodeGeneratorStage.java
Sat Apr 21 11:02:43 2007
@@ -25,25 +25,26 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Vector;
+import java.util.logging.Logger;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.exception.ParseErrorException;
-import org.apache.asn1.compiler.stages.parser.Environment;
 import org.apache.asn1.compiler.stages.ProcessException;
 import org.apache.asn1.compiler.stages.Stage;
+import org.apache.asn1.compiler.stages.parser.Environment;
 import org.apache.asn1.compiler.stages.parser.ParseStage;
 import org.apache.asn1.compiler.stages.parser.x680.Module;
 import org.apache.asn1.compiler.stages.parser.x680.TypeReference;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.exception.ParseErrorException;
+
 
 /**
  * @version $Revision$ $Date: $
  */
 public class CodeGeneratorStage implements Stage
 {
-    private static Log log = LogFactory.getLog( CodeGeneratorStage.class );
+    private final static String className = CodeGeneratorStage.class.toString();
+    private final static Logger log = Logger.getLogger( className );
     public static final String ROOT_PACKAGE = "org.apache.asn1.compiler.stages.codegen.ROOT_PACKAGE";
     public static final String DESTINATION_PATH = "org.apache.asn1.compiler.stages.codegen.DESTINATION_PATH";
 
@@ -52,7 +53,7 @@
 
     public void process( Map environment ) throws ProcessException
     {
-        log.trace( "Code generation stage processing begun" );
+        log.entering( className, "process", environment );
 
 
         try
@@ -86,7 +87,7 @@
         }
         finally
         {
-            log.trace( "Code generation stage processing complete" );
+            log.exiting( className, "process" );
         }
     }
 

Modified: directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/parser/ParseStage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/parser/ParseStage.java?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/parser/ParseStage.java
(original)
+++ directory/sandbox/adc/asn1-compiler/asn1-compiler/src/main/java/org/apache/asn1/compiler/stages/parser/ParseStage.java
Sat Apr 21 11:02:43 2007
@@ -21,11 +21,10 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Map;
+import java.util.logging.Logger;
 import antlr.RecognitionException;
 import antlr.TokenStreamException;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.asn1.compiler.parser.ASN1Lexer;
 import org.apache.asn1.compiler.parser.ASN1Parser;
 import org.apache.asn1.compiler.stages.ProcessException;
@@ -37,14 +36,15 @@
  */
 public class ParseStage implements Stage
 {
-    private static Log log = LogFactory.getLog(ParseStage.class);
+    private final static String className = ParseStage.class.toString();
+    private final static Logger log = Logger.getLogger( className );
 
     public static final String SRC_URI = "org.apache.asn1.compiler.stages.parser.SRC_URI";
     public static final String ENVIRONMENT = "org.apache.asn1.compiler.stages.parser.ENVIRONMENT";
 
     public void process( Map environment ) throws ProcessException
     {
-        log.trace( "Parse stage processing begun");
+        log.entering( className, "process", environment );
 
         try
         {
@@ -54,27 +54,27 @@
         }
         catch ( URISyntaxException e )
         {
-            throw new ProcessException("SRC_URI is invalid", e);
+            throw new ProcessException( "SRC_URI is invalid", e );
         }
         catch ( MalformedURLException e )
         {
-            throw new ProcessException("SRC_URI is invalid", e);
+            throw new ProcessException( "SRC_URI is invalid", e );
         }
         catch ( IOException e )
         {
-            throw new ProcessException("SRC_URI is invalid", e);
+            throw new ProcessException( "SRC_URI is invalid", e );
         }
         catch ( TokenStreamException e )
         {
-            throw new ProcessException("SRC_URI is invalid", e);
+            throw new ProcessException( "SRC_URI is invalid", e );
         }
         catch ( RecognitionException e )
         {
-            throw new ProcessException("SRC_URI is invalid", e);
+            throw new ProcessException( "SRC_URI is invalid", e );
         }
         finally
         {
-            log.trace( "Parse stage processing complete");
+            log.exiting( className, "process" );
         }
     }
 }

Modified: directory/sandbox/adc/asn1-compiler/asn1-gen-c/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-gen-c/pom.xml?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-gen-c/pom.xml (original)
+++ directory/sandbox/adc/asn1-compiler/asn1-gen-c/pom.xml Sat Apr 21 11:02:43 2007
@@ -20,16 +20,6 @@
       <artifactId>asn1-compiler</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-
   </dependencies>
 
   <reporting>

Modified: directory/sandbox/adc/asn1-compiler/asn1-gen-cplus/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-gen-cplus/pom.xml?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-gen-cplus/pom.xml (original)
+++ directory/sandbox/adc/asn1-compiler/asn1-gen-cplus/pom.xml Sat Apr 21 11:02:43 2007
@@ -20,16 +20,6 @@
       <artifactId>asn1-compiler</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-
   </dependencies>
 
   <reporting>

Modified: directory/sandbox/adc/asn1-compiler/asn1-gen-csharp/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-gen-csharp/pom.xml?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-gen-csharp/pom.xml (original)
+++ directory/sandbox/adc/asn1-compiler/asn1-gen-csharp/pom.xml Sat Apr 21 11:02:43 2007
@@ -20,16 +20,6 @@
       <artifactId>asn1-compiler</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-
   </dependencies>
 
   <reporting>

Modified: directory/sandbox/adc/asn1-compiler/asn1-gen-java/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-gen-java/pom.xml?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-gen-java/pom.xml (original)
+++ directory/sandbox/adc/asn1-compiler/asn1-gen-java/pom.xml Sat Apr 21 11:02:43 2007
@@ -20,16 +20,6 @@
       <artifactId>asn1-compiler</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-
   </dependencies>
 
   <reporting>

Modified: directory/sandbox/adc/asn1-compiler/asn1-runtime/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-runtime/pom.xml?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-runtime/pom.xml (original)
+++ directory/sandbox/adc/asn1-compiler/asn1-runtime/pom.xml Sat Apr 21 11:02:43 2007
@@ -25,16 +25,6 @@
       <artifactId>commons-lang</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-    </dependency>
-
   </dependencies>
 
   <reporting>

Modified: directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/EncodingFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/EncodingFactory.java?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/EncodingFactory.java
(original)
+++ directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/EncodingFactory.java
Sat Apr 21 11:02:43 2007
@@ -18,8 +18,8 @@
 
 import java.util.Hashtable;
 import java.util.Map;
-
-import org.apache.log4j.Logger;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 
 /**
@@ -27,7 +27,7 @@
  */
 abstract public class EncodingFactory
 {
-    private final static Logger log = Logger.getLogger( EncodingFactory.class );
+    private final static Logger log = Logger.getLogger( EncodingFactory.class.toString()
);
     private final static Map factories = new Hashtable();
     private final static Map encoders = new Hashtable();
     private final static Map decoders = new Hashtable();
@@ -39,9 +39,9 @@
 
     abstract protected Decoder obtainDecoder( Class type );
 
-    static final public Encoder getEncoder( String encoding, Class type )
+    static public Encoder getEncoder( String encoding, Class type )
     {
-        if ( log.isDebugEnabled() ) log.debug( "Looking for encoder for " + encoding );
+        if ( log.isLoggable( Level.FINEST ) ) log.finest( "Looking for encoder for " + encoding
);
 
         Map map = (Map) encoders.get( encoding );
         if ( map == null )
@@ -62,13 +62,14 @@
             }
         }
 
-        if ( log.isDebugEnabled() && result != null ) log.debug( "Found encoder for
" + encoding );
+        if ( log.isLoggable( Level.FINEST ) ) log.finest( "Found encoder for " + encoding
);
+
         return result;
     }
 
-    static final public Decoder getDecoder( String encoding, Class type )
+    static public Decoder getDecoder( String encoding, Class type )
     {
-        if ( log.isDebugEnabled() ) log.debug( "Looking for decoder for " + encoding );
+        if ( log.isLoggable( Level.FINEST ) ) log.finest( "Looking for decoder for " + encoding
);
 
         Map map = (Map) decoders.get( encoding );
         if ( map == null )
@@ -89,15 +90,15 @@
             }
         }
 
-        if ( log.isDebugEnabled() && result != null ) log.debug( "Found decoder for
" + encoding );
+        if ( log.isLoggable( Level.FINEST ) ) log.finest( "Found decoder for " + encoding
);
         return result;
     }
 
-    static final public void register( EncodingFactory factory )
+    static public void register( EncodingFactory factory )
     {
         factories.put( factory.getEncoding(), factory );
         if ( encoders.containsKey( factory.getEncoding() ) ) ( (Map) encoders.get( factory.getEncoding()
) ).clear();
         if ( decoders.containsKey( factory.getEncoding() ) ) ( (Map) decoders.get( factory.getEncoding()
) ).clear();
-        if ( log.isInfoEnabled() ) log.info( "Registered encoding factory for " + factory.getEncoding()
);
+        if ( log.isLoggable( Level.CONFIG ) ) log.config( "Registered encoding factory for
" + factory.getEncoding() );
     }
 }

Modified: directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/ASN1ObjectIdentifierEncoder.java
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/ASN1ObjectIdentifierEncoder.java?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/ASN1ObjectIdentifierEncoder.java
(original)
+++ directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/ASN1ObjectIdentifierEncoder.java
Sat Apr 21 11:02:43 2007
@@ -27,15 +27,10 @@
 /**
  * @version $Revision$ $Date: $
  */
-public class ASN1ObjectIdentifierEncoder implements BEREncoder
+public abstract class ASN1ObjectIdentifierEncoder implements BEREncoder
 {
     public void encode( OutputStream stream, ASN1Type object ) throws EncoderException
     {
-        if ( !( object instanceof ASN1ObjectIdentifier ) )
-        {
-            throw new EncoderException( "Object not instance of ASN1ObjectIdentifier" );
-        }
-
         ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) object;
 
         if ( !oid.isConsistent() )
@@ -48,11 +43,6 @@
 
     public int length( int tagNumber, ASN1Type object ) throws EncoderException
     {
-        if ( !( object instanceof ASN1ObjectIdentifier ) )
-        {
-            throw new EncoderException( "Object not instance of ASN1ObjectIdentifier" );
-        }
-
         ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) object;
 
         int length = 0;

Modified: directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/Util.java
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/Util.java?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/Util.java
(original)
+++ directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/encoding/ber/Util.java
Sat Apr 21 11:02:43 2007
@@ -21,7 +21,7 @@
  *
  * @version $Revision$ $Date: $
  */
-public class Util
+public final class Util
 {
     /**
      * Increment the length, given the current length and increment.
@@ -47,7 +47,7 @@
      * then the calculated length is also less than zero.
      *
      * @param length
-     * @return
+     * @return total length
      */
     public static int calculateLength( int tag, int length )
     {
@@ -109,5 +109,9 @@
         result += length;
 
         return result;
+    }
+
+    private Util()
+    {
     }
 }

Modified: directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/runtime/ASN1ObjectIdentifier.java
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/runtime/ASN1ObjectIdentifier.java?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/runtime/ASN1ObjectIdentifier.java
(original)
+++ directory/sandbox/adc/asn1-compiler/asn1-runtime/src/main/java/org/apache/asn1/runtime/ASN1ObjectIdentifier.java
Sat Apr 21 11:02:43 2007
@@ -24,7 +24,7 @@
  */
 public class ASN1ObjectIdentifier implements ASN1Type
 {
-    private int id[];
+    private final int id[];
 
     public ASN1ObjectIdentifier( ASN1ObjectIdentifier oid )
     {

Modified: directory/sandbox/adc/asn1-compiler/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/adc/asn1-compiler/pom.xml?view=diff&rev=531071&r1=531070&r2=531071
==============================================================================
--- directory/sandbox/adc/asn1-compiler/pom.xml (original)
+++ directory/sandbox/adc/asn1-compiler/pom.xml Sat Apr 21 11:02:43 2007
@@ -184,12 +184,6 @@
       </dependency>
 
       <dependency>
-        <groupId>commons-logging</groupId>
-        <artifactId>commons-logging</artifactId>
-        <version>1.0.3</version>
-      </dependency>
-
-      <dependency>
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
         <version>1.2.8</version>



Mime
View raw message