-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b158
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8175685 | 10 | Joe Darcy | P3 | Resolved | Fixed | b02 |
As part of adding modules to the platform, the long-standing condition that there would be at most one type/package for the same canonical name was rendered untrue: two modules can have (non-exported) types or packages whose names are the same.
This is a wrinkle for the javax.lang.model.Elements methods which map from names to type or package elements. The existing methods
PackageElement getPackageElement(CharSequence name)
TypeElement getTypeElement(CharSequence name)
were redefined to return null if a type/package could not be uniquely found (JDK-8133896). In addition, overloads of these methods taking a module parameter were added to the API:
PackageElement getPackageElement(ModuleElement module, CharSequence name)
TypeElement getTypeElement(ModuleElement module, CharSequence name)
However, this still leaves no easy way to return the same-named elements from whichever module they may be defined in.
One API approach to address this issue would be Elements.getAll{Type, Package}Elements methods. In addition, it is helpful to have a way to see all known modules.
This is a wrinkle for the javax.lang.model.Elements methods which map from names to type or package elements. The existing methods
PackageElement getPackageElement(CharSequence name)
TypeElement getTypeElement(CharSequence name)
were redefined to return null if a type/package could not be uniquely found (
PackageElement getPackageElement(ModuleElement module, CharSequence name)
TypeElement getTypeElement(ModuleElement module, CharSequence name)
However, this still leaves no easy way to return the same-named elements from whichever module they may be defined in.
One API approach to address this issue would be Elements.getAll{Type, Package}Elements methods. In addition, it is helpful to have a way to see all known modules.
- backported by
-
JDK-8175685 Add methods for Elements.getAll{Type, Package, Module}Elements
-
- Resolved
-
- csr of
-
CCC-8173945 Add methods for Elements.getAll{Type, Package, Module}Elements
-
- Closed
-
- relates to
-
JDK-8133896 Update javax.lang.model APIs
-
- Closed
-