You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The javadoc for javax.lang.model.element.TypeElement.getEnclosingElement() states that the method returns "the package of a top-level type, the immediately lexically enclosing element for a nested type."
However, when calling the method on a java-typesTypeElement for a top-level type, an exception is thrown:
java.lang.UnsupportedOperationException: getEnclosingElement() not supported for top-level classes.
at net.florianschoppmann.java.reflect.TypeElementImpl.getEnclosingElement(TypeElementImpl.java:119)
at net.florianschoppmann.java.reflect.TypeElementImpl.getEnclosingElement(TypeElementImpl.java:16)