Sylvain Wallez wrote:
I haven't followed all the discussion, but why is toString() used toI have asked the same question :) And didn't get any answer :(
identify components?
Yupp. As we learn from Lars, using toString() is not secure!Wouldn't it be better to use a Map keyed by the identy of the object like java.util.IdentityHashMap()? That way, we ensure there's no possible collision between two instances of the same component, and also avoid any problem related to classes redefining their own hashcode() and equals() methods.
So, we should change the use of the StaticBucketMap to a safer implementation and remove these toString() calls in Excalibur component.
Yep. What about a "IdentityStaticBucketMap" that would keep the reduced lock contention features of StaticBiucketMap?
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects } Orixo, the opensource XML business alliance - http://www.orixo.com
