Mistake when interface extends interface

Pierre Caserta <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
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  |
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.