Bug 433150 Reorganize structure of runtime bundles / packages
- OTDRE must use IBoundBase2.
- compiler needs to conditionally use IBoundBase2, too.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
index 8edf85a..2f93c99 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Expression.java
@@ -658,7 +658,8 @@
//{ObjectTeams: conformance of final bound base class to IBoundBase?
if ( match == null
&& refExprType.isBoundBase()
- && castType.id == IOTConstants.T_OrgObjectTeamsIBoundBase)
+ && (castType.id == IOTConstants.T_OrgObjectTeamsIBoundBase
+ || castType.id == IOTConstants.T_OrgObjectTeamsIBoundBase2))
match = castType;
// SH}
if (match != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index 168e7d7..01233df 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -592,6 +592,8 @@
this.id = IOTConstants.T_OrgObjectTeamsTeam;
else if(CharOperation.equals(IOTConstants.IBOUNDBASE, this.compoundName[2]))
this.id = IOTConstants.T_OrgObjectTeamsIBoundBase;
+ else if(CharOperation.equals(IOTConstants.IBOUNDBASE2, this.compoundName[2]))
+ this.id = IOTConstants.T_OrgObjectTeamsIBoundBase2;
else if(CharOperation.equals(IOTConstants.INSTANTIATION, this.compoundName[2]))
this.id = IOTConstants.T_OrgObjectTeamsInstantiation;
return;
@@ -1475,7 +1477,8 @@
}
//{ObjectTeams: special case: bound base classes are conform to o.o.IBoundBase:
if (isBoundBase())
- return anInterface.id == IOTConstants.T_OrgObjectTeamsIBoundBase;
+ return (anInterface.id == IOTConstants.T_OrgObjectTeamsIBoundBase
+ || anInterface.id == IOTConstants.T_OrgObjectTeamsIBoundBase2); // assume only one of these can be used during one compile
//SH}
return false;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java
index 74f6459..a28fa6f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java
@@ -265,6 +265,10 @@
* @since 3.7 (OT 2.0)
*/
public static final int T_OrgObjectTeamsInstantiation = 103;
+ /**
+ * @since 3.10 (OT 2.3)
+ */
+ public static final int T_OrgObjectTeamsIBoundBase2 = 104;
// special identifiers:
public static final char[] RESULT = "result".toCharArray();
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 1417683..e1ee6eb 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
@@ -310,9 +310,9 @@
if (teamDecl == null) return;
final AstGenerator gen = new AstGenerator(teamDecl);
- // public void _OT$callBefore (IBoundBase base, int boundMethodId, int callinId, Object[] args)
- // public void _OT$callAfter (IBoundBase base, int boundMethodId, int callinId, Object[] args, Object result)
- // public void _OT$callReplace (IBoundBase base, Team[] teams, int index, int boundMethodId, int[] callinIds, Object[] args)
+ // public void _OT$callBefore (IBoundBase2 base, int boundMethodId, int callinId, Object[] args)
+ // public void _OT$callAfter (IBoundBase2 base, int boundMethodId, int callinId, Object[] args, Object result)
+ // public void _OT$callReplace (IBoundBase2 base, Team[] teams, int index, int boundMethodId, int[] callinIds, Object[] args)
int length = 4;
if (isReplace)
length = 6;
@@ -320,7 +320,7 @@
length = 5;
Argument[] arguments = new Argument[length];
int a = 0;
- arguments[a++] = gen.argument(IOTConstants.BASE, gen.qualifiedTypeReference(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE));
+ arguments[a++] = gen.argument(IOTConstants.BASE, gen.qualifiedTypeReference(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE2));
if (isReplace)
arguments[a++] = gen.argument(TEAMS, gen.qualifiedArrayTypeReference(IOTConstants.ORG_OBJECTTEAMS_ITEAM, 1));
if (isReplace)
@@ -435,7 +435,7 @@
gen.castExpression(gen.baseNameReference(IOTConstants.BASE),
gen.baseTypeReference(roleType.baseclass()),
CastExpression.RAW),
- callMethod.scope.getType(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE, 3),
+ callMethod.scope.getType(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE2, 3),
roleType,
false,
gen)));
@@ -549,7 +549,7 @@
&& CharOperation.equals(((SingleNameReference)arg).token, IOTConstants.BASE);
if (needLiftedRoleVar)
arg = new PotentialRoleReceiverExpression(arg, roleVar, gen.typeReference(roleType.getRealClass()));
- // mapped expression may require casting: "base" reference has static type IBoundBase
+ // mapped expression may require casting: "base" reference has static type IBoundBase2
if (isBaseReference)
arg = gen.castExpression(arg, gen.typeReference(roleParam), CastExpression.RAW);
}
@@ -792,12 +792,12 @@
}
private void generateCallNext(final List<CallinMappingDeclaration> callinDecls, final TeamModel aTeam) {
- // public Object _OT$callNext(IBoundBase baze, Team[] teams, int idx, int[] callinIds, int boundMethodId, Object[] args, Object[] baseCallArgs)
+ // public Object _OT$callNext(IBoundBase2 baze, Team[] teams, int idx, int[] callinIds, int boundMethodId, Object[] args, Object[] baseCallArgs)
final TypeDeclaration teamDecl = aTeam.getAst();
if (teamDecl == null) return;
final AstGenerator gen = new AstGenerator(teamDecl);
Argument[] args = new Argument[] {
- gen.argument(IOTConstants.BASE, gen.qualifiedTypeReference(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE)),
+ gen.argument(IOTConstants.BASE, gen.qualifiedTypeReference(IOTConstants.ORG_OBJECTTEAMS_IBOUNDBASE2)),
gen.argument(TEAMS, gen.qualifiedArrayTypeReference(IOTConstants.ORG_OBJECTTEAMS_ITEAM, 1)),
gen.argument(INDEX, gen.typeReference(TypeBinding.INT)),
gen.argument(CALLIN_ID, gen.createArrayTypeReference(TypeBinding.INT, 1)),
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java
index 3389fae..0fae52c 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/TypeAnalyzer.java
@@ -769,7 +769,8 @@
|| CharOperation.equals(name, IOTConstants.OTCONFINED)
|| CharOperation.equals(name, IOTConstants.CONFINED)
|| CharOperation.equals(name, IOTConstants.ILOWERABLE)
- || CharOperation.equals(name, IOTConstants.IBOUNDBASE);
+ || CharOperation.equals(name, IOTConstants.IBOUNDBASE)
+ || CharOperation.equals(name, IOTConstants.IBOUNDBASE2);
}
public static boolean extendsOTConfined(TypeDeclaration type) {
diff --git a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java
index e9831a6..305e670 100644
--- a/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java
+++ b/plugins/org.eclipse.objectteams.otdt.compiler.adaptor/src/org/eclipse/objectteams/otdt/internal/compiler/adaptor/BuildManager.java
@@ -343,6 +343,7 @@
|| CharOperation.equals(roleName, IOTConstants.OTCONFINED)
|| CharOperation.equals(roleName, IOTConstants.ICONFINED)
|| CharOperation.equals(roleName, IOTConstants.IBOUNDBASE)
+ || CharOperation.equals(roleName, IOTConstants.IBOUNDBASE2)
|| CharOperation.equals(roleName, IOTConstants.ILOWERABLE);
}
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 9938322..46919da 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
@@ -299,7 +299,7 @@
/**
* Do all needed transformations needed at load time:
- * Add the interface IBoundBase
+ * Add the interface IBoundBase2
* Add the empty method callOrig
* Add the empty method callOrigStatic
* Add the empty method access
diff --git a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AbstractCreateDispatchCodeAdapter.java b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AbstractCreateDispatchCodeAdapter.java
index b6fd1ef..4e33623 100644
--- a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AbstractCreateDispatchCodeAdapter.java
+++ b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/AbstractCreateDispatchCodeAdapter.java
@@ -84,7 +84,7 @@
if (isStatic) {
instructions.add(new InsnNode(Opcodes.ACONST_NULL));
} else {
- // put "this" on the stack and cast it to IBoundBase
+ // put "this" on the stack and cast it to IBoundBase2
instructions.add(new IntInsnNode(Opcodes.ALOAD, 0));
instructions.add(new TypeInsnNode(Opcodes.CHECKCAST,
ClassNames.I_BOUND_BASE_SLASH));
diff --git a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateAddRemoveRoleMethod.java b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateAddRemoveRoleMethod.java
index 195821e..d0c3758 100644
--- a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateAddRemoveRoleMethod.java
+++ b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/bytecode/asm/CreateAddRemoveRoleMethod.java
@@ -30,7 +30,7 @@
/**
* Implements the method <code>void _OT$addOrRemoveRole(Object role, boolean isAdding)</code>
- * from <code>org.objectteams.IBoundBase</code>
+ * from <code>org.objectteams.IBoundBase2</code>
*
* @author stephan
*/
diff --git a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/names/ClassNames.java b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/names/ClassNames.java
index a4bb5b7..7185d25 100644
--- a/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/names/ClassNames.java
+++ b/plugins/org.eclipse.objectteams.otredyn/src/org/eclipse/objectteams/otredyn/transformer/names/ClassNames.java
@@ -20,7 +20,7 @@
import java.util.List;
import org.eclipse.objectteams.otredyn.runtime.TeamManager;
-import org.objectteams.IBoundBase;
+import org.objectteams.IBoundBase2;
import org.objectteams.ITeam;
import org.objectteams.ImplicitTeamActivation;
import org.objectteams.SneakyException;
@@ -31,10 +31,10 @@
* @author Oliver Frank
*/
public abstract class ClassNames {
- public final static String I_BOUND_BASE_SLASH = IBoundBase.class.getName().replace('.', '/');
+ public final static String I_BOUND_BASE_SLASH = IBoundBase2.class.getName().replace('.', '/');
public final static String OBJECT_SLASH = Object.class.getName().replace('.', '/');
public final static String CLASS_SLASH = Class.class.getName().replace('.', '/');
- public final static String I_BOUND_BASE_DOT = IBoundBase.class.getName();
+ public final static String I_BOUND_BASE_DOT = IBoundBase2.class.getName();
public final static String TEAM_MANAGER_SLASH = TeamManager.class.getName().replace('.', '/');
public final static String ITEAM_SLASH = ITeam.class.getName().replace('.', '/');
public final static String TEAM_SLASH = Team.class.getName().replace('.', '/');