Re: Mistake when interface extends interface
Marcel Patzlaff <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
I don't see your point here. You always get the list of direct
superinterfaces (the String[] interfaces argument), so why don't you use
it? A class, regardless if it is a class (except java.lang.Object), an
abstract class or an interface always has at most one super class (given
in the argument superName) and zero or more superinterfaces.
Just forget about "implements" and "extends" and all becomes clear :-D
Regards,
Marcel
Pierre Caserta schrieb:
> Hi,
> it seems impossible to know when an interface inherit another
> interface with ASM, because the extends clause is treated like an
> implements clause when parsing an interface.
> This is very problematic because interface that extends other
> interface have a particular semantic:
>
> Chapter 9.1.2 of the java sun docs second edition :
>
>
> 9.1.2 Superinterfaces and Subinterfaces
>
> If an |extends| clause is provided, then the interface being declared
> extends each of the other named interfaces and therefore inherits the
> member types, methods, and constants of each of the other named
> interfaces. These other named interfaces are the /direct
> superinterfaces/ of the interface being declared. Any class that
> |implements| the declared interface is also considered to implement
> all the interfaces that this interface |extends|.
>
> /ExtendsInterfaces:
> / extends /InterfaceType
> ExtendsInterfaces , InterfaceType
>
>
> /
>
> Bellow I give an example and explain the problem.
>
> The javadoc of the visit method of the ClassVisitor says :
> void *visit*(int version,
> int access,
> java.lang.String name,
> java.lang.String signature,
> java.lang.String superName,
> java.lang.String[] interfaces)
> Visits the header of the class.
> *Parameters:*
> |superName| - the internal of name of the super class (see
> |getInternalName|
> <http://asm.ow2.org/jdiff153to223/ASM%202.2.3/org/objectweb/asm/Type.html#getInternalName%28%29>).
> For interfaces, the super class is |Object|. May be null, but only for
> the |Object| class.
> ----------------------
> For instance I take the "java/util/List" Interface that extends the
> "java/util/Collection" interface.
>
> The visit method will have : superName = "java/lang/Object"
> interfaces = {"java/util/Collection"}
> That is wrong!
> It is like if the extends clause is simply replaced by an implements
> clause, which is not the same.
>
> Does someone have a solution to know if an interface is extending (and
> not implementing) another interface with asm?
>
> --
> Pierre Caserta, Ph.D. Candidate | Email: [email protected]
> Nancy-Université INPL / LORIA, | Phone: (+33) (0)3 54 95 86 18
> Office C-123, | Mobile: (+33) (0)6 76 58 29 42
> 615 Rue du Jardin Botanique, CS 20101 | Web: www.loria.fr/~casertap
> 54603 VILLERS-LES-NANCY Cedex, FRANCE |
>
marcel_patzlaff.vcf
(text/x-vcard, 400 B)
begin:vcard fn:Marcel Patzlaff n:Patzlaff;Marcel org:DAI-Labor / TU-Berlin adr;quoted-printable:Sekr. TEL-14, Ernst-Reuter-Platz 7;;Technische Universit=C3=A4t Berlin;Berlin;;10587;Deutschland email;internet:[email protected] title:Diplom-Informatiker tel;work:+49 30 314 74029 tel;fax:+49 30 314 70003 x-mozilla-html:FALSE url:http://www.dai-labor.de version:2.1 end:vcard
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