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

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/BinaryMethod.java (-2 / +16 lines)
Lines 52-58 Link Here
52
}
52
}
53
public boolean equals(Object o) {
53
public boolean equals(Object o) {
54
	if (!(o instanceof BinaryMethod)) return false;
54
	if (!(o instanceof BinaryMethod)) return false;
55
	return super.equals(o) && Util.equalArraysOrNull(this.parameterTypes, ((BinaryMethod)o).parameterTypes);
55
	return super.equals(o) && Util.equalArraysOrNull(getErasedParameterTypes(), ((BinaryMethod)o).getErasedParameterTypes());
56
}
56
}
57
public IAnnotation[] getAnnotations() throws JavaModelException {
57
public IAnnotation[] getAnnotations() throws JavaModelException {
58
	IBinaryMethod info = (IBinaryMethod) getElementInfo();
58
	IBinaryMethod info = (IBinaryMethod) getElementInfo();
Lines 372-377 Link Here
372
	return this.parameterTypes;
372
	return this.parameterTypes;
373
}
373
}
374
374
375
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=299384
376
private String [] getErasedParameterTypes() {
377
	int paramCount = this.parameterTypes.length;
378
	String [] erasedTypes = new String [paramCount];
379
	for (int i = 0; i < paramCount; i++) {
380
		String parameterType = this.parameterTypes[i];
381
		erasedTypes[i] = parameterType.indexOf(Signature.C_GENERIC_START, 0) >= 0 ?
382
				new String(Signature.getTypeErasure(parameterType.toCharArray())) : parameterType;
383
	}
384
	return erasedTypes;
385
}
386
375
public ITypeParameter getTypeParameter(String typeParameterName) {
387
public ITypeParameter getTypeParameter(String typeParameterName) {
376
	return new TypeParameter(this, typeParameterName);
388
	return new TypeParameter(this, typeParameterName);
377
}
389
}
Lines 446-452 Link Here
446
public int hashCode() {
458
public int hashCode() {
447
   int hash = super.hashCode();
459
   int hash = super.hashCode();
448
	for (int i = 0, length = this.parameterTypes.length; i < length; i++) {
460
	for (int i = 0, length = this.parameterTypes.length; i < length; i++) {
449
	    hash = Util.combineHashCodes(hash, this.parameterTypes[i].hashCode());
461
		String parameterType = this.parameterTypes[i];
462
		hash = Util.combineHashCodes(hash,  parameterType.indexOf(Signature.C_GENERIC_START, 0) >= 0 ?
463
				new String(Signature.getTypeErasure(parameterType.toCharArray())).hashCode() : parameterType.hashCode());
450
	}
464
	}
451
	return hash;
465
	return hash;
452
}
466
}
(-)src/org/eclipse/jdt/core/tests/model/ResolveTests.java (-2 / +2 lines)
Lines 2610-2616 Link Here
2610
	);
2610
	);
2611
}
2611
}
2612
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=299384
2612
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=299384
2613
public void _testCodeSelectInHybrid1415Projects() throws CoreException, IOException {
2613
public void testCodeSelectInHybrid1415Projects() throws CoreException, IOException {
2614
	String jarName = "bug299384.jar";
2614
	String jarName = "bug299384.jar";
2615
	String srcName = "bug299384_src.zip";
2615
	String srcName = "bug299384_src.zip";
2616
	try {
2616
	try {
Lines 2641-2647 Link Here
2641
2641
2642
		assertElementsEqual(
2642
		assertElementsEqual(
2643
			"Unexpected elements",
2643
			"Unexpected elements",
2644
			"TestSuite(java.lang.Class<? extends TestCase>) [in TestSuite [in TestSuite.class [in <default> [in bug299384.jar [in Resolve]]]]]",
2644
			"TestSuite(java.lang.Class) [in TestSuite [in TestSuite.class [in <default> [in bug299384.jar [in Resolve]]]]]",
2645
			elements
2645
			elements
2646
		);
2646
		);
2647
	} finally {
2647
	} finally {

Return to bug 299384