Skip to content

Commit

Permalink
Fix test0080 - generics vs raw vs parameterized
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker authored and robstryker committed Oct 14, 2024
1 parent d9c0beb commit dbbbe21
Showing 1 changed file with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -521,16 +521,32 @@ public boolean isAnnotationMember() {

@Override
public boolean isGenericMethod() {
return (isConstructor() && getDeclaringClass().isGenericType())
if( methodHasGenerics() ) {
return true;
}
// instead of the methodType, get a less typed Type and check if it is a ForAll
if( this.methodSymbol.type instanceof ForAll) {
return !methodMatchesParameterized();
}
return false;
}

private boolean methodHasGenerics() {
boolean b1 = (isConstructor() && getDeclaringClass().isGenericType())
|| (!this.methodSymbol.getTypeParameters().isEmpty() && isDeclaration);
// TODO instead of the methodType, get a less typed Type and check if it is a ForAll
return b1;
}

@Override
public boolean isParameterizedMethod() {
return !isGenericMethod() &&
((isConstructor() && getDeclaringClass().isParameterizedType())
|| (!this.methodSymbol.getTypeParameters().isEmpty() && !isDeclaration));
return !methodHasGenerics() && methodMatchesParameterized();
}

private boolean methodMatchesParameterized() {
return ((isConstructor() && getDeclaringClass().isParameterizedType())
|| (!this.methodSymbol.getTypeParameters().isEmpty() && !isDeclaration));
}

@Override
public boolean isRawMethod() {
if (isConstructor()) {
Expand Down

0 comments on commit dbbbe21

Please sign in to comment.