summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2018-08-07 14:13:40 -0400
committerStephan Herrmann2018-08-07 14:13:40 -0400
commit73901481c73753772d1ee4e1942343f115c71f96 (patch)
treedf2a9c33c03ba43ff2e543c11b52f26706330cc7
parent121c449b226db8b4ea2104545992fd6ac15eaf08 (diff)
downloadorg.eclipse.objectteams-73901481c73753772d1ee4e1942343f115c71f96.tar.gz
org.eclipse.objectteams-73901481c73753772d1ee4e1942343f115c71f96.tar.xz
org.eclipse.objectteams-73901481c73753772d1ee4e1942343f115c71f96.zip
Bug 537533 - [otdre] empty callAllBindings() may block callin bound to
super - fix new ISE seen in tests Change-Id: Ib0cfacb73614efd5e29cc4fe4c09ad9f10302bc1
-rw-r--r--plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AsmWritableBoundClass.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AsmWritableBoundClass.java b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AsmWritableBoundClass.java
index 25d3f9014..28a87e575 100644
--- a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AsmWritableBoundClass.java
+++ b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AsmWritableBoundClass.java
@@ -123,7 +123,8 @@ class AsmWritableBoundClass extends AsmBoundClass {
writer = getClassWriter();
multiAdapter = new MultiClassAdapter(writer);
- nodes = new ArrayList<AbstractTransformableClassNode>();
+ if (nodes == null)
+ nodes = new ArrayList<AbstractTransformableClassNode>();
isTransformationActive = true;
}
@@ -500,8 +501,13 @@ class AsmWritableBoundClass extends AsmBoundClass {
nodes.add(new CreateSuperCallAdapter(internalSuperClassName, ConstantMembers.callOrig));
nodes.add(new CreateSuperCallAdapter(internalSuperClassName, ConstantMembers.access));
};
- if (isTransformationActive) {
+ if (isTransformationActive || !isTransformed) {
+ // either include in the current transformation or schedule for an upcoming transformation.
+ if (nodes == null)
+ nodes = new ArrayList<AbstractTransformableClassNode>();
operation.run();
+ // note: order of adapters in nodes is not relevant, because the methods to be augmented
+ // are created by visitors of the multiAdapter, see prepareAsPossibleBaseClass().
} else if (this.weavingContext != null) {
IReweavingTask task = new IReweavingTask() {
@Override public void reweave(Class<?> definedClass) throws IllegalClassFormatException {