[ 
https://issues.apache.org/jira/browse/GROOVY-11668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17952671#comment-17952671
 ] 

ASF GitHub Bot commented on GROOVY-11668:
-----------------------------------------

Copilot commented on code in PR #2228:
URL: https://github.com/apache/groovy/pull/2228#discussion_r2096073259


##########
subprojects/groovy-groovydoc/src/main/java/org/codehaus/groovy/tools/groovydoc/GroovyDocTool.java:
##########
@@ -45,11 +50,12 @@ public GroovyDocTool(String[] sourcepaths) {
     }
 
     public GroovyDocTool(ResourceManager resourceManager, String[] 
sourcepaths, String classTemplate) {
-        this(resourceManager, sourcepaths, new String[]{}, new String[]{}, new 
String[]{classTemplate}, new ArrayList<LinkArgument>(), new Properties());
+        this(resourceManager, sourcepaths, new String[]{}, new String[]{}, new 
String[]{classTemplate}, new ArrayList<LinkArgument>(), null, new Properties());
     }
 

Review Comment:
   This constructor introduces a new `javaVersion` parameter but lacks JavaDoc 
describing its purpose, accepted format, and behavior. Please add a doc comment.
   ```suggestion
   
       /**
        * Constructs a GroovyDocTool instance with the specified parameters.
        *
        * @param resourceManager  the resource manager for handling resources, 
or null if not required
        * @param sourcepaths      the paths to the source files to be processed
        * @param docTemplates     the templates for generating documentation
        * @param packageTemplates the templates for generating package-level 
documentation
        * @param classTemplates   the templates for generating class-level 
documentation
        * @param links            a list of link arguments for external 
references
        * @param javaVersion      the Java version to be used for parsing and 
processing (e.g., "1.8", "11", "17");
        *                         determines the Java language level
        * @param properties       additional properties for configuration
        */
   ```





> Groovydoc crashes with higher Java language levels
> --------------------------------------------------
>
>                 Key: GROOVY-11668
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11668
>             Project: Groovy
>          Issue Type: Improvement
>          Components: GroovyDoc
>            Reporter: James Daugherty
>            Priority: Critical
>
> Groovydoc supports both groovy & java files.  It supports parsing via the 
> JavaParser library & the library supports specifying a language level.  
> However, groovydoc does not have a way of setting it for the library at this 
> time.  By default the library defaults to the "popular" language level of 
> that release - for the current JavaParser version that is Java 11.  
> As projects update to newer language features, it is desirable to continue 
> using groovydoc for later Java versions.  This change is to add an option to 
> groovydoc to specify the language level based on the possible values in the 
> enum ParserConfiguration.LanguageLevel from the JavaParser library.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to