diff options
author | Stephan Herrmann | 2016-04-30 23:05:23 +0000 |
---|---|---|
committer | Stephan Herrmann | 2016-04-30 23:05:23 +0000 |
commit | f038ec020dfc63fba22a525f169e5b7ace4cc72f (patch) | |
tree | 08d3a667a2a1d8f9bcaef555a98ea2cc6b69b57f /org.eclipse.jdt.core | |
parent | 95490857e8b26fb111d87ceae904616bddb0c0ad (diff) | |
download | org.eclipse.objectteams-f038ec020dfc63fba22a525f169e5b7ace4cc72f.tar.gz org.eclipse.objectteams-f038ec020dfc63fba22a525f169e5b7ace4cc72f.tar.xz org.eclipse.objectteams-f038ec020dfc63fba22a525f169e5b7ace4cc72f.zip |
Bug 492691: [otdre] callout-to-field confusion
Diffstat (limited to 'org.eclipse.jdt.core')
4 files changed, 18 insertions, 8 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java index ec587053f..11374367d 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/OTSpecialAccessAttribute.java @@ -219,10 +219,10 @@ public class OTSpecialAccessAttribute extends AbstractAttribute { public String toString() { StringBuilder result = new StringBuilder(); result.append(this.field.readableName()); - if ((this.flags & CALLOUT_GET_FIELD) != 0) - result.append(" get"); - else + if ((this.flags & CALLOUT_SET_FIELD) != 0) result.append(" set"); + else + result.append(" get"); if ((this.flags & CALLOUT_STATIC_FIELD) != 0) result.append(" (static)"); return result.toString(); diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java index d0baf94b7..9845fde7b 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/bytecode/WordValueAttribute.java @@ -264,6 +264,12 @@ public class WordValueAttribute } } + private static WeavingScheme weavingSchemeFromCompilerVersion(int version) { + if ((version & OTDRE_FLAG) != 0) + return WeavingScheme.OTDRE; + return WeavingScheme.OTRE; + } + // ============== INSTANCE FEATURES =================== @@ -357,9 +363,9 @@ public class WordValueAttribute checkBindingMismatch(binding, 0); BinaryTypeBinding type = (BinaryTypeBinding)binding; if (type.isRole()) - type.roleModel._compilerVersion = this._value; + type.roleModel.setCompilerVersion(this._value, weavingSchemeFromCompilerVersion(this._value)); if (type.isTeam()) - type.getTeamModel()._compilerVersion = this._value; + type.getTeamModel().setCompilerVersion(this._value, weavingSchemeFromCompilerVersion(this._value)); if (this._value < IOTConstants.OTVersion.getCompilerVersionMin()) environment.problemReporter.incompatibleOTJByteCodeVersion(((BinaryTypeBinding)binding).getFileName(), getBytecodeVersionString(this._value)); if ((type.isRole() || type.isTeam()) 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 23a5cc766..0e7d91bdb 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 @@ -1,7 +1,7 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software * - * Copyright 2004, 2014 Fraunhofer Gesellschaft, Munich, Germany, + * Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. @@ -1007,7 +1007,7 @@ public class TeamModel extends TypeModel { /** Update all recorded accessIds to stay clear of id ranges used by super teams. */ public int updateDecapsAccessIds() { - if (this.accessIdOffset > -1 || this.weavingScheme != WeavingScheme.OTDRE) return this.accessIdOffset; + if (this.accessIdOffset > -1 || getWeavingScheme() != WeavingScheme.OTDRE) return this.accessIdOffset; this.accessIdOffset = 0; diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java index e0abbee1c..5580844a6 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/TypeModel.java @@ -1,7 +1,7 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software * - * Copyright 2004, 2014 Fraunhofer Gesellschaft, Munich, Germany, + * Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. @@ -115,6 +115,10 @@ public class TypeModel extends ModelElement { WeavingScheme weavingScheme; + public void setCompilerVersion(int version, WeavingScheme weavingScheme) { + this._compilerVersion = version; + this.weavingScheme = weavingScheme; + } public void setBinding (ReferenceBinding binding) { this._binding = binding; |