View | Details | Raw Unified | Return to bug 257384
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/ProblemTypeAndMethodTest.java (+44 lines)
Lines 4916-4919 Link Here
4916
			"Zork cannot be resolved to a type\n" + 
4916
			"Zork cannot be resolved to a type\n" + 
4917
			"----------\n");
4917
			"----------\n");
4918
}
4918
}
4919
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=257384
4920
public void test096() {
4921
	this.runNegativeTest(
4922
		new String[] {
4923
			"p2/B.java", // =================
4924
			"package p2;\n" + 
4925
			"import p1.A;\n" + 
4926
			"public abstract class B {\n" + 
4927
			"	public static A foo() {}\n" + 
4928
			"}\n",
4929
			"p3/C.java", // =================
4930
			"package p3;\n" + 
4931
			"import p1.A;\n" + 
4932
			"public abstract class C extends p2.B {\n" + 
4933
			"	public static A foo() {}\n" + 
4934
			"}\n",
4935
			"p/D.java", // =================
4936
			"package p;\n" + 
4937
			"public class D extends p3.C {}"
4938
		},
4939
		"----------\n" + 
4940
		"1. ERROR in p2\\B.java (at line 2)\n" + 
4941
		"	import p1.A;\n" + 
4942
		"	       ^^\n" + 
4943
		"The import p1 cannot be resolved\n" + 
4944
		"----------\n" + 
4945
		"2. ERROR in p2\\B.java (at line 4)\n" + 
4946
		"	public static A foo() {}\n" + 
4947
		"	              ^\n" + 
4948
		"A cannot be resolved to a type\n" + 
4949
		"----------\n" + 
4950
		"----------\n" + 
4951
		"1. ERROR in p3\\C.java (at line 2)\n" + 
4952
		"	import p1.A;\n" + 
4953
		"	       ^^\n" + 
4954
		"The import p1 cannot be resolved\n" + 
4955
		"----------\n" + 
4956
		"2. ERROR in p3\\C.java (at line 4)\n" + 
4957
		"	public static A foo() {}\n" + 
4958
		"	              ^\n" + 
4959
		"A cannot be resolved to a type\n" + 
4960
		"----------\n"
4961
	);
4962
}
4919
}
4963
}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier.java (+1 lines)
Lines 363-368 Link Here
363
	for (int i = 0; i < length; i++)
363
	for (int i = 0; i < length; i++)
364
		if (methods[i].isAbstract())
364
		if (methods[i].isAbstract())
365
			abstractMethods[index++] = methods[i];
365
			abstractMethods[index++] = methods[i];
366
	if (index == 0) return; // can happen with methods that contain 'equal' Missing Types, see bug 257384
366
	if (index < abstractMethods.length)
367
	if (index < abstractMethods.length)
367
		System.arraycopy(abstractMethods, 0, abstractMethods = new MethodBinding[index], 0, index);
368
		System.arraycopy(abstractMethods, 0, abstractMethods = new MethodBinding[index], 0, index);
368
	checkConcreteInheritedMethod(concreteMethod, abstractMethods);
369
	checkConcreteInheritedMethod(concreteMethod, abstractMethods);

Return to bug 257384