Bug 406920 - Integrate well-known OT types with TypeIds for optimized
checking
diff --git a/org.eclipse.jdt.core/.settings/.api_filters b/org.eclipse.jdt.core/.settings/.api_filters
index 1c0e761..e866117 100644
--- a/org.eclipse.jdt.core/.settings/.api_filters
+++ b/org.eclipse.jdt.core/.settings/.api_filters
@@ -36,6 +36,67 @@
</message_arguments>
</filter>
</resource>
+ <resource path="compiler/org/eclipse/objectteams/otdt/core/compiler/IOTConstants.java" type="org.eclipse.objectteams.otdt.core.compiler.IOTConstants">
+ <filter comment="cleanup constants to avoid near-term conflict with JDT" id="388194388">
+ <message_arguments>
+ <message_argument value="org.eclipse.objectteams.otdt.core.compiler.IOTConstants"/>
+ <message_argument value="T_OrgObjectTeamsIBoundBase"/>
+ <message_argument value="102"/>
+ </message_arguments>
+ </filter>
+ <filter comment="cleanup constants to avoid near-term conflict with JDT" id="388194388">
+ <message_arguments>
+ <message_argument value="org.eclipse.objectteams.otdt.core.compiler.IOTConstants"/>
+ <message_argument value="T_OrgObjectTeamsIBoundBase2"/>
+ <message_argument value="104"/>
+ </message_arguments>
+ </filter>
+ <filter comment="cleanup constants to avoid near-term conflict with JDT" id="388194388">
+ <message_arguments>
+ <message_argument value="org.eclipse.objectteams.otdt.core.compiler.IOTConstants"/>
+ <message_argument value="T_OrgObjectTeamsITeam"/>
+ <message_argument value="100"/>
+ </message_arguments>
+ </filter>
+ <filter comment="cleanup constants to avoid near-term conflict with JDT" id="388194388">
+ <message_arguments>
+ <message_argument value="org.eclipse.objectteams.otdt.core.compiler.IOTConstants"/>
+ <message_argument value="T_OrgObjectTeamsInstantiation"/>
+ <message_argument value="103"/>
+ </message_arguments>
+ </filter>
+ <filter comment="cleanup constants to avoid near-term conflict with JDT" id="388194388">
+ <message_arguments>
+ <message_argument value="org.eclipse.objectteams.otdt.core.compiler.IOTConstants"/>
+ <message_argument value="T_OrgObjectTeamsTeam"/>
+ <message_argument value="101"/>
+ </message_arguments>
+ </filter>
+ <filter comment="constant name was corrected" id="405864542">
+ <message_arguments>
+ <message_argument value="org.eclipse.objectteams.otdt.core.compiler.IOTConstants"/>
+ <message_argument value="TEAM_ICONFINED"/>
+ </message_arguments>
+ </filter>
+ <filter comment="name corrected" id="1211105284">
+ <message_arguments>
+ <message_argument value="ITEAM_ICONFINED"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java" type="org.eclipse.objectteams.otdt.core.compiler.OTNameUtils">
+ <filter comment="method signature was improved" id="338792546">
+ <message_arguments>
+ <message_argument value="org.eclipse.objectteams.otdt.core.compiler.OTNameUtils"/>
+ <message_argument value="isPredefinedConfined(char[][])"/>
+ </message_arguments>
+ </filter>
+ <filter comment="method signature was improved" id="1143996420">
+ <message_arguments>
+ <message_argument value="isPredefinedConfined(ReferenceBinding)"/>
+ </message_arguments>
+ </filter>
+ </resource>
<resource path="dom/org/eclipse/jdt/core/dom/ASTNode.java" type="org.eclipse.jdt.core.dom.ASTNode">
<filter comment="necessary constant change after new constants in JDT" id="388194388">
<message_arguments>
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
index 83587b3..288bff7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
@@ -37,7 +37,6 @@
import static org.eclipse.jdt.internal.compiler.ast.ExpressionContext.INVOCATION_CONTEXT;
-import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.internal.compiler.ASTVisitor;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.codegen.*;
@@ -440,8 +439,7 @@
}
//{ObjectTeams: compiling org.objectteams.Team$__OT__Confined ?
if (receiverType == null) {
- if (CharOperation.equals(scope.enclosingSourceType().compoundName,
- IOTConstants.ORG_OBJECTTEAMS_TEAM_OTCONFINED))
+ if (scope.enclosingSourceType().id == IOTConstants.T_OrgObjectteamsTeamOTConfined)
receiverType = scope.getJavaLangObject(); // use this supertype only this one time!
else // testharness for checking a hypothesis:
scope.problemReporter().missingImplementation(this, "Detected null receiverType"); //$NON-NLS-1$
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 b403006..83f68c0 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
@@ -1533,7 +1533,7 @@
{
// tweak methods of predefined confined types:
if ( this.binding.isValidBinding()
- && CharOperation.equals(this.binding.declaringClass.compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_OTCONFINED)
+ && this.binding.declaringClass.id == IOTConstants.T_OrgObjectteamsTeamOTConfined
&& !CharOperation.equals(this.selector, IOTConstants._OT_GETTEAM))
{
// methods found in a predefined confined type are actually methods of Object
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
index ad6380a..f355226 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java
@@ -109,7 +109,7 @@
//{ObjectTeams: some reasons why there might be nothing to analyze:
// still waiting for statements to be generated?
if ( this.isGenerated && this.statements == null
- && !this.scope.isOrgObjectteamsTeam(this.binding.declaringClass)) // o.o.T. methods are special
+ && this.binding.declaringClass.id != IOTConstants.T_OrgObjectTeamsTeam) // o.o.T. methods are special
return;
// SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
index d2108df..e2c0a18 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
@@ -687,7 +687,7 @@
char[] superclassName = binaryType.getSuperclassName();
//{ObjectTeams: predefined confined types require special treatment
// 1. add the synthetic flag which is missing from the class file:
- if (CharOperation.equals(this.compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_CONFINED))
+ if (this.id == IOTConstants.T_OrgObjectteamsTeamConfined)
this.modifiers |= ClassFileConstants.AccSynthetic;
if (TypeAnalyzer.isTopConfined(this)) {
// 2. don't search a superclass, have none (ie., skip the else part)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
index e04b4bc..43f8fd4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
@@ -1834,7 +1834,7 @@
sourceType.tagBits |= TagBits.HierarchyHasProblems; // propagate if missing supertype
return superclassRef.resolvedType.isValidBinding(); // reported some error against the source type ?
//{ObjectTeams: team super class only allowed for teams
- } else if ((isOrgObjectteamsTeam(superclass) || superclass.isTeam())
+ } else if ((superclass.id == IOTConstants.T_OrgObjectTeamsTeam || superclass.isTeam())
&& !sourceType.isTeam())
{
problemReporter().regularExtendsTeam(sourceType, this.referenceContext.superclass, superclass);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
index 290fd68..15fb1b3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java
@@ -1198,7 +1198,7 @@
//{ObjectTeams: some methods don't need to be implemented:
boolean mustImplementThisAbstractMethod(MethodBinding abstractMethod) {
// no need to implement methods from predefined Confined types
- if (OTNameUtils.isPredefinedConfined(abstractMethod.declaringClass.compoundName))
+ if (OTNameUtils.isPredefinedConfined(abstractMethod.declaringClass))
return false;
// faked enhanced callins will be implemented by the OTRE:
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 d0806fe..3adef04 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
@@ -662,6 +662,14 @@
this.id = IOTConstants.T_OrgObjectTeamsIBoundBase2;
else if(CharOperation.equals(IOTConstants.INSTANTIATION, this.compoundName[2]))
this.id = IOTConstants.T_OrgObjectTeamsInstantiation;
+ else if(CharOperation.equals(IOTConstants.ICONFINED, this.compoundName[2]))
+ this.id = IOTConstants.T_OrgObjectteamsIConfined;
+ else if(CharOperation.equals(IOTConstants.ITEAM_ICONFINED, this.compoundName[2]))
+ this.id = IOTConstants.T_OrgObjectteamsITeamIConfined;
+ else if(CharOperation.equals(IOTConstants.TEAM_CONFINED, this.compoundName[2]))
+ this.id = IOTConstants.T_OrgObjectteamsTeamConfined;
+ else if(CharOperation.equals(IOTConstants.TEAM_OTCONFINED, this.compoundName[2]))
+ this.id = IOTConstants.T_OrgObjectteamsTeamOTConfined;
return;
}
// SH}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
index ff8f335..dba7e38 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeIds.java
@@ -149,6 +149,9 @@
// Java 14 preview
final int T_JavaLangRecord = 93;
+//{ObjectTeams:
+ // see also ud constants in IOTConstants (119 - 127)
+// SH}
// If you add new type id, make sure to bump up T_LastWellKnownTypeId if there is a cross over.
final int T_LastWellKnownTypeId = 128;
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 cd1ea31..79eb9c0 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
@@ -200,8 +200,8 @@
public static final char[] ICONFINED = "IConfined".toCharArray();
public static final char[][] ORG_OBJECTTEAMS_ICONFINED = {ORG, OBJECTTEAMS, ICONFINED};
- public static final char[] TEAM_ICONFINED = "ITeam$IConfined".toCharArray();
- public static final char[][] ORG_OBJECTTEAMS_ITEAM_ICONFINED = {ORG, OBJECTTEAMS, TEAM_ICONFINED};
+ public static final char[] ITEAM_ICONFINED = "ITeam$IConfined".toCharArray();
+ public static final char[][] ORG_OBJECTTEAMS_ITEAM_ICONFINED = {ORG, OBJECTTEAMS, ITEAM_ICONFINED};
public static final char[] OTCONFINED = "__OT__Confined".toCharArray();
public static final char[] CONFINED = "Confined".toCharArray();
@@ -264,18 +264,25 @@
// Type IDs (cf. type TypeIds)
- public static final int T_OrgObjectTeamsITeam = 100;
- public static final int T_OrgObjectTeamsTeam = 101;
- public static final int T_OrgObjectTeamsIBoundBase = 102;
+ public static final int T_OrgObjectTeamsITeam = 127;
+ public static final int T_OrgObjectTeamsTeam = 126;
+ public static final int T_OrgObjectTeamsIBoundBase = 125;
/**
* @since 3.7 (OT 2.0)
*/
- public static final int T_OrgObjectTeamsInstantiation = 103;
+ public static final int T_OrgObjectTeamsInstantiation = 124;
/**
* @since 3.10 (OT 2.3)
*/
- public static final int T_OrgObjectTeamsIBoundBase2 = 104;
-
+ public static final int T_OrgObjectTeamsIBoundBase2 = 123;
+ /** @since 3.25 (OT 2.8.2) */
+ public static final int T_OrgObjectteamsIConfined = 122;
+ /** @since 3.25 (OT 2.8.2) */
+ public static final int T_OrgObjectteamsITeamIConfined = 121;
+ /** @since 3.25 (OT 2.8.2) */
+ public static final int T_OrgObjectteamsTeamConfined = 120;
+ /** @since 3.25 (OT 2.8.2) */
+ public static final int T_OrgObjectteamsTeamOTConfined = 119;
// special identifiers:
public static final char[] RESULT = "result".toCharArray();
public static final char[] OT_RESULT = (OT_DOLLAR+"result").toCharArray();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java
index 4b774a0..9da4291 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/core/compiler/OTNameUtils.java
@@ -25,9 +25,8 @@
import static org.eclipse.objectteams.otdt.core.compiler.IOTConstants.PREDICATE_METHOD_NAME;
import static org.eclipse.objectteams.otdt.core.compiler.IOTConstants.TSUPER_OT_NAME;
-
-
import org.eclipse.jdt.core.compiler.CharOperation;
+import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
/**
* API class providing various operations for special names in generated OT/J code.
@@ -120,16 +119,17 @@
}
/**
- * does compoundName denote a predefined confined type?
+ * does 'type' denote a predefined confined type?
+ * @noreference This method is not intended to be referenced by clients.
*/
- public static boolean isPredefinedConfined(char[][] compoundName)
+ public static boolean isPredefinedConfined(ReferenceBinding type)
{
- if (compoundName.length == 3) {
- return
- CharOperation.equals(compoundName, IOTConstants.ORG_OBJECTTEAMS_ICONFINED)
- || CharOperation.equals(compoundName, IOTConstants.ORG_OBJECTTEAMS_ITEAM_ICONFINED)
- || CharOperation.equals(compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_OTCONFINED)
- || CharOperation.equals(compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_CONFINED);
+ switch (type.id) {
+ case IOTConstants.T_OrgObjectteamsIConfined:
+ case IOTConstants.T_OrgObjectteamsITeamIConfined:
+ case IOTConstants.T_OrgObjectteamsTeamOTConfined:
+ case IOTConstants.T_OrgObjectteamsTeamConfined:
+ return true;
}
return false;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectMapper.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectMapper.java
index ffb1a2e..c2b7f33 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectMapper.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/ConstantPoolObjectMapper.java
@@ -384,15 +384,13 @@
if (!refMethodBinding.isConstructor())
return false;
// of class __OT__Confined?
- if (!CharOperation.equals(refMethodBinding.declaringClass.compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_OTCONFINED))
+ if (refMethodBinding.declaringClass.id != IOTConstants.T_OrgObjectteamsTeamOTConfined)
return false;
// is it the superclass of the current src class?
if (TypeBinding.equalsEquals(refMethodBinding.declaringClass, srcMethod.declaringClass.superclass()))
return true;
// current src class may have no super class which is OK if it is Team.__OT__Confined
- return
- srcMethod.declaringClass.superclass() == null
- && CharOperation.equals(IOTConstants.ORG_OBJECTTEAMS_TEAM_OTCONFINED, refMethodBinding.declaringClass.compoundName);
+ return srcMethod.declaringClass.superclass() == null;
}
private static MethodBinding getConfinedSuperCtor(MethodBinding dstMethod) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java
index 997e521..e76be43 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/RoleTypeBinding.java
@@ -191,7 +191,7 @@
}
// compute the team:
- if (CharOperation.equals(roleType.compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_OTCONFINED))
+ if (roleType.id == IOTConstants.T_OrgObjectteamsTeamOTConfined)
// the following is needed in order to break the circularity
// of roles extending the predefined Team.__OT__Confined (see class comment)
this._staticallyKnownTeam = roleType.enclosingType();
@@ -665,7 +665,7 @@
if ((superClass != null) && (superClass.isDirectRole()))
{
// 1.a: a confined type "as-is": don't instantiate/strengthen
- if ( OTNameUtils.isPredefinedConfined(superClass.compoundName)
+ if ( OTNameUtils.isPredefinedConfined(superClass)
|| CharOperation.equals(IOTConstants.OTCONFINED, superClass.sourceName))
return this._superClass = superClass;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
index 7f27be0..7928f6d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
@@ -1003,7 +1003,7 @@
tgtTeam, targetRoleDecl);
if (method.isConstructor()) {
- if (CharOperation.equals(srcRole.compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_OTCONFINED))
+ if (srcRole.id == IOTConstants.T_OrgObjectteamsTeamOTConfined)
{
// must add default constructor explicitly,
// since if we would copy the one from Team.__OT__Confined,
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java
index 18c5df4..a3ee7c3 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java
@@ -371,7 +371,7 @@
if ( newExtends == null // no source-level "extends" -> investige implicit (binding-level) extends:
&& newSuperclass != null // either implicit super (j.l.Object or o.o.Team) or inherited from other tsuper
&& !refineToTeam // an implicit extends to org.objectteams.Team is NOT dropped if the tsuper was not a team
- && ((newSuperclass.id == TypeIds.T_JavaLangObject) || destScope.isOrgObjectteamsTeam(newSuperclass))) // otherwise it was copied from a tsuper role
+ && ((newSuperclass.id == TypeIds.T_JavaLangObject) || newSuperclass.id == IOTConstants.T_OrgObjectTeamsTeam)) // otherwise it was copied from a tsuper role
{
newSuperclass = null; // drop default 'extends java.lang.Object' or o.o.Team
}
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 dae4504..6ee3afd 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
@@ -57,6 +57,7 @@
import org.eclipse.jdt.internal.compiler.lookup.TypeIds;
import org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding;
import org.eclipse.objectteams.otdt.core.compiler.IOTConstants;
+import org.eclipse.objectteams.otdt.core.compiler.OTNameUtils;
import org.eclipse.objectteams.otdt.core.exceptions.InternalCompilerError;
import org.eclipse.objectteams.otdt.internal.core.compiler.ast.TypeAnchorReference;
import org.eclipse.objectteams.otdt.internal.core.compiler.control.Config;
@@ -775,15 +776,8 @@
*/
public static boolean isTopConfined(ReferenceBinding type) {
- char[][] compoundName= type.compoundName;
- if ( compoundName.length == 3
- && ( CharOperation.equals(compoundName, IOTConstants.ORG_OBJECTTEAMS_ICONFINED)
- || CharOperation.equals(compoundName, IOTConstants.ORG_OBJECTTEAMS_ITEAM_ICONFINED)
- || CharOperation.equals(compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_CONFINED)
- || CharOperation.equals(compoundName, IOTConstants.ORG_OBJECTTEAMS_TEAM_OTCONFINED)))
- {
+ if (OTNameUtils.isPredefinedConfined(type))
return true;
- }
char[] name= type.internalName();
return type.isRole()
&& ( CharOperation.equals(name, IOTConstants.ICONFINED)