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

Jochen Theodorou commented on GROOVY-11117:
-------------------------------------------

parseClass is made to return a single class, in most cases a script. If you 
want to use GroovyClassLoader for this you could extend it by overriding 
createClassCollector to return a modified ClassCollector in which onClassNode 
is overwritten, then you can keep a complete list.

> return first nested interface when GroovyClassLoader.parseClass parse 
> interfaces with nested interfaces
> -------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11117
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11117
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Hai Shi
>            Priority: Major
>
> When I have a groovy file:
> ```
> interface A {
>     interface B
> {     }
>    interface C
> {   }
> ```
> When I use classLoader to parse this file, I only get the `interface B`
> ```
> def gcl = new GroovyClassLoader()
> // this just get the interface B, Something Do I missed?
> def loadedClass = gcl.parseClass(new File("xxxx"))
> ```
>  
> my version:
>  * jdk:18.0.1
>  * groovy: 4.0.2



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

Reply via email to