Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 219625
Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/MethodVerifyTest.java (-1 / +36 lines)
Lines 8203-8206 Link Here
8203
		"#method3(D1<String>, D1<String>, D1<java.util.Date>, D1[])#method3(D1<String>, D1<String>, D1<java.util.Date>, D2[])");
8203
		"#method3(D1<String>, D1<String>, D1<java.util.Date>, D1[])#method3(D1<String>, D1<String>, D1<java.util.Date>, D2[])");
8204
}	
8204
}	
8205
8205
8206
}
8206
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=219625
8207
public void test152() {
8208
	this.runConformTest(
8209
		new String[] {
8210
			"X.java",
8211
			"public class X {\n" +
8212
			"	static <T> void feedFoosValueIntoFoo(Foo<T> foo) {\n" +
8213
			"		foo.doSomething(foo.getValue());\n" +
8214
			"	}\n" +
8215
			"	static void testTypedString() {\n" +
8216
			"		ConcreteFoo foo = new ConcreteFoo();\n" +
8217
			"		foo.doSomething(foo.getValue());\n" +
8218
			"	}\n" +
8219
			"	static void testGenericString() {\n" +
8220
			"		feedFoosValueIntoFoo(new ConcreteFoo());\n" +
8221
			"	}\n" +
8222
			"	public static void main(String[] args) {\n" +
8223
			"		testTypedString();\n" +
8224
			"		testGenericString();\n" +
8225
			"		System.out.print(1);\n" +
8226
			"	}\n" +
8227
			"}\n" +
8228
			"interface Foo<T> {\n" +
8229
			"	T getValue();\n" +
8230
			"	void doSomething(T o);\n" +
8231
			"}\n" +
8232
			"abstract class AbstractFoo<T> implements Foo<T> {\n" +
8233
			"	public void doSomething(String o) {}\n" +
8234
			"}\n" +
8235
			"class ConcreteFoo extends AbstractFoo<String> {\n" +
8236
			"	public String getValue() { return null; }\n" +
8237
			"}"
8238
		},
8239
		"1"
8240
	);
8241
}}
(-)compiler/org/eclipse/jdt/internal/compiler/lookup/MethodVerifier15.java (-4 / +5 lines)
Lines 123-131 Link Here
123
			}
123
			}
124
		}
124
		}
125
		// check whether bridge method is already defined above for interface methods
125
		// check whether bridge method is already defined above for interface methods
126
		if (originalInherited.declaringClass.isInterface()
126
		if (originalInherited.declaringClass.isInterface()) {
127
				&& this.type.superclass.erasure().findSuperTypeOriginatingFrom(originalInherited.declaringClass) == null) {
127
			if ((concreteMethod.declaringClass == this.type.superclass && this.type.superclass.isParameterizedType())
128
			this.type.addSyntheticBridgeMethod(originalInherited, concreteMethod.original());
128
				|| this.type.superclass.erasure().findSuperTypeOriginatingFrom(originalInherited.declaringClass) == null)
129
					this.type.addSyntheticBridgeMethod(originalInherited, concreteMethod.original());
129
		}
130
		}
130
	}
131
	}
131
}
132
}
Lines 703-709 Link Here
703
	inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
704
	inheritedMethod = computeSubstituteMethod(inheritedMethod, existingMethod);
704
	return inheritedMethod != null
705
	return inheritedMethod != null
705
		&& inheritedMethod.returnType == existingMethod.returnType // keep around to produce bridge methods
706
		&& inheritedMethod.returnType == existingMethod.returnType // keep around to produce bridge methods
706
		&& super.isInterfaceMethodImplemented(inheritedMethod, existingMethod, superType);
707
		&& doesMethodOverride(existingMethod, inheritedMethod);
707
}
708
}
708
public boolean isMethodSubsignature(MethodBinding method, MethodBinding inheritedMethod) {
709
public boolean isMethodSubsignature(MethodBinding method, MethodBinding inheritedMethod) {
709
	if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector))
710
	if (!org.eclipse.jdt.core.compiler.CharOperation.equals(method.selector, inheritedMethod.selector))

Return to bug 219625