java-types
java-types copied to clipboard
TypeElementImpl.getEnclosingElement() does not return package element for top-level types
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-types TypeElement 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)
您的邮件已经收到,此邮件是收到邮件成功后由系统自动发送的,本人在阅读到邮件后会第一时间给您回复邮件的