Skip to content

Commit

Permalink
8325369: @sealedGraph: Bad link to image for tag on nested classes
Browse files Browse the repository at this point in the history
Reviewed-by: jjg
liach committed Jul 11, 2024
1 parent dea9274 commit d06d79c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions make/jdk/src/classes/build/tools/taglet/SealedGraph.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -107,7 +107,7 @@ public String toString(List<? extends DocTree> tags, Element element) {
throw new RuntimeException(e);
}

String simpleTypeName = element.getSimpleName().toString();
String simpleTypeName = packagelessCanonicalName(typeElement).replace('.', '/');
String imageFile = simpleTypeName + "-sealed-graph.svg";
int thumbnailHeight = 100; // also appears in the stylesheet
String hoverImage = "<span>"
@@ -315,14 +315,14 @@ private static Optional<String> packageName(TypeElement element) {
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;
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;
}
}

1 comment on commit d06d79c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.