kwin commented on code in PR #2218:
URL: https://github.com/apache/maven-resolver/pull/2218#discussion_r4334810188


##########
maven-resolver-tools/src/main/java/org/eclipse/aether/tools/ConfigurationCollectorDoclet.java:
##########
@@ -812,6 +811,49 @@ public String visitDeprecated(DeprecatedTree node, Void p) 
{
                 return sb.toString();
             }
 
+            @Override
+            public String visitSee(SeeTree node, Void p) {
+                // if the first reference is of type REFERENCE, the label may 
follow afterwards
+                if (!node.getReference().isEmpty() && 
node.getReference().get(0) instanceof ReferenceTree reference) {
+                    String label = renderContent(
+                            docTreePath,
+                            mode,
+                            trim,
+                            node.getReference().subList(1, 
node.getReference().size()));
+                    return renderReference(reference, false, label);
+                } else {
+                    return renderContent(docTreePath, mode, trim, 
node.getReference());
+                }
+            }
+
+            /**
+             * Used from {@link #visitLink(LinkTree, Void)} and {@link 
#visitSee(SeeTree, Void)} to render a reference to a field or type (optionally 
with a label).
+             * @param node the reference node
+             * @param isPlain true if it should be emitted outside of a code 
block, false otherwise
+             * @param label may be empty, in which case the reference 
signature is used as the label
+             * @return the rendered reference (never {@code null})
+             */
+            private String renderReference(ReferenceTree node, boolean 
isPlain, String label) {
+                String effectiveLabel = label.isEmpty() ? node.getSignature() 
: label;
+                String escapedLabel = isPlain ? escape(mode, effectiveLabel) : 
renderAsCode(effectiveLabel);
+                if (mode == RenderMode.HTML) {
+                    VariableElement referenced = 
resolveReferencedField(docTreePath, node);

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]

Reply via email to