Bug 443580 - Regression in
org.eclipse.objectteams.otdt.tests.otjld.teamactivation.Predicates.test914_bindingPredicate16()
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
index b1cd758..af9f8f6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
@@ -1050,13 +1050,13 @@
this.binding = ((ProblemMethodBinding)this.binding).closestMatch;
if (!this.binding.declaringClass.isRole()) { // access via interface is possible anyway, no access wrapper needed.
// need an accessor method that will be generated by the OTRE / OTREDyn
- if (this.accessId == -1) // happens for BaseAllocationExpression with role-as-base
+ if (this.accessId == -1) // -1 happens for BaseAllocationExpression with role-as-base
this.accessId = scope.enclosingSourceType().roleModel.addInaccessibleBaseMethod(this.binding);
// pretend that accessor method were already there:
+ if (this.accessId == 0)
+ this.accessId = scope.enclosingSourceType().roleModel.addInaccessibleBaseMethod(this.binding);
if (weavingScheme == WeavingScheme.OTDRE) {
MethodBinding accessor = CalloutImplementorDyn.ensureAccessor(scope, this.binding.declaringClass, this.binding.isStatic());
- if (this.accessId == 0)
- this.accessId = scope.enclosingSourceType().roleModel.addInaccessibleBaseMethod(this.binding);
this.syntheticAccessor = new SyntheticOTTargetMethod.OTDREMethodDecapsulation(accessor, this.binding.parameters, this.binding.returnType, this.accessId, scope, this);
} else {
this.binding = new MethodBinding(this.binding, this.binding.declaringClass.getRealClass());
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java
index c422134..7cbb74d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java
@@ -402,7 +402,7 @@
&& (callinDecl.mappings != null || callinDecl.predicate != null)
&& baseReturn != TypeBinding.VOID) {
resultName = RESULT;
- blockStatements.add(gen.localVariable(RESULT, baseReturn, // BaseReturnType result = (BaseReturnType)_OT$result;
+ blockStatements.add(gen.localBaseVariable(RESULT, baseReturn, // BaseReturnType result = (BaseReturnType)_OT$result;
gen.createCastOrUnboxing(gen.singleNameReference(_OT_RESULT), baseReturn, true/*baseAccess*/)));
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
index 1dd61ac..3b98b4d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java
@@ -130,6 +130,14 @@
return localVariable(name, typeReference, init);
}
+ public LocalDeclaration localBaseVariable (char[] name, TypeBinding type, Expression init) {
+ TypeReference typeReference = baseclassReference(type);
+ typeReference.sourceStart = this.sourceStart;
+ typeReference.sourceEnd = this.sourceEnd;
+
+ return localVariable(name, typeReference, init);
+ }
+
public LocalDeclaration localVariable(char[] name, TypeReference typeReference, Expression init) {
LocalDeclaration variable = new LocalDeclaration(name, this.sourceStart, this.sourceEnd);
variable.initialization = init;
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java
index c4c8328..b99bd08 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/AllTests.java
@@ -66,6 +66,7 @@
import org.eclipse.objectteams.otdt.tests.otjld.syntax.Syntax;
import org.eclipse.objectteams.otdt.tests.otjld.teamactivation.ExplicitTeamActivation;
import org.eclipse.objectteams.otdt.tests.otjld.teamactivation.ImplicitTeamActivation;
+import org.eclipse.objectteams.otdt.tests.otjld.teamactivation.Predicates;
/**
* @author stephan
@@ -116,6 +117,7 @@
// 5. teamactivation
/*5.2*/addComplianceSuite(suite, ExplicitTeamActivation.testClass());
/*5.3*/addComplianceSuite(suite, ImplicitTeamActivation.testClass());
+ /*5.4*/addComplianceSuite(suite, Predicates.testClass());
// 6.[14] liftlower
/*6.1*/addComplianceSuite(suite, DeclaredLifting.testClass());