You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/09/11 10:20:30 UTC

svn commit: r1624220 - in /tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile: Attribute.java RuntimeInvisibleAnnotations.java RuntimeInvisibleParameterAnnotations.java Utility.java

Author: markt
Date: Thu Sep 11 08:20:30 2014
New Revision: 1624220

URL: http://svn.apache.org/r1624220
Log:
Remove unused code (RuntimeInvisible[Parameter]Annotations)

Removed:
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleAnnotations.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/RuntimeInvisibleParameterAnnotations.java
Modified:
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java?rev=1624220&r1=1624219&r2=1624220&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java Thu Sep 11 08:20:30 2014
@@ -133,14 +133,14 @@ public abstract class Attribute implemen
             return new RuntimeVisibleAnnotations(name_index, length, file,
                     constant_pool);
         case Constants.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS:
-            return new RuntimeInvisibleAnnotations(name_index, length, file,
-                    constant_pool);
+            Utility.swallowAnnotations(file, constant_pool);
+            return null;
         case Constants.ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS:
             return new RuntimeVisibleParameterAnnotations(name_index, length,
                     file, constant_pool);
         case Constants.ATTR_RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS:
-            return new RuntimeInvisibleParameterAnnotations(name_index, length,
-                    file, constant_pool);
+            Utility.swallowAnnotations(file, constant_pool);
+            return null;
         case Constants.ATTR_ANNOTATION_DEFAULT:
             return new AnnotationDefault(name_index, length, file,
                     constant_pool);

Modified: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=1624220&r1=1624219&r2=1624220&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java Thu Sep 11 08:20:30 2014
@@ -295,4 +295,12 @@ final class Utility {
         file.readUnsignedShort();   // Unused bootstrap_method_attr_index
         file.readUnsignedShort();   // Unused name_and_type_index
     }
+
+    static void swallowAnnotations(DataInputStream file, ConstantPool constant_pool)
+            throws IOException {
+        final int annotation_table_length = (file.readUnsignedShort());
+        for (int i = 0; i < annotation_table_length; i++) {
+            AnnotationEntry.read(file, constant_pool);
+        }
+    }
 }



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