Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/TypeLevel.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java2
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java17
3 files changed, 18 insertions, 3 deletions
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 042c4eb68..8b112720a 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
@@ -387,7 +387,7 @@ public class TypeLevel {
&& newSuperclass.isDirectRole())
{
// check team compatibility
- if (!TeamModel.areCompatibleEnclosings(destTeam, newSuperclass.enclosingType()))
+ if (!TeamModel.areCompatibleEnclosings(destTeam, newSuperclass.original().enclosingType()))
{
destScope.problemReporter().extendIncompatibleEnclosingTypes(
destRoleDecl, newSuperclass, newSuperclass.enclosingType());
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java
index ffc1867af..b9872c5c7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/util/Protections.java
@@ -245,7 +245,7 @@ public class Protections implements ClassFileConstants, ExtraCompilerModifiers {
enclosing = enclosing.enclosingType();
}
}
- ReferenceBinding otherEnclosing = other.enclosingType();
+ ReferenceBinding otherEnclosing = other.original().enclosingType();
if (otherEnclosing == null)
return true;
ReferenceBinding thisEnclosing = binding.enclosingType();
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java
index 05586c57b..45141bd2a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/other/Java5.java
@@ -34,7 +34,7 @@ public class Java5 extends AbstractOTJLDTest {
// Static initializer to specify tests subset using TESTS_* static variables
// All specified tests which does not belong to the class are skipped...
static {
-// TESTS_NAMES = new String[] { "testA112_genericTeam3"};
+// TESTS_NAMES = new String[] { "testA112_genericTeam4"};
// TESTS_NUMBERS = new int[] { 1459 };
// TESTS_RANGE = new int[] { 1097, -1 };
}
@@ -3122,6 +3122,19 @@ public class Java5 extends AbstractOTJLDTest {
"----------\n",
"OK");
}
+
+ // Bug 394263 - Team with generic type parameter causes role inheritance error
+ public void testA112_genericTeam4() {
+ runConformTest(
+ new String[] {
+ "MyTeam.java",
+ "public team class MyTeam<T> { \n" +
+ " protected class MyRole {} \n" +
+ " protected class MySubRole extends MyRole {}\n" +
+ "}"
+ }
+ );
+ }
// a static method in a role file suppresses an nls warning
// Bug 321352 - [compiler][reconciler] reporting of non-externalized string constants in role files
@@ -5195,4 +5208,6 @@ public class Java5 extends AbstractOTJLDTest {
"}\n"
});
}
+
+
}

Back to the top