Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.0-beta-3
-
Component/s: None
-
Labels:None
-
Number of attachments :
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 $
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 $
") }
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)