You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2020/03/07 11:33:47 UTC

[groovy] branch master updated: GROOVY-9439: GroovyDocs HTML page for groovy.json.JsonGenerator mostly empty

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

paulk 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 698d79b  GROOVY-9439: GroovyDocs HTML page for groovy.json.JsonGenerator mostly empty
698d79b is described below

commit 698d79b8a457c576873daca3b346239a6dcf1a64
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Mar 7 21:32:20 2020 +1000

    GROOVY-9439: GroovyDocs HTML page for groovy.json.JsonGenerator mostly empty
---
 .../groovy/tools/groovydoc/antlr4/GroovydocJavaVisitor.java | 13 +++++++++++--
 .../tools/groovydoc/testfiles/GroovyInterface1.groovy       |  2 +-
 .../testfiles/GroovyInterfaceWithMultipleInterfaces.groovy  |  2 +-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/antlr4/GroovydocJavaVisitor.java b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/antlr4/GroovydocJavaVisitor.java
index d2f77d0..d06f4ca 100644
--- a/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/antlr4/GroovydocJavaVisitor.java
+++ b/subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/antlr4/GroovydocJavaVisitor.java
@@ -197,10 +197,15 @@ public class GroovydocJavaVisitor extends VoidVisitorAdapter<Object> {
             name = parent.name() + "$" + name;
         }
         currentClassDoc = new SimpleGroovyClassDoc(imports, aliases, name.replace('$', '.'), links);
+        NodeList<Modifier> mods = n.getModifiers();
         if (parent != null) {
             parent.addNested(currentClassDoc);
+            if (parent.isInterface()) {
+                // an inner interface/class within an interface is public
+                mods.add(Modifier.publicModifier());
+            }
         }
-        setModifiers(n.getModifiers(), currentClassDoc);
+        setModifiers(mods, currentClassDoc);
         processAnnotations(currentClassDoc, n);
         currentClassDoc.setFullPathName(withSlashes(packagePath + FS + name));
         classDocs.put(currentClassDoc.getFullPathName(), currentClassDoc);
@@ -270,7 +275,11 @@ public class GroovydocJavaVisitor extends VoidVisitorAdapter<Object> {
     private void setConstructorOrMethodCommon(CallableDeclaration<? extends CallableDeclaration<?>> n, SimpleGroovyExecutableMemberDoc methOrCons) {
         n.getJavadocComment().ifPresent(javadocComment ->
                 methOrCons.setRawCommentText(javadocComment.getContent()));
-        setModifiers(n.getModifiers(), methOrCons);
+        NodeList<Modifier> mods = n.getModifiers();
+        if (currentClassDoc.isInterface()) {
+            mods.add(Modifier.publicModifier());
+        }
+        setModifiers(mods, methOrCons);
         processAnnotations(methOrCons, n);
         for (Parameter param : n.getParameters()) {
             SimpleGroovyParameter p = new SimpleGroovyParameter(param.getNameAsString());
diff --git a/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterface1.groovy b/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterface1.groovy
index d7a684a..20c2fda 100644
--- a/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterface1.groovy
+++ b/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterface1.groovy
@@ -18,6 +18,6 @@
  */
 package org.codehaus.groovy.tools.groovydoc.testfiles
 
-public interface GroovyInterface1 {
+interface GroovyInterface1 {
 
 }
diff --git a/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterfaceWithMultipleInterfaces.groovy b/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterfaceWithMultipleInterfaces.groovy
index 1226614..d758e9d 100644
--- a/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterfaceWithMultipleInterfaces.groovy
+++ b/subprojects/groovy-groovydoc/src/test/groovy/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterfaceWithMultipleInterfaces.groovy
@@ -18,6 +18,6 @@
  */
 package org.codehaus.groovy.tools.groovydoc.testfiles
 
-public interface GroovyInterfaceWithMultipleInterfaces extends GroovyInterface1, JavaInterface1, Runnable {
+interface GroovyInterfaceWithMultipleInterfaces extends GroovyInterface1, JavaInterface1, Runnable {
 
 }