Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Listeners print null by default when toString() is called, which is very confusing.
groovy> b = new javax.swing.JButton("foo")
groovy> b.actionPerformed = { println("Found ${it}") }
groovy> println(b.actionListeners)
groovy>
[null]
when its really a dynamic proxy
groovy> b = new javax.swing.JButton("foo")
groovy> b.actionPerformed = { println("Found ${it}") }
groovy> b.actionListeners.each
groovy>
class $Proxy0
also we can't remove these listeners...
groovy> import java.util.Arrays
groovy> b = new javax.swing.JButton("foo")
groovy> b.actionPerformed = { println("Found ${it}") }
groovy> l = Arrays.asList(b.actionListeners).get(0)
groovy> println(l)
groovy> b.removeActionListener(l)
groovy> b.actionListeners
groovy>
null
Caught: java.lang.NullPointerException
java.lang.NullPointerException
at $Proxy0.equals(Unknown Source)