Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2013-01-06 19:52:57 +0000
committerStephan Herrmann2013-01-22 20:50:41 +0000
commitcc2a175433fcfa4cb4eb3de3de726e97d36a672f (patch)
treead0641d45ab5bbd6be3e77a71ad7ec41dacaa250
parent236d0b8394ded97d92ebdb4b79319b478b83f8fb (diff)
downloadorg.eclipse.objectteams-cc2a175433fcfa4cb4eb3de3de726e97d36a672f.tar.gz
org.eclipse.objectteams-cc2a175433fcfa4cb4eb3de3de726e97d36a672f.tar.xz
org.eclipse.objectteams-cc2a175433fcfa4cb4eb3de3de726e97d36a672f.zip
Bug 397192 - Prepare OTDT for new (dynamic) weaver:
Make variable "result" accessible also to a base predicate Fix needed for compiling compiler.adaptor.
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java22
1 files changed, 11 insertions, 11 deletions
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 5b034fdda..b59f4239b 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
@@ -391,10 +391,6 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
callinDecl.isReplaceCallin());
TypeBinding baseReturn = baseSpec.resolvedType();
- boolean mayUseResultArgument = callinDecl.callinModifier == TerminalTokens.TokenNameafter
- && callinDecl.mappings != null
- && baseReturn != TypeBinding.VOID;
-
boolean isStaticRoleMethod = callinDecl.getRoleMethod().isStatic();
ReferenceBinding roleType = callinDecl.scope.enclosingReceiverType();
MethodBinding roleMethodBinding = callinDecl.getRoleMethod();
@@ -404,8 +400,15 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
&& roleType.isCompatibleWith(roleMethodBinding.declaringClass);
List<Statement> blockStatements = new ArrayList<Statement>();
-
- // -------------- base predicate check -------
+
+ // do we need to expose _OT$result as result?
+ if (callinDecl.callinModifier == TerminalTokens.TokenNameafter
+ && callinDecl.mappings != null
+ && baseReturn != TypeBinding.VOID)
+ blockStatements.add(gen.localVariable(RESULT, baseReturn, // BaseReturnType result = (BaseReturnType)_OT$result;
+ gen.createCastOrUnboxing(gen.singleNameReference(_OT_RESULT), baseReturn, true/*baseAccess*/)));
+
+ // -------------- base predicate check -------
boolean hasBasePredicate = false;
for (MethodSpec baseMethodSpec : callinDecl.baseMethodSpecs) {
char[] resultName = null;
@@ -424,11 +427,8 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
}
Expression resetFlag =
CallinImplementor.setExecutingCallin(roleType.roleModel, blockStatements); // boolean _OT$oldIsExecutingCallin = _OT$setExecutingCallin(true);
-
- if (mayUseResultArgument)
- blockStatements.add(gen.localVariable(RESULT, baseReturn, // BaseReturnType result = (BaseReturnType)_OT$result;
- gen.createCastOrUnboxing(gen.singleNameReference(_OT_RESULT), baseReturn, true/*baseAccess*/)));
- Expression receiver;
+
+ Expression receiver;
char[] roleVar = null;
if (!isStaticRoleMethod) {
if (needLiftedRoleVar) {

Back to the top