tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1624647 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java java/org/apache/tomcat/util/bcel/classfile/ClassParser.java test/org/apache/tomcat/util/bcel/TesterPerformance.java
Date Fri, 12 Sep 2014 21:04:37 GMT
Author: kkolinko
Date: Fri Sep 12 21:04:36 2014
New Revision: 1624647

URL: http://svn.apache.org/r1624647
Log:
Remove class_name argument from constructor, as Tomcat does not provide the name.

Modified:
    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
    tomcat/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1624647&r1=1624646&r2=1624647&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Fri Sep 12 21:04:36 2014
@@ -1982,7 +1982,7 @@ public class ContextConfig implements Li
             boolean handlesTypesOnly)
             throws ClassFormatException, IOException {
 
-        ClassParser parser = new ClassParser(is, null);
+        ClassParser parser = new ClassParser(is);
         JavaClass clazz = parser.parse();
         checkHandlesTypes(clazz);
 
@@ -2142,7 +2142,7 @@ public class ContextConfig implements Li
                 if (is == null) {
                     return;
                 }
-                ClassParser parser = new ClassParser(is, null);
+                ClassParser parser = new ClassParser(is);
                 JavaClass clazz = parser.parse();
                 populateJavaClassCache(clazz.getClassName(), clazz);
             } catch (ClassFormatException e) {

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java?rev=1624647&r1=1624646&r2=1624647&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/ClassParser.java Fri Sep 12 21:04:36
2014
@@ -43,7 +43,6 @@ public final class ClassParser {
     private static final int MAGIC = 0xCAFEBABE;
 
     private final DataInputStream file;
-    private final String file_name;
     private String class_name, superclass_name;
     private int access_flags; // Access rights of parsed class
     private String[] interface_names; // Names of implemented interfaces
@@ -57,10 +56,8 @@ public final class ClassParser {
      * Parse class from the given stream.
      *
      * @param file Input stream
-     * @param file_name File name
      */
-    public ClassParser(InputStream file, String file_name) {
-        this.file_name = file_name;
+    public ClassParser(InputStream file) {
         if (file instanceof DataInputStream) {
             this.file = (DataInputStream) file;
         } else {
@@ -158,7 +155,7 @@ public final class ClassParser {
         }
         if (((access_flags & Constants.ACC_ABSTRACT) != 0)
                 && ((access_flags & Constants.ACC_FINAL) != 0)) {
-            throw new ClassFormatException("Class " + file_name + " can't be both final and
abstract");
+            throw new ClassFormatException("Class can't be both final and abstract");
         }
 
         int class_name_index = file.readUnsignedShort();
@@ -206,7 +203,7 @@ public final class ClassParser {
      */
     private void readID() throws IOException, ClassFormatException {
         if (file.readInt() != MAGIC) {
-            throw new ClassFormatException(file_name + " is not a Java .class file");
+            throw new ClassFormatException("It is not a Java .class file");
         }
     }
 

Modified: tomcat/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java?rev=1624647&r1=1624646&r2=1624647&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java (original)
+++ tomcat/trunk/test/org/apache/tomcat/util/bcel/TesterPerformance.java Fri Sep 12 21:04:36
2014
@@ -58,7 +58,7 @@ public class TesterPerformance {
                 if (jarEntryName.endsWith(".class")) {
                     InputStream is = jar.getEntryInputStream();
                     long start = System.nanoTime();
-                    ClassParser cp = new ClassParser(is, jarEntryName);
+                    ClassParser cp = new ClassParser(is);
                     cp.parse();
                     duration += System.nanoTime() - start;
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message