groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul King <pa...@asert.com.au>
Subject Re: @ListenerList generated fireWhatever() method stops working
Date Wed, 08 Mar 2017 10:50:37 GMT
Looks like a bug, I haven't checked the code yet but experimentally,
no array argument (primitive or otherwise) seems to be supported. The
workaround would be to create a holder event class of some kind that
had an array property. Filing a bug issue in Jira would be much
appreciated.

Cheers, Paul.

On Wed, Mar 8, 2017 at 7:49 PM,  <frigo.work@gmail.com> wrote:
> Dear users@groovy.apache.org,
>
> 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.
>
> @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
>
> 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')
>
> The stacktrace is
>
> 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
>
> Are we doing something wrong or is this a bug?
>
> Thank you
> Frigo Pratser

Mime
View raw message