diff --git a/make/jdk/src/classes/build/tools/taglet/SealedGraph.java b/make/jdk/src/classes/build/tools/taglet/SealedGraph.java index 787789fa0d0..fd1b73355b3 100644 --- a/make/jdk/src/classes/build/tools/taglet/SealedGraph.java +++ b/make/jdk/src/classes/build/tools/taglet/SealedGraph.java @@ -229,7 +229,7 @@ public final class SealedGraph implements Taglet { var forwardNavigator = nodePackage.getQualifiedName().toString() .replace(".", "/"); - return backNavigator + forwardNavigator + "/" + node.getSimpleName() + ".html"; + return backNavigator + forwardNavigator + "/" + packagelessCanonicalName(node) + ".html"; } public void addEdge(TypeElement node, TypeElement subNode) { @@ -315,5 +315,14 @@ public final class SealedGraph implements Taglet { case MEMBER -> packageName((TypeElement) element.getEnclosingElement()); }; } + + private static String packagelessCanonicalName(TypeElement element) { + String result = element.getSimpleName().toString(); + while (element.getNestingKind() == NestingKind.MEMBER) { + element = (TypeElement) element.getEnclosingElement(); + result = element.getSimpleName().toString() + '.' + result; + } + return result; + } } }