Commit 90934464 authored by Tobias Gruetzmacher's avatar Tobias Gruetzmacher
Browse files

Testcase for bytecode of Groovy-Eclipse compiler

This shows a problem where the Groovy-Eclipse compiler creates a type
signature of "!+Ljava/lang/Object;", which asm cannot parse.
parent 58d73da3
Pipeline #2460 failed with stage
in 1 minute and 13 seconds
......@@ -127,6 +127,7 @@ public abstract class AsmTest {
JDK8_ARTIFICIAL_STRUCTURES("jdk8.ArtificialStructures"),
JDK8_INNER_CLASS("jdk8.AllStructures$InnerClass"),
JDK8_LARGE_METHOD("jdk8.LargeMethod"),
JDK8_ECLIPSE_GROOVY_LAMBDA("jdk8.EclipseGroovyLambda"),
JDK9_MODULE("jdk9.module-info"),
JDK11_ALL_INSTRUCTIONS("jdk11.AllInstructions"),
JDK11_ALL_STRUCTURES("jdk11.AllStructures"),
......
package jdk8;
import java.util.List;
import java.util.stream.Collectors;
/**
* This class should be compiled by the Groovy-Eclipse compiler, to expose an unusual
* type signature generated by that compiler.
*
*/
public interface EclipseGroovyLambda {
default List<String> isCreated (List<? extends Object> input) {
return input.stream ().map (to -> to.toString ()).collect (Collectors.toList ());
}
}
// class version 52.0 (52)
// access flags 0x601
public abstract interface jdk8/EclipseGroovyLambda {
// compiled from: EclipseGroovyLambda.java
// access flags 0x19
public final static INNERCLASS java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup
// access flags 0x1
// signature (Ljava/util/List<+Ljava/lang/Object;>;)Ljava/util/List<Ljava/lang/String;>;
// declaration: java.util.List<java.lang.String> (java.util.List<? extends java.lang.Object>)
public default isCreated(Ljava/util/List;)Ljava/util/List;
L0
LINENUMBER 9 L0
ALOAD 1
INVOKEINTERFACE java/util/List.stream ()Ljava/util/stream/Stream; (itf)
INVOKEDYNAMIC apply()Ljava/util/function/Function; [
// handle kind 0x6 : INVOKESTATIC
java/lang/invoke/LambdaMetafactory.metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
// arguments:
(Ljava/lang/Object;)Ljava/lang/Object;,
// handle kind 0x6 : INVOKESTATIC
jdk8/EclipseGroovyLambda.lambda$0(Ljava/lang/Object;)Ljava/lang/String; itf,
(Ljava/lang/Object;)Ljava/lang/String;
]
INVOKEINTERFACE java/util/stream/Stream.map (Ljava/util/function/Function;)Ljava/util/stream/Stream; (itf)
INVOKESTATIC java/util/stream/Collectors.toList ()Ljava/util/stream/Collector;
INVOKEINTERFACE java/util/stream/Stream.collect (Ljava/util/stream/Collector;)Ljava/lang/Object; (itf)
CHECKCAST java/util/List
ARETURN
L1
LOCALVARIABLE this Ljdk8/EclipseGroovyLambda; L0 L1 0
LOCALVARIABLE input Ljava/util/List; L0 L1 1
// signature Ljava/util/List<+Ljava/lang/Object;>;
// declaration: extends java.util.List<? extends java.lang.Object>
MAXSTACK = 2
MAXLOCALS = 2
// access flags 0x100A
private static synthetic lambda$0(Ljava/lang/Object;)Ljava/lang/String;
L0
LINENUMBER 9 L0
ALOAD 0
INVOKEVIRTUAL java/lang/Object.toString ()Ljava/lang/String;
ARETURN
L1
LOCALVARIABLE to Ljava/lang/Object; L0 L1 0
// signature !+Ljava/lang/Object;
// declaration:
MAXSTACK = 1
MAXLOCALS = 1
}
......@@ -246,7 +246,8 @@ public class SignatureReader {
return offset;
default:
throw new IllegalArgumentException();
throw new IllegalArgumentException(
"Could not parse '" + currentChar + "' in signature '" + signature + "'.");
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment