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/12 14:48:22 UTC
svn commit: r1624527 - in /tomcat/tc7.0.x/trunk: ./
java/org/apache/tomcat/util/bcel/ java/org/apache/tomcat/util/bcel/classfile/
Author: markt
Date: Fri Sep 12 12:48:21 2014
New Revision: 1624527
URL: http://svn.apache.org/r1624527
Log:
Merge more simplification from trunk
Removed:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Synthetic.java
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1540411-1540413
Propchange: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/
------------------------------------------------------------------------------
Merged /tomcat/trunk/java/org/apache/tomcat/util/bcel:r1540411-1540413
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java?rev=1624527&r1=1624526&r2=1624527&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Attribute.java Fri Sep 12 12:48:21 2014
@@ -39,7 +39,6 @@ import org.apache.tomcat.util.bcel.Const
* @see LineNumberTable
* @see LocalVariableTable
* @see InnerClasses
- * @see Synthetic
* @see Deprecated
*/
public abstract class Attribute implements Cloneable, Serializable
@@ -118,7 +117,8 @@ public abstract class Attribute implemen
case Constants.ATTR_INNER_CLASSES:
return new InnerClasses(name_index, length, file, constant_pool);
case Constants.ATTR_SYNTHETIC:
- return new Synthetic(name_index, length, file, constant_pool);
+ Utility.swallowSynthetic(file, length);
+ return null;
case Constants.ATTR_DEPRECATED:
return new Deprecated(name_index, length, file, constant_pool);
case Constants.ATTR_PMG:
Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java?rev=1624527&r1=1624526&r2=1624527&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/bcel/classfile/Utility.java Fri Sep 12 12:48:21 2014
@@ -110,7 +110,7 @@ final class Utility {
static void swallowStackMapType(DataInput file) throws IOException {
byte type = file.readByte();
if ((type < Constants.ITEM_Bogus) || (type > Constants.ITEM_NewObject)) {
- throw new RuntimeException("Illegal type for StackMapType: " + type);
+ throw new ClassFormatException("Illegal type for StackMapType: " + type);
}
// Check to see if type has an index
if ((type == Constants.ITEM_Object) || (type == Constants.ITEM_NewObject)) {
@@ -180,4 +180,12 @@ final class Utility {
static void swallowSignature(DataInput file) throws IOException {
file.readUnsignedShort(); // Unused signature_index
}
+
+ static void swallowSynthetic(DataInput file, int length) throws IOException {
+ if (length > 0) {
+ byte[] bytes = new byte[length];
+ file.readFully(bytes);
+ throw new ClassFormatException("Synthetic attribute with length > 0");
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org