You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/05/24 23:32:20 UTC
[groovy] branch master updated: GROOVY-9548: groovydoc: take
property annotations from backing field
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new ea4a0f8 GROOVY-9548: groovydoc: take property annotations from backing field
ea4a0f8 is described below
commit ea4a0f8f0a58038d673626e2d1b3c428bb4bf5a0
Author: Mikko Värri <vm...@linuxbox.fi>
AuthorDate: Sat May 23 14:24:20 2020 +0300
GROOVY-9548: groovydoc: take property annotations from backing field
---
.../src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java | 1 +
.../org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java b/subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
index 6f62ffc..1d7c940 100644
--- a/subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
+++ b/subprojects/groovy-groovydoc/src/main/java/org/apache/groovy/antlr/GroovydocVisitor.java
@@ -288,6 +288,7 @@ public class GroovydocVisitor extends ClassCodeVisitorSupport {
fieldDoc.setRawCommentText(groovydoc == null ? "" : getDocContent(groovydoc));
currentClassDoc.addProperty(fieldDoc);
}
+ processAnnotations(fieldDoc, node.getField());
super.visitProperty(node);
}
diff --git a/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java b/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java
index b28e7d5..a252360 100644
--- a/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java
+++ b/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java
@@ -950,7 +950,12 @@ public class GroovyDocToolTest extends GroovyTestCase {
"<strong>annotatedField</strong></h4>"
)).matcher(javadoc).find());
- // TODO: Annotations for properties are missing, for some reason.
+ assertTrue("The Groovy property details should have the annotation", Pattern.compile(Pattern.quote(
+ "<h4>@<a href='https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html' title='Deprecated'>Deprecated</a>\n" +
+ "<a href='https://docs.oracle.com/javase/8/docs/api/java/util/List.html' title='List'>List</a> <strong>annotatedProperty</strong></h4>"
+ )).matcher(groovydoc).find());
+
+ // Java doesn't have properties section
assertTrue("The Groovy ctor details should have the annotation", Pattern.compile(Pattern.quote(
"<h4>@groovy.transform.NamedVariant\n" +