By type system, I mean a utility that can answer questions like this:
- is class
A a subclass of B?
- does method
A.m() override B.m()?
- list all methods from
A and superclasses (and interfaces), but from the set of overriding methods, only mention one (the "lowest")
Overriding in particular is tricky, because we need multiple variations. Sometimes, we need to ignore visibility; sometimes, we may not.
This should be a separate interface that would accept a Jandex index and would have to assume that the index is complete (that is, if it contains class A, it also contains all its superclasses and superinterfaces). If it is not, exceptions are guaranteed to be thrown -- the utility should probably check on its own and provide better error messages.
By type system, I mean a utility that can answer questions like this:
Aa subclass ofB?A.m()overrideB.m()?Aand superclasses (and interfaces), but from the set of overriding methods, only mention one (the "lowest")Overriding in particular is tricky, because we need multiple variations. Sometimes, we need to ignore visibility; sometimes, we may not.
This should be a separate interface that would accept a Jandex index and would have to assume that the index is complete (that is, if it contains class
A, it also contains all its superclasses and superinterfaces). If it is not, exceptions are guaranteed to be thrown -- the utility should probably check on its own and provide better error messages.