The object stored in the target list isn't the InvokerProxyHA impl. It's a:
1) RMI stub for the JRMP invoker
2) String/URL for HTTP invoker
3) ServerAddress for the PooledInvoker
4) InvokerLocator for the UnifiedInvoker EJB3
All of those implement equals/hashCode.
There was a bug in some earlier AS versions (4.0.3x, maybe 4.0.4??) where the equals/hashCode impl in ServerAddress was broken.
I am seeing the issue with 4.0.4, but not for the reason that you mentioned. ServerAddress in 4.0.4 has an equals method but its not called by the PooledInvokerProxy. The PooledInvokerProxy is actually stored in the targets list (this is true for load balancing.
This would be true for anyone that switches from using RMI to org.jboss.invocation.pooled.server.PooledInvokerHA.
PooledInvokerProxy contains a ServerAddress, which should be used for the equality check.
OK, I see the problem. I didn't think you'd be totally off-base in a bug report; so I was scratching my head a bit. :)
Looks like this is limited to the PooledInvoker then; for the other InvokerHA impls, getStub() returns the types as I described. The value returned from that method is what populates the target list.
Cool, then I don't need to worry about the other Invokers! Thanks for the feedback!
4.2 + head has the fix to PooledInvokerProxy (added equals method).