In XThis.java, the invoke() method of the Handler class does not implement the Object protocol. I think that it should. The particular method that I'm missing is hashCode() (and probably equals(), but I haven't gotten that far yet), but I think it should do the right thing for all the Object methods.
The code that I used to find this was:
toolkit = java.awt.Toolkit.getDefaultToolkit();
handler = (java.awt.event.AWTEventListener)this;
I wanted to track the mouse position so that I could control it with a java.awt.Robot.
For now, I can work around the bug by writing the methods I need, but I think Beanshell should do this for me.
My reading of the documentation implies that I shouldn't need the explicit cast to java.awt.AWTEventListener, but it didn't work otherwise.
Log in to post a comment.