Re: Handling of interfaces in SimpleVerifier
Rémi Forax <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
Le 04/01/2011 16:29, Michael Orlov a écrit :
> Hi,
>
> I don't understand the recent change in SimpleVerifier's
> isAssignableFrom() method (in 3.3.1):
>
> + if (isInterface) {
> + return u.getSort() == Type.OBJECT || u.getSort()
> == Type.ARRAY;
> + }
>
> and
>
> - return getClass(t).isAssignableFrom(getClass(u));
> + Class tc = getClass(t);
> + if (tc.isInterface()) {
> + tc = Object.class;
> + }
> + return tc.isAssignableFrom(getClass(u));
>
> Consider t=Comparable and u=Class, or t=Comparable and u=Object. Both
> cases should return false, but isAssignableFrom() returns true. Maybe I
> am missing something?
>
> Thanks,
> Michael
The main problem is that you can't create a java.lang.Class which is the
union (merge) of two interfaces so isAssignableFrom need to be relaxed.
The SUN verifier implements exactly the same rule and the VM
later checks interface at runtime.
Rémi
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws