ModuleElement#getEnclosedElements only has exported packages in some cases?
Josiah Noel
josiahnoel at gmail.com
Thu Oct 31 00:45:43 UTC 2024
Hey team,
I got an annotation processor that uses Elements#getAllModuleElements and
goes through all the packages to find classes matching a certain condition,
but it seems packages that are not explicitly exported are not present when
I call ModuleElement#getEnclosedElements.
Another thing that makes this odd is that when I know the package ahead of
time and call Elements#getPackageElement to get the non-exported package,
suddenly using getEnclosedElements() on the module element works as
expected.
I want to confirm if this behavior is intentional, as the Javadocs for
getEnclosedElements do not suggest this should be happening.
--
Cheers, Josiah.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20241030/71a453cf/attachment.htm>
More information about the compiler-dev
mailing list