Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2012-12-31 18:51:54 +0000
committerStephan Herrmann2013-01-22 20:46:48 +0000
commit252e3f87515c0aaa33072cc48fec9dc2d0a3ebc9 (patch)
tree27d74821a7ea78a936d15e02614c0ff09c58f502
parent00eccfa97885d2dda1f022d99d936f182f89b2b4 (diff)
downloadorg.eclipse.objectteams-252e3f87515c0aaa33072cc48fec9dc2d0a3ebc9.tar.gz
org.eclipse.objectteams-252e3f87515c0aaa33072cc48fec9dc2d0a3ebc9.tar.xz
org.eclipse.objectteams-252e3f87515c0aaa33072cc48fec9dc2d0a3ebc9.zip
Bug 397192 - Prepare OTDT for new (dynamic) weaver:
partial fix for testA16_decapsulationForTypeParameter1 - let compiler accept decapsulation TODO: make class public for the VM
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CallinImplementorDyn.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/AstGenerator.java4
3 files changed, 5 insertions, 3 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 e03b6dd1b..398d2b5f5 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
@@ -423,7 +423,7 @@ public class CallinImplementorDyn extends MethodMappingImplementor {
if (mayUseResultArgument)
blockStatements.add(gen.localVariable(RESULT, baseReturn, // BaseReturnType result = (BaseReturnType)_OT$result;
- gen.createCastOrUnboxing(gen.singleNameReference(_OT_RESULT), baseReturn)));
+ gen.createCastOrUnboxing(gen.singleNameReference(_OT_RESULT), baseReturn, true/*baseAccess*/)));
Expression receiver;
char[] roleVar = null;
if (!isStaticRoleMethod) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java
index 77ad3d8b6..79eea38a6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementorDyn.java
@@ -64,7 +64,7 @@ public class CalloutImplementorDyn {
if (baseSpec.resolvedType() == TypeBinding.VOID)
return messageSend;
else
- return gen.createCastOrUnboxing(messageSend, baseSpec.resolvedType());
+ return gen.createCastOrUnboxing(messageSend, baseSpec.resolvedType(), true/*baseAccess*/);
}
private static char[] ensureAccessor(Scope scope, ReferenceBinding baseType, boolean isStatic) {
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 a8374ca9e..75dc7ee04 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
@@ -1251,9 +1251,11 @@ public class AstGenerator extends AstFactory {
selector,
null);
}
- public Expression createCastOrUnboxing(Expression expression, TypeBinding expectedType) {
+ public Expression createCastOrUnboxing(Expression expression, TypeBinding expectedType, boolean baseAccess) {
if (expectedType.isBaseType())
return createUnboxing(expression, (BaseTypeBinding)expectedType);
+ else if (baseAccess)
+ return castExpression(expression, baseclassReference(expectedType), CastExpression.RAW);
else
return castExpression(expression, typeReference(expectedType), CastExpression.RAW);
}

Back to the top