This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new 4780647  Derive FQCN of a `{@link` using `ImportTree`
4780647 is described below

commit 47806471625ffee75061baf3753ff5a378010cd8
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Mon Mar 11 10:17:58 2024 +0100

    Derive FQCN of a `{@link` using `ImportTree`
---
 .../processor/AbstractAsciiDocTreeVisitor.java     | 14 +++--
 .../log4j/docgen/processor/AsciiDocConverter.java  | 17 +++---
 .../log4j/docgen/processor/AsciiDocData.java       | 14 +++--
 .../docgen/processor/DescriptorGenerator.java      | 43 ++++++++-----
 .../log4j/docgen/processor/ElementImports.java     | 71 ++++++++++++++++++++++
 .../docgen/processor/ElementImportsFactory.java}   | 29 +++------
 .../docgen/processor/AsciiDocConverterTest.java    |  4 +-
 .../AsciiDocConverterTest/JavadocExample.adoc      |  2 +-
 .../AsciiDocConverterTest/JavadocExample.java      |  5 +-
 .../DescriptorGeneratorTest/expected-plugins.xml   |  2 +-
 .../java-of-log4j2/MyEnum.java                     |  3 +-
 .../java-of-log4j3/MyEnum.java                     |  3 +-
 12 files changed, 145 insertions(+), 62 deletions(-)

diff --git 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AbstractAsciiDocTreeVisitor.java
 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AbstractAsciiDocTreeVisitor.java
index a6434ff..843e95e 100644
--- 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AbstractAsciiDocTreeVisitor.java
+++ 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AbstractAsciiDocTreeVisitor.java
@@ -23,6 +23,7 @@ import com.sun.source.doctree.EndElementTree;
 import com.sun.source.doctree.EntityTree;
 import com.sun.source.doctree.LinkTree;
 import com.sun.source.doctree.LiteralTree;
+import com.sun.source.doctree.ReferenceTree;
 import com.sun.source.doctree.StartElementTree;
 import com.sun.source.doctree.TextTree;
 import com.sun.source.util.SimpleDocTreeVisitor;
@@ -45,6 +46,7 @@ import org.asciidoctor.ast.Row;
 import org.asciidoctor.ast.Section;
 import org.asciidoctor.ast.StructuralNode;
 import org.asciidoctor.ast.Table;
+import org.jspecify.annotations.Nullable;
 
 abstract class AbstractAsciiDocTreeVisitor extends SimpleDocTreeVisitor<Void, 
AsciiDocData> {
 
@@ -117,12 +119,8 @@ abstract class AbstractAsciiDocTreeVisitor extends 
SimpleDocTreeVisitor<Void, As
                 
data.getCurrentParagraph().setContext(BlockImpl.LISTING_CONTEXT);
                 break;
             case "code":
-                data.newTextSpan();
-                break;
             case "em":
             case "i":
-                data.newTextSpan();
-                break;
             case "strong":
             case "b":
                 data.newTextSpan();
@@ -225,7 +223,7 @@ abstract class AbstractAsciiDocTreeVisitor extends 
SimpleDocTreeVisitor<Void, As
 
     @Override
     public Void visitLink(final LinkTree node, final AsciiDocData data) {
-        final String referenceSignature = node.getReference().getSignature();
+        final String referenceSignature = 
getReferenceSignature(node.getReference(), data);
         final String referenceLabel = linkLabelToAsciiDoc(node);
         data.appendAdjustingSpace(" apiref:")
                 .append(referenceSignature)
@@ -235,6 +233,12 @@ abstract class AbstractAsciiDocTreeVisitor extends 
SimpleDocTreeVisitor<Void, As
         return super.visitLink(node, data);
     }
 
+    private static String getReferenceSignature(final ReferenceTree 
referenceTree, final AsciiDocData data) {
+        final String referenceSignature = referenceTree.getSignature();
+        @Nullable final String qualifiedClassName = 
data.imports.get(referenceSignature);
+        return qualifiedClassName != null ? qualifiedClassName : 
referenceSignature;
+    }
+
     private static String linkLabelToAsciiDoc(final LinkTree node) {
         int[] labelTokenIndex = {0};
         return node.getLabel().stream()
diff --git 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverter.java
 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverter.java
index 504728c..dfb00e7 100644
--- 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverter.java
+++ 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverter.java
@@ -22,6 +22,7 @@ import com.sun.source.doctree.DocTreeVisitor;
 import com.sun.source.doctree.ParamTree;
 import com.sun.source.util.DocTrees;
 import javax.lang.model.element.Element;
+import org.jspecify.annotations.Nullable;
 
 /**
  * Converts a {@link DocCommentTree} into AsciiDoc text.
@@ -38,19 +39,19 @@ final class AsciiDocConverter {
         this.paramTreeVisitor = new ParamTreeVisitor();
     }
 
-    public String toAsciiDoc(final Element element) {
+    @Nullable
+    public String toAsciiDoc(final Element element, final ElementImports 
imports) {
         final DocCommentTree tree = docTrees.getDocCommentTree(element);
-        return tree != null ? toAsciiDoc(tree) : null;
-    }
-
-    public String toAsciiDoc(final DocCommentTree tree) {
-        final AsciiDocData data = new AsciiDocData();
+        if (tree == null) {
+            return null;
+        }
+        final AsciiDocData data = new AsciiDocData(imports);
         tree.accept(docCommentTreeVisitor, data);
         return data.getDocument().convert();
     }
 
-    public String toAsciiDoc(final ParamTree tree) {
-        final AsciiDocData data = new AsciiDocData();
+    public String toAsciiDoc(final ParamTree tree, final ElementImports 
imports) {
+        final AsciiDocData data = new AsciiDocData(imports);
         tree.accept(paramTreeVisitor, data);
         return data.getDocument().convert();
     }
diff --git 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocData.java
 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocData.java
index e7d2adb..a5f70d0 100644
--- 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocData.java
+++ 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/AsciiDocData.java
@@ -37,6 +37,7 @@ final class AsciiDocData {
     private static final char SPACE_CHAR = ' ';
     private static final char CODE_CHAR = '`';
 
+    final ElementImports imports;
     private final Document document;
     private int currentSectionLevel;
     private StructuralNode currentNode;
@@ -44,12 +45,13 @@ final class AsciiDocData {
     private final Deque<Block> paragraphs = new ArrayDeque<>();
     private final Deque<StringBuilder> lines = new ArrayDeque<>();
 
-    public AsciiDocData() {
-        document = new DocumentImpl();
-        currentSectionLevel = 1;
-        currentNode = document;
-        paragraphs.push(new BlockImpl(currentNode));
-        lines.push(new StringBuilder());
+    public AsciiDocData(final ElementImports imports) {
+        this.imports = imports;
+        this.document = new DocumentImpl();
+        this.currentSectionLevel = 1;
+        this.currentNode = document;
+        this.paragraphs.push(new BlockImpl(currentNode));
+        this.lines.push(new StringBuilder());
     }
 
     public void newLine() {
diff --git 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/DescriptorGenerator.java
 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/DescriptorGenerator.java
index ba41dd2..44dfbfb 100644
--- 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/DescriptorGenerator.java
+++ 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/DescriptorGenerator.java
@@ -25,6 +25,7 @@ import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.ParamTree;
 import com.sun.source.util.DocTrees;
 import com.sun.source.util.SimpleDocTreeVisitor;
+import com.sun.source.util.Trees;
 import java.io.IOException;
 import java.io.Writer;
 import java.nio.file.Files;
@@ -139,6 +140,8 @@ public class DescriptorGenerator extends AbstractProcessor {
 
     private Types types;
 
+    private ElementImportsFactory importsFactory;
+
     private AsciiDocConverter converter;
 
     private Annotations annotations;
@@ -158,6 +161,8 @@ public class DescriptorGenerator extends AbstractProcessor {
         elements = processingEnv.getElementUtils();
         messager = processingEnv.getMessager();
         types = processingEnv.getTypeUtils();
+        final Trees trees = Trees.instance(processingEnv);
+        importsFactory = ElementImports.factory(trees);
         converter = new AsciiDocConverter(docTrees);
         annotations = new Annotations(elements, types);
         collectionType = getDeclaredType(processingEnv, 
"java.util.Collection");
@@ -286,7 +291,7 @@ public class DescriptorGenerator extends AbstractProcessor {
         // Class name
         docgenType.setClassName(element.getQualifiedName().toString());
         // Description
-        docgenType.setDescription(createDescription(element, null));
+        docgenType.setDescription(createDescription(element, null, null));
     }
 
     private void populateScalarType(final TypeElement element, final 
ScalarType scalarType) {
@@ -298,7 +303,7 @@ public class DescriptorGenerator extends AbstractProcessor {
                         && types.isSameType(member.asType(), 
element.asType())) {
                     final VariableElement field = (VariableElement) member;
                     final ScalarValue value = new ScalarValue();
-                    value.setDescription(createDescription(field, null));
+                    value.setDescription(createDescription(field, null, null));
                     value.setName(field.getSimpleName().toString());
                     scalarType.addValue(value);
                 }
@@ -306,7 +311,7 @@ public class DescriptorGenerator extends AbstractProcessor {
         }
     }
 
-    private Map<String, String> getParameterDescriptions(final Element 
element) {
+    private Map<String, String> getParameterDescriptions(final Element 
element, final ElementImports imports) {
         final Map<String, String> descriptions = new HashMap<>();
         final DocCommentTree docCommentTree = 
docTrees.getDocCommentTree(element);
         if (docCommentTree != null) {
@@ -323,7 +328,7 @@ public class DescriptorGenerator extends AbstractProcessor {
                         @Override
                         public Void visitParam(final ParamTree paramTree, 
final Map<String, String> descriptions) {
                             final String name = 
paramTree.getName().getName().toString();
-                            descriptions.put(name, 
defaultString(converter.toAsciiDoc(paramTree)));
+                            descriptions.put(name, 
defaultString(converter.toAsciiDoc(paramTree, imports)));
                             return null;
                         }
                     },
@@ -333,6 +338,7 @@ public class DescriptorGenerator extends AbstractProcessor {
     }
 
     private void populatePlugin(final TypeElement element, final PluginType 
pluginType) {
+        final ElementImports imports = importsFactory.ofElement(element);
         populateType(element, pluginType);
         // Supertypes
         registerSupertypes(element).forEach(pluginType::addSupertype);
@@ -340,13 +346,13 @@ public class DescriptorGenerator extends 
AbstractProcessor {
         for (final Element member : element.getEnclosedElements()) {
             if (annotations.hasFactoryAnnotation(member) && member instanceof 
ExecutableElement) {
                 final ExecutableElement executable = (ExecutableElement) 
member;
-                final Map<String, String> descriptions = 
getParameterDescriptions(executable);
+                final Map<String, String> descriptions = 
getParameterDescriptions(executable, imports);
                 final List<? extends VariableElement> parameters = 
executable.getParameters();
                 if (parameters.isEmpty()) {
                     // We have a builder
                     final TypeElement returnType = getReturnType(executable);
                     if (returnType != null) {
-                        
populateConfigurationProperties(getAllMembers(returnType), descriptions, 
pluginType);
+                        populateConfigurationProperties(imports, 
getAllMembers(returnType), descriptions, pluginType);
                     } else {
                         messager.printMessage(
                                 Diagnostic.Kind.WARNING,
@@ -355,13 +361,14 @@ public class DescriptorGenerator extends 
AbstractProcessor {
                     }
                 } else {
                     // Old style factory method
-                    populateConfigurationProperties(parameters, descriptions, 
pluginType);
+                    populateConfigurationProperties(imports, parameters, 
descriptions, pluginType);
                 }
             }
         }
     }
 
     private void populateConfigurationProperties(
+            final ElementImports imports,
             final Iterable<? extends Element> members,
             final Map<? super String, String> descriptions,
             final PluginType pluginType) {
@@ -372,7 +379,7 @@ public class DescriptorGenerator extends AbstractProcessor {
         // Gather documentation, which can be on any member.
         for (final Element member : members) {
             final String name = getAttributeOrPropertyName(member);
-            final String asciiDoc = converter.toAsciiDoc(member);
+            final String asciiDoc = converter.toAsciiDoc(member, imports);
             descriptions.compute(name, (key, value) -> Stream.of(value, 
asciiDoc)
                     .filter(StringUtils::isNotEmpty)
                     .collect(Collectors.joining("\n")));
@@ -384,12 +391,13 @@ public class DescriptorGenerator extends 
AbstractProcessor {
                 if (annotations.isAttributeAnnotation(annotation)) {
                     pluginAttributes.add(createPluginAttribute(
                             member,
+                            imports,
                             description,
                             annotations
                                     .getAttributeSpecifiedName(annotation)
                                     .orElseGet(() -> 
getAttributeOrPropertyName(member))));
                 } else {
-                    pluginElements.add(createPluginElement(member, 
description));
+                    pluginElements.add(createPluginElement(member, imports, 
description));
                 }
             }
         }
@@ -398,8 +406,12 @@ public class DescriptorGenerator extends AbstractProcessor 
{
     }
 
     @Nullable
-    private Description createDescription(final Element element, final 
@Nullable String fallbackDescriptionText) {
-        @Nullable String descriptionText = converter.toAsciiDoc(element);
+    private Description createDescription(
+            final Element element, @Nullable ElementImports imports, final 
@Nullable String fallbackDescriptionText) {
+        if (imports == null) {
+            imports = importsFactory.ofElement(element);
+        }
+        @Nullable String descriptionText = converter.toAsciiDoc(element, 
imports);
         if (StringUtils.isBlank(descriptionText)) {
             if (StringUtils.isBlank(fallbackDescriptionText)) {
                 return null;
@@ -414,7 +426,7 @@ public class DescriptorGenerator extends AbstractProcessor {
     }
 
     private PluginAttribute createPluginAttribute(
-            final Element element, final String description, final String 
specifiedName) {
+            final Element element, final ElementImports imports, final String 
description, final String specifiedName) {
         final PluginAttribute attribute = new PluginAttribute();
         // Name
         attribute.setName(specifiedName.isEmpty() ? 
getAttributeOrPropertyName(element) : specifiedName);
@@ -427,7 +439,7 @@ public class DescriptorGenerator extends AbstractProcessor {
         }
         attribute.setType(className);
         // Description
-        attribute.setDescription(createDescription(element, description));
+        attribute.setDescription(createDescription(element, imports, 
description));
         // Required
         attribute.setRequired(annotations.hasRequiredConstraint(element));
         // Default value
@@ -440,7 +452,8 @@ public class DescriptorGenerator extends AbstractProcessor {
         return attribute;
     }
 
-    private PluginElement createPluginElement(final Element element, final 
String description) {
+    private PluginElement createPluginElement(
+            final Element element, final ElementImports imports, final String 
description) {
         final PluginElement pluginElement = new PluginElement();
         // Type and multiplicity
         final TypeMirror elementType = getMemberType(element);
@@ -453,7 +466,7 @@ public class DescriptorGenerator extends AbstractProcessor {
         // Required
         pluginElement.setRequired(annotations.hasRequiredConstraint(element));
         // Description
-        pluginElement.setDescription(createDescription(element, description));
+        pluginElement.setDescription(createDescription(element, imports, 
description));
         return pluginElement;
     }
 
diff --git 
a/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/ElementImports.java
 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/ElementImports.java
new file mode 100644
index 0000000..8029558
--- /dev/null
+++ 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/ElementImports.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.logging.log4j.docgen.processor;
+
+import com.sun.source.tree.ImportTree;
+import com.sun.source.tree.Tree;
+import com.sun.source.util.TreePath;
+import com.sun.source.util.TreeScanner;
+import com.sun.source.util.Trees;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+import org.jspecify.annotations.Nullable;
+
+/**
+ * A map associating simple class name keys with qualified class names that is 
collected from {@link com.sun.source.tree.ImportTree} of an {@link 
javax.lang.model.element.Element}.
+ */
+final class ElementImports extends TreeMap<String, String> {
+
+    private static final ElementImports EMPTY = new ElementImports();
+
+    private static final long serialVersionUID = 0L;
+
+    private ElementImports() {}
+
+    private ElementImports(Map<String, String> imports) {
+        super(imports);
+    }
+
+    static ElementImportsFactory factory(final Trees trees) {
+        return element -> {
+            final ImportCollectingTreeScanner scanner = new 
ImportCollectingTreeScanner();
+            @Nullable final TreePath treePath = trees.getPath(element);
+            if (treePath == null) {
+                return EMPTY;
+            }
+            scanner.scan(treePath.getCompilationUnit(), null);
+            return new ElementImports(scanner.imports);
+        };
+    }
+
+    private static final class ImportCollectingTreeScanner extends 
TreeScanner<Object, Trees> {
+
+        private final Map<String, String> imports = new HashMap<>();
+
+        private ImportCollectingTreeScanner() {}
+
+        @Override
+        public Object visitImport(final ImportTree importTree, final Trees 
trees) {
+            final Tree qualifiedIdentifier = 
importTree.getQualifiedIdentifier();
+            final String qualifiedClassName = qualifiedIdentifier.toString();
+            final String simpleClassName = 
qualifiedClassName.substring(qualifiedClassName.lastIndexOf('.') + 1);
+            imports.put(simpleClassName, qualifiedClassName);
+            return super.visitImport(importTree, trees);
+        }
+    }
+}
diff --git 
a/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j2/MyEnum.java
 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/ElementImportsFactory.java
similarity index 74%
copy from 
log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j2/MyEnum.java
copy to 
log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/ElementImportsFactory.java
index 08f7e75..f70321c 100644
--- 
a/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j2/MyEnum.java
+++ 
b/log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/ElementImportsFactory.java
@@ -14,27 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package example;
+package org.apache.logging.log4j.docgen.processor;
 
-/**
- * A very important enum.
- */
-public enum MyEnum {
-    /**
-     * Makes things go boom!
-     */
-    A,
-    /**
-     * A second choice.
-     */
-    B,
-    /**
-     * Value C.
-     */
-    C,
-    /**
-     * Value D.
-     */
-    D,
-    WITHOUT_DESCRIPTION;
+import javax.lang.model.element.Element;
+
+@FunctionalInterface
+interface ElementImportsFactory {
+
+    ElementImports ofElement(Element element);
 }
diff --git 
a/log4j-docgen/src/test/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverterTest.java
 
b/log4j-docgen/src/test/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverterTest.java
index d90ca49..d5df15e 100644
--- 
a/log4j-docgen/src/test/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverterTest.java
+++ 
b/log4j-docgen/src/test/java/org/apache/logging/log4j/docgen/processor/AsciiDocConverterTest.java
@@ -123,7 +123,9 @@ class AsciiDocConverterTest {
                             && 
TEST_CLASS_NAME.equals(element.getSimpleName().toString())) {
                         final FileObject output = fileManager.getFileForOutput(
                                 StandardLocation.CLASS_OUTPUT, "", 
TEST_CLASS_NAME + ".adoc", null);
-                        final String asciiDoc = converter.toAsciiDoc(element);
+                        final ElementImports imports = 
ElementImports.factory(environment.getDocTrees())
+                                .ofElement(element);
+                        final String asciiDoc = converter.toAsciiDoc(element, 
imports);
                         assertThat(asciiDoc).isNotNull();
                         try (final OutputStream os = 
output.openOutputStream()) {
                             Files.copy(LICENSE_PATH, os);
diff --git 
a/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.adoc 
b/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.adoc
index 5ae10e4..05b96f4 100644
--- a/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.adoc
+++ b/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.adoc
@@ -16,7 +16,7 @@ limitations under the License.
 ////
 Example of JavaDoc to AsciiDoc conversion
 
-Link test: apiref:String#value()[isn't this awesome]?
+Link test: apiref:String#value()[value method]. Imported link test: 
apiref:javax.tools.Diagnostic[]
 
 We run the `javadoc` tool on this class to test conversion of JavaDoc comments 
to AsciiDoc.
 This paragraph has two sentences.
diff --git 
a/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.java 
b/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.java
index 3a81b05..56e77a8 100644
--- a/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.java
+++ b/log4j-docgen/src/test/resources/AsciiDocConverterTest/JavadocExample.java
@@ -16,10 +16,13 @@
  */
 package example;
 
+import javax.tools.Diagnostic;
+
 /**
  * Example of JavaDoc to AsciiDoc conversion
  * <p>
- *     Link test: {@link String#value() isn't this awesome}?
+ *     Link test: {@link String#value() value method}.
+ *     Imported link test: {@link Diagnostic}
  * </p>
  * <p>
  *     We run the {@code javadoc} tool on this class to test conversion of 
JavaDoc comments to AsciiDoc. This
diff --git 
a/log4j-docgen/src/test/resources/DescriptorGeneratorTest/expected-plugins.xml 
b/log4j-docgen/src/test/resources/DescriptorGeneratorTest/expected-plugins.xml
index 5543aed..ecf315e 100644
--- 
a/log4j-docgen/src/test/resources/DescriptorGeneratorTest/expected-plugins.xml
+++ 
b/log4j-docgen/src/test/resources/DescriptorGeneratorTest/expected-plugins.xml
@@ -27,7 +27,7 @@
         <scalar className="example.MyEnum">
             <values>
                 <value name="A">
-                    <description>Makes things go boom!</description>
+                    <description>Makes things go boom using 
apiref:javax.lang.model.type.NoType[an imported type]!</description>
                 </value>
                 <value name="B">
                     <description>A second choice.</description>
diff --git 
a/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j2/MyEnum.java
 
b/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j2/MyEnum.java
index 08f7e75..3ab1851 100644
--- 
a/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j2/MyEnum.java
+++ 
b/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j2/MyEnum.java
@@ -15,13 +15,14 @@
  * limitations under the License.
  */
 package example;
+import javax.lang.model.type.NoType;
 
 /**
  * A very important enum.
  */
 public enum MyEnum {
     /**
-     * Makes things go boom!
+     * Makes things go boom using {@link NoType an imported type}!
      */
     A,
     /**
diff --git 
a/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j3/MyEnum.java
 
b/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j3/MyEnum.java
index 08f7e75..3ab1851 100644
--- 
a/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j3/MyEnum.java
+++ 
b/log4j-docgen/src/test/resources/DescriptorGeneratorTest/java-of-log4j3/MyEnum.java
@@ -15,13 +15,14 @@
  * limitations under the License.
  */
 package example;
+import javax.lang.model.type.NoType;
 
 /**
  * A very important enum.
  */
 public enum MyEnum {
     /**
-     * Makes things go boom!
+     * Makes things go boom using {@link NoType an imported type}!
      */
     A,
     /**

Reply via email to