-
Enhancement
-
Resolution: Fixed
-
P4
-
9
-
b11
-
generic
-
generic
This is a useful utility used in the doclet's new api and would be beneficial to other users of javax.lang.model.
Suggested code:
public TypeElement getOuterMostTypeElement(Element e) {
if (e.getKind() == ElementKind.PACKAGE)
return null;
Element encl = e.getEnclosingElement();
ElementKind kind = encl.getKind();
if (kind == ElementKind.PACKAGE)
return null;
while (!(kind.isClass() || kind.isInterface())) {
encl = encl.getEnclosingElement();
}
return (TypeElement)encl;
}
Suggested code:
public TypeElement getOuterMostTypeElement(Element e) {
if (e.getKind() == ElementKind.PACKAGE)
return null;
Element encl = e.getEnclosingElement();
ElementKind kind = encl.getKind();
if (kind == ElementKind.PACKAGE)
return null;
while (!(kind.isClass() || kind.isInterface())) {
encl = encl.getEnclosingElement();
}
return (TypeElement)encl;
}
- csr for
-
JDK-8271903 Add getOutermostTypeElement to javax.lang.model utility class
- Closed
- relates to
-
JDK-8264866 Remove unneeded WorkArounds.isAutomaticModule
- Resolved
There are no Sub-Tasks for this issue.