### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java =================================================================== --- compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (revision 1735) +++ compiler/org/eclipse/jdt/internal/compiler/parser/Parser.java (working copy) @@ -6745,6 +6745,9 @@ 0, // dims (((long)typeExpr.sourceStart)<<32)+typeExpr.sourceEnd); RoleClassLiteralAccess literal = new RoleClassLiteralAccess(typeRef); + this.intPtr--; // discard start of '.class' + literal.sourceEnd = this.intStack[this.intPtr--]; + this.intPtr--; // discard start of type arguments ('<') pushOnExpressionStack(literal); } // SH} #P org.eclipse.objectteams.otdt.tests Index: otjld/org/eclipse/objectteams/otdt/tests/otjld/api/Reflection.java =================================================================== --- otjld/org/eclipse/objectteams/otdt/tests/otjld/api/Reflection.java (revision 1732) +++ otjld/org/eclipse/objectteams/otdt/tests/otjld/api/Reflection.java (working copy) @@ -946,6 +946,34 @@ null/*no custom requestor*/); } + // getRole(Object) called + // Bug 351317 - Error in (redundant) cast of anchored type + public void test923_getRoleMethod4() { + + runConformTest( + new String[] { + "Team923grm4.java", + "\n" + + "public team class Team923grm4 {\n" + + " public class R playedBy T923grm4 {\n" + + " public String toString() { return \"OK\"; }\n" + + " }\n" + + " Team923grm4(T923grm4 as R o) {}\n" + + " public static void main (String[] args0) {\n" + + " T923grm4 o = new T923grm4();\n" + + " final Team923grm4 t = new Team923grm4(o);\n" + + " R<@t> r = (R<@t>) t.getRole(o, R<@t>.class);\n" + + " System.out.print(r);\n" + + " }\n" + + "} \n" + + " \n", + "T923grm4.java", + "\n" + + "public class T923grm4 {}\n" + }, + "OK"); + } + // a replace callin tests the reflective function isExecutingCallin // 9.2.4-otjld-is-executing-callin-called-1 public void test924_isExecutingCallinCalled1() {