Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.4.10
-
None
-
None
-
Linux x64 java8
Description
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:
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
Code to reproduce:
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())
Complete steps:
% 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
Attachments
Attachments
Issue Links
- links to