You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/03/09 21:15:38 UTC

[jira] [Resolved] (GROOVY-8110) @ListenerList generated fireWhatever() method stops working

     [ https://issues.apache.org/jira/browse/GROOVY-8110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King resolved GROOVY-8110.
-------------------------------
       Resolution: Fixed
         Assignee: Paul King
    Fix Version/s: 2.4.10

Proposed PR merged. Thanks for spotting the issue.

> @ListenerList generated fireWhatever() method stops working
> -----------------------------------------------------------
>
>                 Key: GROOVY-8110
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8110
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 2.4.7, 2.4.8
>            Reporter: Frigo Pratser
>            Assignee: Paul King
>            Priority: Minor
>             Fix For: 2.4.10
>
>
> As described in the question on SO
> [http://stackoverflow.com/questions/42648766/groovy-listenerlist-generated-firexxx-method-stops-working]
> and confirmed by @aalmiray the fireWhatever() method generated when
> using @ListenerList annotation stops working after some calls.
> [@aalmiray|http://stackoverflow.com/users/120745/aalmiray] s code as posted in his reply reproduces the problem with
> Groovy 2.4.7 and I confirmed it with 2.4.8 running it in groovyConsole. The difference between this code and the longer one in the SO question is that in the longer version the call works but if called periodically after some time it produces the same Exception.
> {code:title=MessageProducer.groovy|borderStyle=solid}
> import groovy.beans.ListenerList
> interface MessageListener {
>   void messageReceived(byte[] msg)
> }
> class MessageProducer {
>   @ListenerList
>   List<MessageListener> listeners
>   void produce(String msg) {
>     fireMessageReceived(msg.getBytes())
>   }
> }
> producer = new MessageProducer()
> producer.addMessageListener({ println it } as MessageListener)
> producer.produce('Groovy')
> {code}
> {code:title=Stacktrace|borderStyle=solid}
> Exception thrown
> java.lang.NoSuchMethodError: MessageProducer.fireMessageReceived([B)V
>         at MessageProducer$fireMessageReceived$0.callCurrent(Unknown
> Source) at MessageProducer.produce(ConsoleScript0:12)
>         at MessageProducer$produce.call(Unknown Source)
>         at ConsoleScript0.run(ConsoleScript0:18
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)