summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2018-08-08 16:20:45 -0400
committerStephan Herrmann2018-08-08 16:20:45 -0400
commit0800b0b1e6c3e5bf15c291198635959c2a99540d (patch)
tree9a6eb349f26b5cdf071d9705398600fbc296368d
parented40b301670fe4f10129729541a4d5f7c4826efb (diff)
downloadorg.eclipse.objectteams-0800b0b1e6c3e5bf15c291198635959c2a99540d.tar.gz
org.eclipse.objectteams-0800b0b1e6c3e5bf15c291198635959c2a99540d.tar.xz
org.eclipse.objectteams-0800b0b1e6c3e5bf15c291198635959c2a99540d.zip
Bug 537350 - [otdre] Callin bindings don't fire when overriding method
is invoked
-rw-r--r--plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/AbstractBoundClass.java8
-rw-r--r--plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateCallAllBindingsCallInOrgMethod.java2
-rw-r--r--plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/jplis/ObjectTeamsTransformer.java2
3 files changed, 6 insertions, 6 deletions
diff --git a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/AbstractBoundClass.java b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/AbstractBoundClass.java
index 2a7393c72..c08ea104a 100644
--- a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/AbstractBoundClass.java
+++ b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/AbstractBoundClass.java
@@ -755,7 +755,7 @@ public abstract class AbstractBoundClass implements IBoundClass {
}
} else {
// No, so weave this class and delegate to the implementing super class
- weaveBindingInNotImplementedMethod(task);
+ weaveBindingInNotImplementedMethod(task, true);
AbstractBoundClass superclass = getSuperclass();
while (superclass != null && !superclass.isJavaLangObject()) {
if (weavingContext.isWeavable(superclass.getName(), false, false)) { // explicitly traversing supers
@@ -799,7 +799,7 @@ public abstract class AbstractBoundClass implements IBoundClass {
replaceWickedSuperCalls(getSuperclass(), method);
}
} else {
- weaveBindingInNotImplementedMethod(task);
+ weaveBindingInNotImplementedMethod(task, false);
}
// Delegate the WeavingTask to the subclasses
@@ -1131,7 +1131,7 @@ public abstract class AbstractBoundClass implements IBoundClass {
* in this class
* @param task
*/
- private void weaveBindingInNotImplementedMethod(WeavingTask task) {
+ private void weaveBindingInNotImplementedMethod(WeavingTask task, boolean needToAddMethod) {
if ((task.getBaseFlags() & IBinding.STATIC_BASE) == 0)
prepareForFirstTransformation();
else
@@ -1161,7 +1161,7 @@ public abstract class AbstractBoundClass implements IBoundClass {
createSuperCallInCallOrig(boundMethodId);
else
// can't weave into the declaring class, add an override here:
- createCallAllBindingsCallInOrgMethod(method, boundMethodId, true/*needToAddMethod*/);
+ createCallAllBindingsCallInOrgMethod(method, boundMethodId, needToAddMethod);
} else {
createDispatchCodeInCallAllBindings(joinpointId, boundMethodId);
}
diff --git a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateCallAllBindingsCallInOrgMethod.java b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateCallAllBindingsCallInOrgMethod.java
index 8297215e2..33852cb95 100644
--- a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateCallAllBindingsCallInOrgMethod.java
+++ b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateCallAllBindingsCallInOrgMethod.java
@@ -55,7 +55,7 @@ public class CreateCallAllBindingsCallInOrgMethod extends
@Override
public boolean transform() {
MethodNode method = getMethod(orgMethod);
- if ((method.access & Opcodes.ACC_ABSTRACT) != 0) return false;
+ if (method == null || (method.access & Opcodes.ACC_ABSTRACT) != 0) return false;
// start of try-block:
InsnList newInstructions = new InsnList();
diff --git a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/jplis/ObjectTeamsTransformer.java b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/jplis/ObjectTeamsTransformer.java
index b7eaad4b6..8e694d65c 100644
--- a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/jplis/ObjectTeamsTransformer.java
+++ b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/jplis/ObjectTeamsTransformer.java
@@ -84,7 +84,7 @@ public class ObjectTeamsTransformer implements ClassFileTransformer {
AbstractBoundClass clazz = classRepo.peekBoundClass(classId);
String sourceClassName = className.replace('/','.');
- if (!weavingContext.isWeavable(sourceClassName, false, true) || loader == null) {
+ if (!weavingContext.isWeavable(sourceClassName, true, true) || loader == null) {
if (clazz != null) {
if (isWeavable(className) && clazz.needsWeaving()) {
// only print out for now, exceptions thrown by us are silently caught by TransformerManager.