My understanding is similar to yours. If isUsingGenerics() returns true it
means that calling getGenericsTypes() is safe and should return a useful
value. If ResolveVisitor finds any occurrence of generics then I believe it
sets the flag and ensures the generics types are set correctly. It means
that processing can be more efficient in some places for nodes with no
generics. As to whether the efficiency saving is worth it these days or
whether it is used consistently everywhere, I couldn't be sure without
checking all usages.


On Thu, Sep 12, 2019 at 2:33 AM Milles, Eric (TR Tech, Content & Ops) <
eric.mil...@thomsonreuters.com> wrote:

> I was looking into a few bugs related to generics (and inner classes) and
> ran into ClassNode.isUsingGenerics() not behaving as expected.  I thought
> it was an indicator that ClassNode.getGenericsTypes() would not return null
> or that the class itself is a generics placeholder type.  However,
> ResolveVisitor is setting this flag for any appearance of generics within
> the class definition.
>
> Is there a known purpose of ClassNode.isUsingGenerics()?  Or is it
> outdated and should not be called anymore?
>

Reply via email to