### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v retrieving revision 1.631.2.16 diff -u -r1.631.2.16 GenericTypeTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 16 May 2008 15:50:41 -0000 1.631.2.16 +++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 16 May 2008 22:49:26 -0000 @@ -41299,4 +41299,66 @@ }, ""); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=225737 +public void test1333() { + this.runConformTest( + new String[] { + "X.java", // ================= + "import java.util.ArrayList;\n" + + "import java.util.List;\n" + + "public class X extends AbstractProject {\n" + + " public void testBug() {\n" + + " // javac compiles the following line without complaining\n" + + " BuildStepDescriptor.filter(BuildStep.PUBLISHERS, getClass());\n" + + " }\n" + + " \n" + + " public static void main(String[] args) {\n" + + " new X().testBug();\n" + + " }\n" + + "}\n" + + "interface BuildStep {\n" + + " public static final PublisherList PUBLISHERS = new PublisherList();\n" + + "}\n" + + "\n" + + "@SuppressWarnings(\"serial\")\n" + + "class PublisherList extends ArrayList> {\n" + + "}\n" + + "abstract class Publisher implements BuildStep, Describable {\n" + + "}\n" + + "interface Describable> {\n" + + "}\n" + + "abstract class Descriptor> {\n" + + "}\n" + + "abstract class BuildStepDescriptor> extends Descriptor {\n" + + " \n" + + " public static > List> filter(\n" + + " List> base,\n" + + " Class> type) {\n" + + " return null;\n" + + " }\n" + + "}\n" + + "abstract class AbstractProject

, R> {\n" + + "}\n", // ================= + }, + ""); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=225737 - variation +public void test1334() { + this.runConformTest( + new String[] { + "X.java", // ================= + "public class X extends AbstractProject {\n" + + " public void testBug() {\n" + + " filter(getClass());//1\n" + + " filter(this.getClass());//2\n" + + " filter(X.class);//3\n" + + " }\n" + + " public static void filter(Class> type) {\n" + + " }\n" + + "}\n" + + "abstract class AbstractProject

, R> {\n" + + "}\n", // ================= + }, + ""); +} } #P org.eclipse.jdt.core Index: buildnotes_jdt-core.html =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v retrieving revision 1.5933.2.90 diff -u -r1.5933.2.90 buildnotes_jdt-core.html --- buildnotes_jdt-core.html 16 May 2008 15:50:32 -0000 1.5933.2.90 +++ buildnotes_jdt-core.html 16 May 2008 22:49:52 -0000 @@ -55,7 +55,9 @@

What's new in this drop

Problem Reports Fixed

-231861 +225737 +[compiler][1.5] Generics - JDT cannot compile hudson-core when javac can +
231861 [1.5][compiler] Generics: problem with partial generics
228291 [1.5][compiler] Incorrect unsafe warning for casting complex but static types. Index: compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java,v retrieving revision 1.310.2.6 diff -u -r1.310.2.6 Scope.java --- compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 23 Apr 2008 18:24:28 -0000 1.310.2.6 +++ compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java 16 May 2008 22:50:05 -0000 @@ -1817,6 +1817,13 @@ invocationSite.setDepth(depth); invocationSite.setActualReceiverType(receiverType); } + // special treatment for Object.getClass() in 1.5 mode (substitute parameterized return type) + if (receiverType.id != T_JavaLangObject + && argumentTypes == Binding.NO_PARAMETERS + && CharOperation.equals(selector, GETCLASS) + && methodBinding.returnType.isParameterizedType()/*1.5*/) { + return ParameterizedMethodBinding.instantiateGetClass(receiverType, methodBinding, this); + } return methodBinding; }