summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2018-08-07 17:37:23 -0400
committerStephan Herrmann2018-08-07 17:37:23 -0400
commitcc87f1eabbb8cd15af5595d040afb2598902a75a (patch)
treefdf5e66c4c61bf4211c2824a97b0fef6d8abb847
parentbffa480010e36f8e498b11130836782ffca09566 (diff)
downloadorg.eclipse.objectteams-cc87f1eabbb8cd15af5595d040afb2598902a75a.tar.gz
org.eclipse.objectteams-cc87f1eabbb8cd15af5595d040afb2598902a75a.tar.xz
org.eclipse.objectteams-cc87f1eabbb8cd15af5595d040afb2598902a75a.zip
Bug 537772 - Attribute OTCompilerVersion should not be set for o.o.Team
- the same for roles of o.o.Team, too.
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java8
2 files changed, 5 insertions, 6 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
index ccd45037d..1b4ca3485 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
@@ -211,7 +211,8 @@ public class RoleModel extends TypeModel
public RoleModel (TypeDeclaration roleAst)
{
super(roleAst);
- addAttribute(WordValueAttribute.compilerVersionAttribute());
+ if (!TeamModel.isOrgObjectteamsTeam(roleAst.enclosingType))
+ addAttribute(WordValueAttribute.compilerVersionAttribute());
if (roleAst.scope != null && roleAst.scope.parent instanceof MethodScope)
this._isLocalType = true;
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java
index 825d7bef4..32e4f209e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TeamModel.java
@@ -36,7 +36,6 @@ import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions.WeavingScheme;
import org.eclipse.jdt.internal.compiler.impl.IntConstant;
import org.eclipse.jdt.internal.compiler.lookup.Binding;
-import org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
@@ -128,10 +127,9 @@ public class TeamModel extends TypeModel {
if (Config.clientIsBatchCompiler())
this.knownRoleFiles = new RoleFileCache(teamAst);
}
- private static boolean isOrgObjectteamsTeam(TypeDeclaration teamAst) {
- ClassScope scope = teamAst.scope;
- if (scope != null) {
- return TypeAnalyzer.isOrgObjectteamsTeam(scope.referenceCompilationUnit());
+ static boolean isOrgObjectteamsTeam(TypeDeclaration typeAst) {
+ if (typeAst != null && typeAst.scope != null) {
+ return TypeAnalyzer.isOrgObjectteamsTeam(typeAst.scope.referenceCompilationUnit());
}
return false;
}