You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Override
public boolean isGenerics() {
for (CtTypeParameter ref : formalCtTypeParameters) {
if (ref.isGenerics()) {
return true;
}
}
return false;
}
Here is an example: class A <T> { /* ... */ }
CtType<?> a = model.getAllTypes().stream().filter(t -> t.getSimpleName().equals("A")).findFirst().get();
a.isGenerics() // => false (I think it should be true)
WDYT?
The text was updated successfully, but these errors were encountered:
Reading again the specification of the method in the Javadoc (improved in #2990):
isGenerics(): Returns true if it refers to a type parameter (ie not a concrete class, eg "T foo"). It can refer to it directly (eg T), or indirectly (eg List<T>, or Set<List<T>>).
isGenerics()
method always returns false when called on a top-level type (even if it has generic parameters):spoon/src/main/java/spoon/support/reflect/declaration/CtTypeImpl.java
Lines 536 to 539 in 151176f
I think it should be something like this instead:
Here is an example:
class A <T> { /* ... */ }
WDYT?
The text was updated successfully, but these errors were encountered: