On 9/3/20 9:03 AM, Peter Levart wrote:
For example, if (o instanceof IdentityObject) evaluates to true, but o.getClass().getInterfaces() does not contain IdentityObject.class,

...well, this is not the right comparison as the 1st test looks for IdentityObject implemented anywhere in the type hierarchy of o's runtime class while the 2nd expression only looks for interfaces declared by the runtime class itself. But anyway, it would be surprising to find VM claim that some class implements IdentityObject (for example by throwing a runtime error at linkage attempt with some inline subclass) and at the same time omit IdentityObject from Class.getInterfaces()...


Peter

Reply via email to