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/10 22:59:31 UTC
svn commit: r1624129 - in
/tomcat/trunk/java/org/apache/tomcat/util/bcel/classfile: Attribute.java
Utility.java
Author: markt
Date: Wed Sep 10 20:59:30 2014
New Revision: 1624129
URL: http://svn.apache.org/r1624129
Log:
Fail fast
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=1624129&r1=1624128&r2=1624129&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 Wed Sep 10 20:59:30 2014
@@ -115,10 +115,10 @@ public abstract class Attribute implemen
Utility.swallowInnerClasses(file);
return null;
case Constants.ATTR_SYNTHETIC:
- Utility.swallowSynthetic(file, length);
+ Utility.swallowSynthetic(length);
return null;
case Constants.ATTR_DEPRECATED:
- Utility.swallowDeprecated(file, length);
+ Utility.swallowDeprecated(length);
return null;
case Constants.ATTR_PMG:
return new PMGClass(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=1624129&r1=1624128&r2=1624129&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 Wed Sep 10 20:59:30 2014
@@ -162,10 +162,8 @@ final class Utility {
file.readUnsignedShort(); // Unused signature_index
}
- static void swallowSynthetic(DataInput file, int length) throws IOException {
+ static void swallowSynthetic(int length) {
if (length > 0) {
- byte[] bytes = new byte[length];
- file.readFully(bytes);
throw new ClassFormatException("Synthetic attribute with length > 0");
}
}
@@ -247,10 +245,8 @@ final class Utility {
}
}
- static void swallowDeprecated(DataInput file, int length) throws IOException {
+ static void swallowDeprecated(int length) {
if (length > 0) {
- byte[] bytes = new byte[length];
- file.readFully(bytes);
throw new ClassFormatException("Deprecated attribute with length > 0");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org