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

Paul King edited comment on GROOVY-11269 at 1/11/24 9:40 AM:
-------------------------------------------------------------

If you can try the latest snapshot to see if the problem is fixed, that would 
be great.
To switch to the old parser on Groovy 3, you need to set the {{groovy.antlr4}} 
system property to {{{}false{}}}. Exactly how to do that will depend on how you 
are running Groovydoc.


was (Author: paulk):
If you can try the latest snapshot to see if the problem is fixed, that would 
be great.

> GroovyClassDoc has empty 'enumConstants' when call method 
> GroovyDocParser.getClassDocsFromSingleSource(...)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11269
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11269
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 2.5.12, 3.0.17
>            Reporter: Dmitry
>            Priority: Major
>         Attachments: image-2024-01-05-20-21-01-570.png, 
> image-2024-01-05-20-21-42-826.png, image-2024-01-05-20-28-41-678.png, 
> image-2024-01-05-20-30-29-173.png, image-2024-01-05-20-32-52-646.png, 
> image-2024-01-05-20-32-58-921.png
>
>
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> In our project we try to update gradle from 6.8.2 to 8.2.1.
> And gradle 6.8.2 -> use groovy 2.5.12
> But gradle 8.2.1 -> use groovy 3.0.17
> How we parse java/groovy files now ->
> 59 line 
> {code:java}
> private Map<String, GroovyClassDoc> parseGroovy(String src, String 
> packagePath, String file){code}
> [https://github.com/ishgroup/oncourse/blob/main/buildSrc/apidoc/src/main/groovy/au/com/ish/docs/DslGroovyRootDocBuilder.groovy]
>  
> But it doesn't work for gradle 8.2.1 (groovy 3.0.17).
> After discussion this issue in these tasks:
> https://issues.apache.org/jira/browse/GROOVY-10886
> https://issues.apache.org/jira/browse/GROOVY-11130
> I try to use GroovyDocParser from org.codehaus.groovy.tools.groovydoc.antlr4
> {code:java}
> private Map<String, GroovyClassDoc> parseGroovy(String src, String 
> packagePath, String file)
>       throws RecognitionException, TokenStreamException {
>    GroovyDocParser groovyDocParser = new GroovyDocParser(links, properties)
>    def GroovyClassDocMap = 
> groovyDocParser.getClassDocsFromSingleSource(packagePath, file, src)
>    return GroovyClassDocMap
> }{code}
>  
> And It seems to work. But I found this problem:
> When I parse groovy enums, GroovyClassDoc has empty 'enumConstants' and all 
> enum values are in 'fields'.
> !image-2024-01-05-20-21-42-826.png!!image-2024-01-05-20-21-01-570.png!
> But our old implementation has:
> !image-2024-01-05-20-30-29-173.png!
>  



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

Reply via email to