aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenedikt Ritter <britter@apache.org>2017-08-30 19:22:35 +0000
committerBenedikt Ritter <britter@apache.org>2017-08-30 19:22:35 +0000
commitefc4809b7b73febc18cdd8976ff8e9d6d4537ade (patch)
tree999338e14ffcad39bbf8c946e7bf44597c385512 /src
parentd6fbb3d57fe2a1722d2c123f74dca83174f81358 (diff)
downloadapache-commons-bcel-efc4809b7b73febc18cdd8976ff8e9d6d4537ade.tar.gz
BCEL-283: Support for StackMap should be different from StackMapTable. Thanks to Mark Roberts
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/bcel/trunk@1806724 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/changes/changes.xml1
-rw-r--r--src/main/java/org/apache/bcel/classfile/Attribute.java7
2 files changed, 7 insertions, 1 deletions
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 863a0b0b..7cc9f6a8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -63,6 +63,7 @@ The <action> type attribute can be add,update,fix,remove.
<body>
<release version="6.1" date="tba" description="tba">
+ <action issue="BCEL-283" type="fix" dev="britter" due-to="Mark Roberts">Support for StackMap should be different from StackMapTable</action>
<action issue="BCEL-289" type="fix" dev="kinow">Crash when parsing constructor of inner classes with parameters annotated</action>
<action issue="BCEL-276" type="fix" dev="britter" due-to="Sam Yoon">LocalVariableTypeTable is not updated.</action>
<action issue="BCEL-277" type="fix" dev="britter" due-to="Sam Yoon">Resolving the String representation of a constant throws NoSuchElementException in case of CONSTANT_NameAndType constant.</action>
diff --git a/src/main/java/org/apache/bcel/classfile/Attribute.java b/src/main/java/org/apache/bcel/classfile/Attribute.java
index 1a2dbdd3..9b5e2a67 100644
--- a/src/main/java/org/apache/bcel/classfile/Attribute.java
+++ b/src/main/java/org/apache/bcel/classfile/Attribute.java
@@ -235,7 +235,10 @@ public abstract class Attribute implements Cloneable, Node {
case Const.ATTR_SIGNATURE:
return new Signature(name_index, length, file, constant_pool);
case Const.ATTR_STACK_MAP:
- return new StackMap(name_index, length, file, constant_pool);
+ // old style stack map: unneeded for JDK5 and below;
+ // illegal(?) for JDK6 and above. So just delete with a warning.
+ System.err.println("Warning: Obsolete StackMap attribute ignored.");
+ return new Unknown(name_index, length, file, constant_pool);
case Const.ATTR_RUNTIME_VISIBLE_ANNOTATIONS:
return new RuntimeVisibleAnnotations(name_index, length, file, constant_pool);
case Const.ATTR_RUNTIME_INVISIBLE_ANNOTATIONS:
@@ -251,6 +254,8 @@ public abstract class Attribute implements Cloneable, Node {
case Const.ATTR_ENCLOSING_METHOD:
return new EnclosingMethod(name_index, length, file, constant_pool);
case Const.ATTR_STACK_MAP_TABLE:
+ // read new style stack map: StackMapTable. The rest of the code
+ // calls this a StackMap for historical reasons.
return new StackMap(name_index, length, file, constant_pool);
case Const.ATTR_BOOTSTRAP_METHODS:
return new BootstrapMethods(name_index, length, file, constant_pool);