View | Details | Raw Unified | Return to bug 225737 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (+62 lines)
Lines 41299-41302 Link Here
41299
			},
41299
			},
41300
			"");
41300
			"");
41301
}
41301
}
41302
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=225737
41303
public void test1333() {
41304
	this.runConformTest(
41305
			new String[] {
41306
				"X.java", // =================
41307
				"import java.util.ArrayList;\n" + 
41308
				"import java.util.List;\n" + 
41309
				"public class X extends AbstractProject<X, Object> {\n" + 
41310
				"	public void testBug() {\n" + 
41311
				"		// javac compiles the following line without complaining\n" + 
41312
				"		BuildStepDescriptor.filter(BuildStep.PUBLISHERS, getClass());\n" + 
41313
				"	}\n" + 
41314
				"	\n" + 
41315
				"	public static void main(String[] args) {\n" + 
41316
				"		new X().testBug();\n" + 
41317
				"	}\n" + 
41318
				"}\n" + 
41319
				"interface BuildStep {\n" + 
41320
				"	public static final PublisherList PUBLISHERS = new PublisherList();\n" + 
41321
				"}\n" + 
41322
				"\n" + 
41323
				"@SuppressWarnings(\"serial\")\n" + 
41324
				"class PublisherList extends ArrayList<Descriptor<Publisher>> {\n" + 
41325
				"}\n" + 
41326
				"abstract class Publisher implements BuildStep, Describable<Publisher> {\n" + 
41327
				"}\n" + 
41328
				"interface Describable<T extends Describable<T>> {\n" + 
41329
				"}\n" + 
41330
				"abstract class Descriptor<T extends Describable<T>> {\n" + 
41331
				"}\n" + 
41332
				"abstract class BuildStepDescriptor<T extends BuildStep & Describable<T>> extends Descriptor<T> {\n" + 
41333
				"	\n" + 
41334
				"	public static <T extends BuildStep & Describable<T>> List<Descriptor<T>> filter(\n" + 
41335
				"			List<Descriptor<T>> base,\n" + 
41336
				"			Class<? extends AbstractProject<?, ?>> type) {\n" + 
41337
				"		return null;\n" + 
41338
				"	}\n" + 
41339
				"}\n" + 
41340
				"abstract class AbstractProject<P extends AbstractProject<P, R>, R> {\n" + 
41341
				"}\n", // =================
41342
			},
41343
			"");
41344
}
41345
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=225737 - variation
41346
public void test1334() {
41347
	this.runConformTest(
41348
			new String[] {
41349
				"X.java", // =================
41350
				"public class X extends AbstractProject<X, Object> {\n" + 
41351
				"	public void testBug() {\n" + 
41352
				"		filter(getClass());//1\n" + 
41353
				"		filter(this.getClass());//2\n" + 
41354
				"		filter(X.class);//3\n" + 
41355
				"	}\n" + 
41356
				"	public static void filter(Class<? extends AbstractProject<?, ?>> type) {\n" + 
41357
				"	}\n" + 
41358
				"}\n" + 
41359
				"abstract class AbstractProject<P extends AbstractProject<P, R>, R> {\n" + 
41360
				"}\n", // =================
41361
			},
41362
			"");
41363
}
41302
}
41364
}
(-)buildnotes_jdt-core.html (-1 / +3 lines)
Lines 55-61 Link Here
55
<h2>What's new in this drop</h2>
55
<h2>What's new in this drop</h2>
56
56
57
<h3>Problem Reports Fixed</h3>
57
<h3>Problem Reports Fixed</h3>
58
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=231861">231861</a>
58
<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=225737">225737</a>
59
[compiler][1.5] Generics - JDT cannot compile hudson-core when javac can
60
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=231861">231861</a>
59
[1.5][compiler] Generics: problem with partial generics
61
[1.5][compiler] Generics: problem with partial generics
60
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=228291">228291</a>
62
<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=228291">228291</a>
61
[1.5][compiler] Incorrect unsafe warning for casting complex but static types.
63
[1.5][compiler] Incorrect unsafe warning for casting complex but static types.
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java (+7 lines)
Lines 1817-1822 Link Here
1817
											invocationSite.setDepth(depth);
1817
											invocationSite.setDepth(depth);
1818
											invocationSite.setActualReceiverType(receiverType);
1818
											invocationSite.setActualReceiverType(receiverType);
1819
										}
1819
										}
1820
										// special treatment for Object.getClass() in 1.5 mode (substitute parameterized return type)
1821
										if (receiverType.id != T_JavaLangObject
1822
											&& argumentTypes == Binding.NO_PARAMETERS
1823
										    && CharOperation.equals(selector, GETCLASS)
1824
										    && methodBinding.returnType.isParameterizedType()/*1.5*/) {
1825
												return ParameterizedMethodBinding.instantiateGetClass(receiverType, methodBinding, this);
1826
										}										
1820
										return methodBinding;
1827
										return methodBinding;
1821
									}
1828
									}
1822
1829

Return to bug 225737