kwin commented on code in PR #2218:
URL: https://github.com/apache/maven-resolver/pull/2218#discussion_r4334812267
##########
maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java:
##########
@@ -723,28 +739,11 @@ public String visitText(TextTree node, Void p) {
@Override
public String visitLink(LinkTree node, Void p) {
- String ref = node.getReference() != null ?
node.getReference().getSignature() : "";
List<? extends DocTree> labelTrees = node.getLabel();
String label = (labelTrees != null && !labelTrees.isEmpty())
? renderContent(docTreePath, mode, false, labelTrees)
: "";
- String text = label.isEmpty() ? ref : label;
- String rendered = node.getKind() == DocTree.Kind.LINK_PLAIN ?
escape(mode, text) : renderAsCode(text);
- if (mode == RenderMode.HTML) {
- VariableElement referenced =
resolveReferencedField(docTreePath, node);
- String configurationKey = getConfigurationKey(referenced);
- if (configurationKey != null) {
- rendered = node.getKind() == DocTree.Kind.LINK_PLAIN
- ? escape(mode, configurationKey)
- : renderAsCode(configurationKey);
- return "<a href=\"#" + escape(mode, configurationKey)
+ "\">" + rendered + "</a>";
- }
- Optional<String> javadocUrl = getJavadocUrl(docTreePath,
node.getReference());
- if (javadocUrl.isPresent()) {
- return "<a href=\"" + javadocUrl.get() + "\">" +
rendered + "</a>";
- }
- }
- return rendered;
+ return renderReference(node.getReference(), node.getKind() ==
DocTree.Kind.LINK_PLAIN, label);
Review Comment:
This is always non-null
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]