Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2013-01-05 22:39:34 +0000
committerStephan Herrmann2013-01-22 20:49:09 +0000
commit15173638ebdf08e2718101b99052762b4748e736 (patch)
tree539181aa03b8bcf014daf3a78214a380f512f4c5
parentf347a7c86e66fcbac9468e9bf4d7028a33df1d93 (diff)
downloadorg.eclipse.objectteams-15173638ebdf08e2718101b99052762b4748e736.tar.gz
org.eclipse.objectteams-15173638ebdf08e2718101b99052762b4748e736.tar.xz
org.eclipse.objectteams-15173638ebdf08e2718101b99052762b4748e736.zip
Bug 397192 - Prepare OTDT for new (dynamic) weaver:
Small fixes: - Fixed NPEs observed when compiling the OTDT - More on parameter conversion: don't try to lift array of basetype
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java5
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java8
2 files changed, 8 insertions, 5 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java
index 9d594444c..9ebd25fbd 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/ast/PotentialLiftExpression.java
@@ -202,10 +202,11 @@ public class PotentialLiftExpression extends PotentialTranslationExpression {
private MessageSend genLiftCall(BlockScope scope, TypeBinding providedType) {
MessageSend liftCall = Lifting.liftCall(scope, this.teamExpr, this.expression, providedType, this.expectedType, this.requireReverseOperation);
liftCall.actualReceiverType = this.teamExpr.resolveType(scope);
- liftCall.binding = ((ReferenceBinding)this.teamExpr.resolvedType).getMethod(scope, liftCall.selector);
+ if (this.teamExpr.resolvedType instanceof ReferenceBinding) // i.e. not-null
+ liftCall.binding = ((ReferenceBinding)this.teamExpr.resolvedType).getMethod(scope, liftCall.selector);
if (liftCall.binding == null) // can't process (analyze,generate) if lift method is missing
{
- if (TeamModel.hasRoFiCache((ReferenceBinding)liftCall.actualReceiverType))
+ if (liftCall.actualReceiverType != null && TeamModel.hasRoFiCache((ReferenceBinding)liftCall.actualReceiverType))
scope.problemReporter().unresolvedLifting(this, providedType, this.expectedType);
else
scope.problemReporter().referenceContext.tagAsHavingErrors();
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 6de35d5c8..1dd7b4b1c 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
@@ -532,9 +532,11 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
gen.typeReference(baseArgType),
callinDecl.scope),
CastExpression.DO_WRAP);
- // lift?(MyBaseClass)
- arg = gen.potentialLift(gen.thisReference(), arg, roleParam, isReplace/*reversible*/);
- canLiftingFail |= checkLiftingProblem(teamDecl, callinDecl, (ReferenceBinding)roleParam.leafComponentType());
+ if (!roleParam.leafComponentType().isBaseType()) {
+ // lift?(MyBaseClass)
+ arg = gen.potentialLift(gen.thisReference(), arg, roleParam, isReplace/*reversible*/);
+ canLiftingFail |= checkLiftingProblem(teamDecl, callinDecl, (ReferenceBinding)roleParam.leafComponentType());
+ }
}
} else {
arg = getArgument(callinDecl, // prepare: <mappedArg<n>>

Back to the top