Per Bothner wrote:
I'm assuming here that the VM guarantees that only one Method object
will ever be created for each declared method in a class.

Why are you assuming this? It is possible the VM internal data structures are unrelated to java.lang.reflect.Method, and so it may make sense to create a new one each time it is requested than try to cache it.

You're right, you could certainly do things that way instead and in that case my idea of using "this == o" for equals() wouldn't work.

In that case the VM implementor better take a look at Field.equals()
and Constructor.equals() too because that's what they do as well.
So perhaps all three should be annotated with appropriate comments.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Precision I/O      *     http://www.precisionio.com



_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to