[
https://issues.apache.org/jira/browse/GROOVY-8156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15971983#comment-15971983
]
ASF GitHub Bot commented on GROOVY-8156:
----------------------------------------
GitHub user jwagenleitner opened a pull request:
https://github.com/apache/groovy/pull/524
GROOVY-8156: Compile error when ListenerList annotation exists
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jwagenleitner/groovy groovy8156
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/groovy/pull/524.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #524
----
commit 1d24e37353ef1544a2d5a6fdb7929b1a46c598f3
Author: John Wagenleitner <[email protected]>
Date: 2017-04-14T20:33:59Z
GROOVY-8156: Compile error when ListenerList annotation exists
----
> 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
> Priority: Blocker
>
> 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)