On 06/06/2017 12:14 PM, Stephan Herrmann wrote:
On 06.06.2017 18:59, Alex Buckley wrote:
A module name has the same structure as a package name, so ModuleElement has the same shape as PackageElement: each inherits getSimpleName() from Element, and getQualifiedName() from getQualifiedName() from QualifiedNameable.

Syntactically you're right, but ...

Normally, a qualified name denotes two things: a parent element and a child. The package name "java.lang" has a qualifier "java" which denotes a top-level package and "lang" can be used relative to that package to denote a member package etc.

For a module - say "java.base" - the qualifier "java" denotes nothing.
And hence, the simple name "base" cannot be resolved in any context.

So the question is: should ModuleElement.getSimpleName() answer the
totally useless last segment of the name, or should it answer the same
as getQualifiedName()?

The answer to that question should apply to PackageElement too, for identical reasons. However, PackageElement is established API already...

--
- DML

Reply via email to