Author: markt Date: Sat Nov 9 21:42:51 2013 New Revision: 1540409 URL: http://svn.apache.org/r1540409 Log: Remove Unknown. Swallow associated values as they are never used.
Removed: tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile/Unknown.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=1540409&r1=1540408&r2=1540409&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:42:51 2013 @@ -26,7 +26,7 @@ import org.apache.tomcat.util.bcel.Const /** * Abstract super class for <em>Attribute</em> objects. Currently the * <em>ConstantValue</em>, <em>SourceFile</em>, <em>Code</em>, - * <em>Exceptiontable</em>, <em>LineNumberTable</em>, + * <em>ExceptionTable</em>, <em>LineNumberTable</em>, * <em>LocalVariableTable</em>, <em>InnerClasses</em> and * <em>Synthetic</em> attributes are supported. The <em>Unknown</em> * attribute stands for non-standard-attributes. @@ -36,7 +36,6 @@ import org.apache.tomcat.util.bcel.Const * @see ConstantValue * @see SourceFile * @see Code - * @see Unknown * @see ExceptionTable * @see LineNumberTable * @see LocalVariableTable @@ -103,7 +102,8 @@ public abstract class Attribute implemen switch (tag) { case Constants.ATTR_UNKNOWN: - return new Unknown(name_index, length, file, constant_pool); + Utility.swallowUnknownAttribute(file, length); + return null; case Constants.ATTR_CONSTANT_VALUE: return new ConstantValue(name_index, length, file, constant_pool); case Constants.ATTR_SOURCE_FILE: 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=1540409&r1=1540408&r2=1540409&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:42:51 2013 @@ -151,4 +151,11 @@ final class Utility { "Invalid frame type found while parsing stack map table: " + frame_type); } } + + static void swallowUnknownAttribute(DataInput file, int length) throws IOException { + if (length > 0) { + byte[] bytes = new byte[length]; + file.readFully(bytes); + } + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org