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

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/dom/BatchASTCreationTests.java (-1 / +1 lines)
Lines 1655-1661 Link Here
1655
	}
1655
	}
1656
	
1656
	
1657
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159631
1657
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=159631
1658
public void _test073() throws CoreException, IOException {
1658
public void test073() throws CoreException, IOException {
1659
	try {
1659
	try {
1660
		IJavaProject project = createJavaProject("P072", new String[] {}, Util.getJavaClassLibs(), "", "1.5");
1660
		IJavaProject project = createJavaProject("P072", new String[] {}, Util.getJavaClassLibs(), "", "1.5");
1661
		ICompilationUnit compilationUnits[] = new ICompilationUnit[3]; 
1661
		ICompilationUnit compilationUnits[] = new ICompilationUnit[3]; 
(-)src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (-6 / +1 lines)
Lines 708-719 Link Here
708
				"abstract class X2 extends A implements J {}\n"
708
				"abstract class X2 extends A implements J {}\n"
709
			},
709
			},
710
			"----------\n" + 
710
			"----------\n" + 
711
			"1. ERROR in A.java (at line 1)\r\n" + 
711
			"1. ERROR in A.java (at line 2)\r\n" + 
712
			"	abstract class A implements I {}\r\n" + 
713
			"	               ^\n" + 
714
			"The return type is incompatible with J.foo(), I.foo()\n" + 
715
			"----------\n" + 
716
			"2. ERROR in A.java (at line 2)\r\n" + 
717
			"	interface I extends J { Object foo(); }\r\n" + 
712
			"	interface I extends J { Object foo(); }\r\n" + 
718
			"	                               ^^^^^\n" + 
713
			"	                               ^^^^^\n" + 
719
			"The return type is incompatible with J.foo()\n" + 
714
			"The return type is incompatible with J.foo()\n" + 
(-)src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java (-14 / +4 lines)
Lines 31231-31258 Link Here
31231
public void test0987() {
31231
public void test0987() {
31232
	String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
31232
	String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
31233
	?	"----------\n" + 
31233
	?	"----------\n" + 
31234
		"1. ERROR in X.java (at line 7)\n" + 
31234
		"1. ERROR in X.java (at line 11)\n" + 
31235
		"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + 
31236
		"	               ^^^^^^^^^^^^^^^^\n" + 
31237
		"The return type is incompatible with EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + 
31238
		"----------\n" + 
31239
		"2. ERROR in X.java (at line 11)\n" + 
31240
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31235
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31241
		"	                    ^^^^^^^^^^^\n" + 
31236
		"	                    ^^^^^^^^^^^\n" + 
31242
		"The return type is incompatible with EditPart.getViewer()\n" + 
31237
		"The return type is incompatible with EditPart.getViewer()\n" + 
31243
		"----------\n" + 
31238
		"----------\n" + 
31244
		"3. ERROR in X.java (at line 11)\n" + 
31239
		"2. ERROR in X.java (at line 11)\n" + 
31245
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31240
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31246
		"	                    ^^^^^^^^^^^\n" + 
31241
		"	                    ^^^^^^^^^^^\n" + 
31247
		"The method getViewer() of type AbstractLinkView<M> must override a superclass method\n" + 
31242
		"The method getViewer() of type AbstractLinkView<M> must override a superclass method\n" + 
31248
		"----------\n"
31243
		"----------\n"
31249
	:	"----------\n" + 
31244
	:	"----------\n" + 
31250
		"1. ERROR in X.java (at line 7)\n" + 
31245
		"1. ERROR in X.java (at line 11)\n" + 
31251
		"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + 
31252
		"	               ^^^^^^^^^^^^^^^^\n" + 
31253
		"The return type is incompatible with EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + 
31254
		"----------\n" + 
31255
		"2. ERROR in X.java (at line 11)\n" + 
31256
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31246
		"	public ISheetViewer getViewer() { return null; }	\n" + 
31257
		"	                    ^^^^^^^^^^^\n" + 
31247
		"	                    ^^^^^^^^^^^\n" + 
31258
		"The return type is incompatible with EditPart.getViewer()\n" + 
31248
		"The return type is incompatible with EditPart.getViewer()\n" + 
Lines 31344-31350 Link Here
31344
			"1. ERROR in X.java (at line 7)\n" + 
31334
			"1. ERROR in X.java (at line 7)\n" + 
31345
			"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + 
31335
			"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" + 
31346
			"	               ^^^^^^^^^^^^^^^^\n" + 
31336
			"	               ^^^^^^^^^^^^^^^^\n" + 
31347
			"The return type is incompatible with ILinkViewElement.getViewer(), AbstractEditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + 
31337
			"The return type is incompatible with AbstractEditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" + 
31348
			"----------\n" + 
31338
			"----------\n" + 
31349
			"2. ERROR in X.java (at line 11)\n" + 
31339
			"2. ERROR in X.java (at line 11)\n" + 
31350
			"	public SheetViewer getViewer() { return null; }	\n" + 
31340
			"	public SheetViewer getViewer() { return null; }	\n" + 
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AmbiguousMethodTest.java (-3 / +3 lines)
Lines 1242-1248 Link Here
1242
		"ERROR");
1242
		"ERROR");
1243
}
1243
}
1244
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
1244
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162073
1245
public void _test032() {
1245
public void test032() {
1246
	this.runConformTest(
1246
	this.runConformTest(
1247
		new String[] {
1247
		new String[] {
1248
			"X.java",
1248
			"X.java",
Lines 1309-1315 Link Here
1309
		"2. ERROR in X.java (at line 10)\n" + 
1309
		"2. ERROR in X.java (at line 10)\n" + 
1310
		"	public abstract class X implements J, K {\n" + 
1310
		"	public abstract class X implements J, K {\n" + 
1311
		"	                      ^\n" + 
1311
		"	                      ^\n" + 
1312
		"The return type is incompatible with I.foo(Number), K.foo(Number), J.foo(Number)\n" + 
1312
		"The return type is incompatible with K.foo(Number), J.foo(Number)\n" + 
1313
		"----------\n");
1313
		"----------\n");
1314
}
1314
}
1315
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
1315
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=162065
Lines 1369-1375 Link Here
1369
			"}\n" + 
1369
			"}\n" + 
1370
			"public abstract class X extends J implements I {\n" + 
1370
			"public abstract class X extends J implements I {\n" + 
1371
			"  void bar() {\n" + 
1371
			"  void bar() {\n" + 
1372
			"    foo(0.0f);\n" + // ambiguous
1372
			"    String s = foo(0.0f);\n" + // ambiguous
1373
			"  }\n" + 
1373
			"  }\n" + 
1374
			"}"
1374
			"}"
1375
		},
1375
		},
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java (-1 / +4 lines)
Lines 1430-1436 Link Here
1430
	return this.scope.referenceContext.sourceStart;
1430
	return this.scope.referenceContext.sourceStart;
1431
}
1431
}
1432
SimpleLookupTable storedAnnotations(boolean forceInitialize) {
1432
SimpleLookupTable storedAnnotations(boolean forceInitialize) {
1433
	if (forceInitialize && this.storedAnnotations == null) {
1433
	if (forceInitialize && this.storedAnnotations == null && 
1434
			this.scope != null) { 
1435
				// once scope is null, no more attempt to store annotations -
1436
				// as if the scope was present with storeAnnotations set to false
1434
		this.scope.referenceCompilationUnit().compilationResult.hasAnnotations = true;
1437
		this.scope.referenceCompilationUnit().compilationResult.hasAnnotations = true;
1435
		if (!this.scope.environment().globalOptions.storeAnnotations)
1438
		if (!this.scope.environment().globalOptions.storeAnnotations)
1436
			return null; // not supported during this compile
1439
			return null; // not supported during this compile
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java (-1 / +2 lines)
Lines 528-534 Link Here
528
528
529
	inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
529
	inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
530
	return inheritedMethod != null
530
	return inheritedMethod != null
531
		&& inheritedMethod.returnType == existingMethod.returnType
531
		&& (inheritedMethod.returnType == existingMethod.returnType ||
532
				inheritedMethod.returnType.isCompatibleWith(inheritedMethod.returnType))
532
		&& super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType);
533
		&& super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType);
533
}
534
}
534
SimpleSet findSuperinterfaceCollisions(ReferenceBinding superclass, ReferenceBinding[] superInterfaces) {
535
SimpleSet findSuperinterfaceCollisions(ReferenceBinding superclass, ReferenceBinding[] superInterfaces) {

Return to bug 162073