Is it possible to use instanceof when passing objects between Threads?

Posted by Risser on Stack Overflow See other posts from Stack Overflow or by Risser
Published on 2010-06-11T20:46:01Z Indexed on 2010/06/11 20:53 UTC
Read the original article Hit count: 204

Filed under:
|
|

I've run into an issue where instanceof works, and then it doesn't. Going into details is difficult, but I think this might be the problem:

Reading this: http://www.theserverside.com/news/thread.tss?thread_id=40229 (search for Thread.currentThread), it seems to imply that, even if the two objects are the same class, if you pass them between threads with different class loaders, instanceof (and isAssignableFrom) might still fail.

This certainly would explain the behavior I'm having, but I was wondering if anyone could verify it?

(I wish the article linked at the beginning of the discussion was still available, but it doesn't seem like it is.)

Thanks, Peter

© Stack Overflow or respective owner

Related posts about java

Related posts about threads