Lines 134-142
Link Here
|
134 |
if (originalInherited.returnType != currentMethod.returnType) { |
134 |
if (originalInherited.returnType != currentMethod.returnType) { |
135 |
// if (currentMethod.returnType.needsUncheckedConversion(inheritedMethod.returnType)) { |
135 |
// if (currentMethod.returnType.needsUncheckedConversion(inheritedMethod.returnType)) { |
136 |
// problemReporter(currentMethod).unsafeReturnTypeOverride(currentMethod, originalInherited, this.type); |
136 |
// problemReporter(currentMethod).unsafeReturnTypeOverride(currentMethod, originalInherited, this.type); |
137 |
if (inheritedMethod.returnType.leafComponentType().isParameterizedType()) { |
137 |
if (inheritedMethod.returnType.leafComponentType().isParameterizedType() && currentMethod.returnType.leafComponentType().isRawType()) { |
138 |
if (currentMethod.returnType.leafComponentType().isRawType()) |
138 |
problemReporter(currentMethod).unsafeReturnTypeOverride(currentMethod, originalInherited, this.type); |
139 |
problemReporter(currentMethod).unsafeReturnTypeOverride(currentMethod, originalInherited, this.type); |
|
|
140 |
} else if (inheritedMethod.hasSubstitutedReturnType() && originalInherited.returnType.leafComponentType().isTypeVariable()) { |
139 |
} else if (inheritedMethod.hasSubstitutedReturnType() && originalInherited.returnType.leafComponentType().isTypeVariable()) { |
141 |
if (((TypeVariableBinding) originalInherited.returnType.leafComponentType()).declaringElement == originalInherited) { // see 81618 - type variable from inherited method |
140 |
if (((TypeVariableBinding) originalInherited.returnType.leafComponentType()).declaringElement == originalInherited) { // see 81618 - type variable from inherited method |
142 |
TypeBinding currentReturnType = currentMethod.returnType.leafComponentType(); |
141 |
TypeBinding currentReturnType = currentMethod.returnType.leafComponentType(); |
Lines 527-533
Link Here
|
527 |
int inheritedLength = inheritedTypeVariables.length; |
526 |
int inheritedLength = inheritedTypeVariables.length; |
528 |
TypeVariableBinding[] typeVariables = currentMethod.typeVariables; |
527 |
TypeVariableBinding[] typeVariables = currentMethod.typeVariables; |
529 |
int length = typeVariables.length; |
528 |
int length = typeVariables.length; |
530 |
if (length > 0 && inheritedLength != length) return inheritedMethod; |
529 |
if (length > 0 && inheritedLength != length) return inheritedMethod; // no match JLS 8.4.2 |
531 |
TypeBinding[] arguments = new TypeBinding[inheritedLength]; |
530 |
TypeBinding[] arguments = new TypeBinding[inheritedLength]; |
532 |
if (inheritedLength <= length) { |
531 |
if (inheritedLength <= length) { |
533 |
System.arraycopy(typeVariables, 0, arguments, 0, inheritedLength); |
532 |
System.arraycopy(typeVariables, 0, arguments, 0, inheritedLength); |