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 / +21 lines)
Lines 32-37 Link Here
32
	 * parameters.
32
	 * parameters.
33
	 */
33
	 */
34
	protected String[] parameterTypes;
34
	protected String[] parameterTypes;
35
	protected String [] erasedParamaterTypes; // lazily initialized via call to getErasedParameterTypes
36
	
35
	/**
37
	/**
36
	 * The parameter names for the method.
38
	 * The parameter names for the method.
37
	 */
39
	 */
Lines 52-58 Link Here
52
}
54
}
53
public boolean equals(Object o) {
55
public boolean equals(Object o) {
54
	if (!(o instanceof BinaryMethod)) return false;
56
	if (!(o instanceof BinaryMethod)) return false;
55
	return super.equals(o) && Util.equalArraysOrNull(this.parameterTypes, ((BinaryMethod)o).parameterTypes);
57
	return super.equals(o) && Util.equalArraysOrNull(getErasedParameterTypes(), ((BinaryMethod)o).getErasedParameterTypes());
56
}
58
}
57
public IAnnotation[] getAnnotations() throws JavaModelException {
59
public IAnnotation[] getAnnotations() throws JavaModelException {
58
	IBinaryMethod info = (IBinaryMethod) getElementInfo();
60
	IBinaryMethod info = (IBinaryMethod) getElementInfo();
Lines 372-377 Link Here
372
	return this.parameterTypes;
374
	return this.parameterTypes;
373
}
375
}
374
376
377
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=299384
378
private String [] getErasedParameterTypes() {
379
	if (this.erasedParamaterTypes == null) {
380
		int paramCount = this.parameterTypes.length;
381
		this.erasedParamaterTypes = new String [paramCount];
382
		for (int i = 0; i < paramCount; i++) {
383
			String parameterType = this.parameterTypes[i];
384
			this.erasedParamaterTypes[i] = parameterType.indexOf(Signature.C_GENERIC_START, 0) >= 0 ?
385
					new String(Signature.getTypeErasure(parameterType.toCharArray())) : parameterType;
386
		}
387
	}
388
	return this.erasedParamaterTypes;
389
}
390
private String getErasedParameterType(int index) {
391
	return getErasedParameterTypes()[index];
392
}
393
375
public ITypeParameter getTypeParameter(String typeParameterName) {
394
public ITypeParameter getTypeParameter(String typeParameterName) {
376
	return new TypeParameter(this, typeParameterName);
395
	return new TypeParameter(this, typeParameterName);
377
}
396
}
Lines 446-452 Link Here
446
public int hashCode() {
465
public int hashCode() {
447
   int hash = super.hashCode();
466
   int hash = super.hashCode();
448
	for (int i = 0, length = this.parameterTypes.length; i < length; i++) {
467
	for (int i = 0, length = this.parameterTypes.length; i < length; i++) {
449
	    hash = Util.combineHashCodes(hash, this.parameterTypes[i].hashCode());
468
	    hash = Util.combineHashCodes(hash, getErasedParameterType(i).hashCode());
450
	}
469
	}
451
	return hash;
470
	return hash;
452
}
471
}
(-)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