[
https://issues.apache.org/jira/browse/GROOVY-8156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
John Wagenleitner resolved GROOVY-8156.
---------------------------------------
Resolution: Fixed
Assignee: John Wagenleitner
Fix Version/s: 2.4.11
Thanks for reporting the issue.
> Compile error when ListenerList annotation exists
> -------------------------------------------------
>
> Key: GROOVY-8156
> URL: https://issues.apache.org/jira/browse/GROOVY-8156
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.10
> Environment: Linux x64 java8
> Reporter: Sascha Frinken
> Assignee: John Wagenleitner
> Priority: Blocker
> Fix For: 2.4.11
>
>
> After upgrading groovy from 2.4.7 to 2.4.10 all classes using the
> `groovy.beans.ListenerList` annotation fail to compile.
> The error message is:
> {noformat}
> Caught: BUG! exception in phase 'canonicalization' in source unit
> '/tmp/fsck/bug.groovy' ClassNode#getTypeClass for Event is called before the
> type class is set
> BUG! exception in phase 'canonicalization' in source unit
> '/tmp/fsck/bug.groovy' ClassNode#getTypeClass for Event is called before the
> type class is set
> {noformat}
> Code to reproduce:
> {noformat}
> class Event {
> }
> interface EventListener {
> void doSomething(Event e)
> }
> class EventHandler {
> @groovy.beans.ListenerList
> List<EventListener> listeners
> }
> def eh = new EventHandler()
> eh.addEventListener({ println it} as EventListener)
> eh.fireDoSomething(new Event())
> {noformat}
> Complete steps:
> {noformat}
> % sdk u groovy 2.4.7
> Using groovy version 2.4.7 in this shell.
> % cat bug.groovy
> class Event {
> }
> interface EventListener {
> void doSomething(Event e)
> }
> class EventHandler {
> @groovy.beans.ListenerList
> List<EventListener> listeners
> }
> def eh = new EventHandler()
> eh.addEventListener({ println it} as EventListener)
> eh.fireDoSomething(new Event())
> % groovy -v
> Groovy Version: 2.4.7 JVM: 1.8.0_121 Vendor: Oracle Corporation OS: Linux
> % groovy bug.groovy # WORKS
> Event@762ef0ea
> % sdk u groovy 2.4.10
> Using groovy version 2.4.10 in this shell.
> % groovy -v
> Groovy Version: 2.4.10 JVM: 1.8.0_121 Vendor: Oracle Corporation OS: Linux
> % groovy bug.groovy # FAILS
> Caught: BUG! exception in phase 'canonicalization' in source unit
> '/tmp/fsck/bug.groovy' ClassNode#getTypeClass for Event is called before the
> type class is set
> BUG! exception in phase 'canonicalization' in source unit
> '/tmp/fsck/bug.groovy' ClassNode#getTypeClass for Event is called before the
> type class is set
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)