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 2013/11/09 22:38:56 UTC

svn commit: r1540403 - in /tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile: Attribute.java StackMap.java StackMapTable.java Utility.java

Author: markt
Date: Sat Nov  9 21:38:56 2013
New Revision: 1540403

URL: http://svn.apache.org/r1540403
Log:
Remove StackMap and StackMapTable.
Swallow associated values as they are never used.

Removed:
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMap.java
    tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/StackMapTable.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=1540403&r1=1540402&r2=1540403&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 Sat Nov  9 21:38:56 2013
@@ -128,7 +128,8 @@ public abstract class Attribute implemen
         case Constants.ATTR_SIGNATURE:
             return new Signature(name_index, length, file, constant_pool);
         case Constants.ATTR_STACK_MAP:
-            return new StackMap(name_index, length, file, constant_pool);
+            Utility.swallowStackMap(file);
+            return null;
         case Constants.ATTR_RUNTIME_VISIBLE_ANNOTATIONS:
             return new RuntimeVisibleAnnotations(name_index, length, file,
                     constant_pool);
@@ -150,7 +151,8 @@ public abstract class Attribute implemen
         case Constants.ATTR_ENCLOSING_METHOD:
             return new EnclosingMethod(name_index, length, file, constant_pool);
         case Constants.ATTR_STACK_MAP_TABLE:
-            return new StackMapTable(name_index, length, file, constant_pool);
+            Utility.swallowStackMapTable(file);
+            return null;
         default: // Never reached
             throw new IllegalStateException("Unrecognized attribute type tag parsed: " + tag);
         }

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=1540403&r1=1540402&r2=1540403&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 Sat Nov  9 21:38:56 2013
@@ -121,6 +121,20 @@ public abstract class Utility {
         file.readUnsignedShort();   // Unused index
     }
 
+    protected static void swallowStackMap(DataInput file) throws IOException {
+        int map_length = file.readUnsignedShort();
+        for (int i = 0; i < map_length; i++) {
+            Utility.swallowStackMapEntry(file);
+        }
+    }
+
+    protected static void swallowStackMapTable(DataInputStream file) throws IOException {
+        int map_length = file.readUnsignedShort();
+        for (int i = 0; i < map_length; i++) {
+            Utility.swallowStackMapTableEntry(file);
+        }
+    }
+
     protected static void swallowStackMapType(DataInput file) throws IOException {
         byte type = file.readByte();
         if ((type < Constants.ITEM_Bogus) || (type > Constants.ITEM_NewObject)) {



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