@@ -1024,11 +1024,10 @@ public String getEnclosingPackageName(TypeElement te) {
1024
1024
}
1025
1025
1026
1026
/**
1027
- * Return the main type element of the current page or null for pages that don't have one.
1028
- *
1029
- * @return the type element of the current page.
1027
+ * {@return the type element documented by this writer if it is a {@code ClassWriter},
1028
+ * or null for any other kind of writer}
1030
1029
*/
1031
- public TypeElement getCurrentPageElement () {
1030
+ public TypeElement getCurrentTypeElement () {
1032
1031
return null ;
1033
1032
}
1034
1033
@@ -1912,7 +1911,7 @@ private boolean shouldRedirectRelativeLinks(Element element) {
1912
1911
// Retrieve the element of this writer if it is a "primary" writer for an element.
1913
1912
// Note: It would be nice to have getCurrentPageElement() return package and module elements
1914
1913
// in their respective writers, but other uses of the method are only interested in TypeElements.
1915
- Element currentPageElement = getCurrentPageElement ();
1914
+ Element currentPageElement = getCurrentTypeElement ();
1916
1915
if (currentPageElement == null ) {
1917
1916
if (this instanceof PackageWriter packageWriter ) {
1918
1917
currentPageElement = packageWriter .packageElement ;
@@ -1951,7 +1950,7 @@ public Content invalidTagOutput(String summary, Optional<Content> detail) {
1951
1950
*/
1952
1951
private boolean inSamePackage (Element element ) {
1953
1952
Element currentPageElement = (this instanceof PackageWriter packageWriter )
1954
- ? packageWriter .packageElement : getCurrentPageElement ();
1953
+ ? packageWriter .packageElement : getCurrentTypeElement ();
1955
1954
return currentPageElement != null && !utils .isModule (element )
1956
1955
&& Objects .equals (utils .containingPackage (currentPageElement ),
1957
1956
utils .containingPackage (element ));
0 commit comments