Dear [email protected],
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