classloader - Uniquely identify a Java class implementation -


i have been dealing poorly branched projects left me dependiencies include several classes exact same qualified name. consequently, have been getting abstractmethoderror calling methods on wrong implementations. solution rename class packages worked fine.

however, wonder whether there better way - can uniquely identify java class implementation?

you can check if 2 classes (or classes of 2 objects) identical:

o1.getclass() == o2.getclass() 

this expression true when classes identical (i.e. loaded same class loader).

afaik there no way determine if class @ runtime got created specific file.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -