Re: [ASM 5.1] Error when reading nested type of type variable bound in method signature
Michael Gumowski <[email protected]> Mon, 29 Aug 2016 18:00:18 +0200
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <CABGmqn=uL1c1aqx6-JSd-p84xJ6doZhBkLZwuSCaHT+o4g9iig@mail.gmail.com> |
Hello, Sorry for the delay answering you (holidays...). Thanks for the hint about the compiler. It's seems to be the root cause of my problem. I'm indeed not able to reproduce the issue using solely javac (1.8.0_91), as I'm getting the signature you shows. The signature is correctly generated (and parsed). However, I was observing the issue when dealing with the example I provided in my eclipse IDE, or when building a project with a similar structure using "ant" to build it and "ecj" as compiler. I tried to compare the decompiled code I'm getting when using: - jdk1.8.0_91+javac - ecj-4.6 (eclipse standalone batch java compiler) When looking only to the method, I'm getting the following differences: jdk1.8.0_91: // access flags 0x0 > // signature (Lorg/foo/bytecode/TypeWithNestedGenericClass$Nested<Ljava/ > lang/String;>;)V > // declaration: void method(org.foo.bytecode.TypeWi > thNestedGenericClass$Nested<java.lang.String>) > method(Lorg/foo/bytecode/TypeWithNestedGenericClass$Nested;)V > L0 > LINENUMBER 5 L0 > RETURN > L1 > LOCALVARIABLE this Lorg/foo/bytecode/GenericTypeUsingNestedTypeFromBound; > L0 L1 0 > // signature Lorg/foo/bytecode/GenericTypeU > singNestedTypeFromBound<TU;>; > // declaration: org.foo.bytecode.GenericTypeUs > ingNestedTypeFromBound<U> > LOCALVARIABLE nested Lorg/foo/bytecode/TypeWithNestedGenericClass$Nested; > L0 L1 1 > // signature Lorg/foo/bytecode/TypeWithNest > edGenericClass$Nested<Ljava/lang/String;>; > // declaration: org.foo.bytecode.TypeWithNeste > dGenericClass$Nested<java.lang.String> > MAXSTACK = 0 > MAXLOCALS = 2 > eclipse compiler ecj-4.6: // access flags 0x0 > // signature (TU.Nested<Ljava/lang/String;>;)V > // declaration: void method(U.Nested<Ljava/lang/String, ) > method(Lorg/foo/bytecode/TypeWithNestedGenericClass$Nested;)V > L0 > LINENUMBER 5 L0 > RETURN > L1 > LOCALVARIABLE this Lorg/foo/bytecode/GenericTypeUsingNestedTypeFromBound; > L0 L1 0 > // signature Lorg/foo/bytecode/GenericTypeU > singNestedTypeFromBound<TU;>; > // declaration: org.foo.bytecode.GenericTypeUs > ingNestedTypeFromBound<U> > LOCALVARIABLE nested Lorg/foo/bytecode/TypeWithNestedGenericClass$Nested; > L0 L1 1 > // signature TU.Nested<Ljava/lang/String;>; > // declaration: U.Nested<Ljava/lang/String > MAXSTACK = 0 > MAXLOCALS = 2 > From that point, it seems to me that the issue is therefore on Eclipse side, as they apparently does not follow the JLS when dealing with such cases. I'm probably going to open an ticket on eclipse side. Thanks for your help, *Michael GUMOWSKI* | *SonarSource* *Software Developer @ Language Team* http://sonarsource.com On 15 August 2016 at 19:54, Eric Bruneton <[email protected]> wrote: > This type signature seems incorrect to me (see the signature grammar > specification: > https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.4 > : T > can only be followed by an identifier itself followed by ';') > > If I compile your example with javac (1.8.0_91) I get the following > signature > for this method: (LTypeWithNestedGenericClass$ > Nested<Ljava/lang/String;>;)V > > How did you get "(TU.Nested<Ljava/lang/String;>;)V"? > -- 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