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 |
} |