I am using beanshell 2.0b4. I'm using the
interpreter's "getIntergace(Class)" method to obtain an
object implementing a certain interface, whose methods
I found the following problem with the objects returned
Executable rule = compiler.compileRule(br);
System.out.println("equals?" + rule.equals(rule));
System.out.println("toString?" + rule.toString().equals
When I execute this, I find that rule.equals(rule) always
I came to this because I was having trouble using those
objects as keys in a hashtable. They never appeared to
be in the hashtable, and I diagnosed it down to
the .equals() method of those objects.
Funny thing is that rule.toString().equals(rule.toString())
does indeed return true. In the mean time I'm planning
to use rule.toString() instad of rule, as keys for the
hashtable. However, I fear that maybe the hashcode will
change in time. żis this a bug, or is this indeed inteded?
thank you for your time
Log in to post a comment.