Skip to content

Instantly share code, notes, and snippets.

@alalwww
Last active August 29, 2015 14:04
Show Gist options
  • Save alalwww/297a72484ecd412bdf14 to your computer and use it in GitHub Desktop.
Save alalwww/297a72484ecd412bdf14 to your computer and use it in GitHub Desktop.
ラムダ式がクラス内でどういった扱いされてるか試したやつ。ここみてやってみた。http://mw.hatenablog.jp/entry/20140716/1405493674
JRE:1.8.0_05
----------------------------
public static void LambdaTest.main(java.lang.String[]) throws java.lang.Exception
void LambdaTest.method()
private static void LambdaTest.lambda$0(java.lang.String)
private static void LambdaTest.lambda$1(java.lang.Integer)
private static void LambdaTest.lambda$2(java.lang.Long)
private static void LambdaTest.lambda$3(java.lang.Float)
private static void LambdaTest.lambda$4(java.lang.Double)
private static void LambdaTest.lambda$5(java.lang.Byte)
/path/to/classpath>javap -v LambdaTest
Classfile /path/to/classpath/LambdaTest.class
Last modified 2014/07/17; size 3423 bytes
MD5 checksum 3e070404b87be9674c63695d686eb201
Compiled from "LambdaTest.java"
public class LambdaTest
SourceFile: "LambdaTest.java"
BootstrapMethods:
0: #136 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;
Method arguments:
#138 (Ljava/lang/Object;)V
#141 invokestatic LambdaTest.lambda$0:(Ljava/lang/String;)V
#142 (Ljava/lang/String;)V
1: #136 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;
Method arguments:
#143 (Ljava/lang/Object;)V
#146 invokestatic LambdaTest.lambda$1:(Ljava/lang/Integer;)V
#147 (Ljava/lang/Integer;)V
2: #136 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;
Method arguments:
#148 (Ljava/lang/Object;)V
#151 invokestatic LambdaTest.lambda$2:(Ljava/lang/Long;)V
#152 (Ljava/lang/Long;)V
3: #136 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;
Method arguments:
#153 (Ljava/lang/Object;)V
#156 invokestatic LambdaTest.lambda$3:(Ljava/lang/Float;)V
#157 (Ljava/lang/Float;)V
4: #136 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;
Method arguments:
#158 (Ljava/lang/Object;)V
#161 invokestatic LambdaTest.lambda$4:(Ljava/lang/Double;)V
#162 (Ljava/lang/Double;)V
5: #136 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;
Method arguments:
#163 (Ljava/lang/Object;)V
#166 invokestatic LambdaTest.lambda$5:(Ljava/lang/Byte;)V
#167 (Ljava/lang/Byte;)V
6: #136 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;
Method arguments:
#168 (Ljava/lang/Object;)V
#169 invokevirtual java/io/PrintStream.print:(Ljava/lang/String;)V
#170 (Ljava/lang/String;)V
7: #136 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;
Method arguments:
#171 (Ljava/lang/Object;)V
#174 invokevirtual java/io/PrintStream.println:(Ljava/lang/Object;)V
#176 (Ljava/lang/reflect/Method;)V
InnerClasses:
public static final #182= #178 of #180; //Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles
minor version: 0
major version: 52
flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
#1 = Class #2 // LambdaTest
#2 = Utf8 LambdaTest
#3 = Class #4 // java/lang/Object
#4 = Utf8 java/lang/Object
#5 = Utf8 staticField
#6 = Utf8 Ljava/util/function/Consumer;
#7 = Utf8 Signature
#8 = Utf8 Ljava/util/function/Consumer<Ljava/lang/String;>;
#9 = Utf8 instancefield
#10 = Utf8 Ljava/util/function/Consumer<Ljava/lang/Integer;>;
#11 = Utf8 <clinit>
#12 = Utf8 ()V
#13 = Utf8 Code
#14 = NameAndType #15:#16 // accept:()Ljava/util/function/Consumer;
#15 = Utf8 accept
#16 = Utf8 ()Ljava/util/function/Consumer;
#17 = InvokeDynamic #0:#14 // #0:accept:()Ljava/util/function/Consumer;
#18 = Fieldref #1.#19 // LambdaTest.staticField:Ljava/util/function/Consumer;
#19 = NameAndType #5:#6 // staticField:Ljava/util/function/Consumer;
#20 = Utf8 LineNumberTable
#21 = Utf8 LocalVariableTable
#22 = Utf8 <init>
#23 = Methodref #3.#24 // java/lang/Object."<init>":()V
#24 = NameAndType #22:#12 // "<init>":()V
#25 = InvokeDynamic #1:#14 // #1:accept:()Ljava/util/function/Consumer;
#26 = Fieldref #1.#27 // LambdaTest.instancefield:Ljava/util/function/Consumer;
#27 = NameAndType #9:#6 // instancefield:Ljava/util/function/Consumer;
#28 = InvokeDynamic #2:#14 // #2:accept:()Ljava/util/function/Consumer;
#29 = Methodref #30.#32 // java/util/Optional.empty:()Ljava/util/Optional;
#30 = Class #31 // java/util/Optional
#31 = Utf8 java/util/Optional
#32 = NameAndType #33:#34 // empty:()Ljava/util/Optional;
#33 = Utf8 empty
#34 = Utf8 ()Ljava/util/Optional;
#35 = InvokeDynamic #3:#14 // #3:accept:()Ljava/util/function/Consumer;
#36 = Methodref #30.#37 // java/util/Optional.ifPresent:(Ljava/util/function/Consumer;)V
#37 = NameAndType #38:#39 // ifPresent:(Ljava/util/function/Consumer;)V
#38 = Utf8 ifPresent
#39 = Utf8 (Ljava/util/function/Consumer;)V
#40 = Utf8 this
#41 = Utf8 LLambdaTest;
#42 = Utf8 constructorLocal
#43 = Utf8 LocalVariableTypeTable
#44 = Utf8 Ljava/util/function/Consumer<Ljava/lang/Long;>;
#45 = Utf8 method
#46 = InvokeDynamic #4:#14 // #4:accept:()Ljava/util/function/Consumer;
#47 = Utf8 instanceLocal
#48 = Utf8 Ljava/util/function/Consumer<Ljava/lang/Double;>;
#49 = Utf8 main
#50 = Utf8 ([Ljava/lang/String;)V
#51 = Utf8 Exceptions
#52 = Class #53 // java/lang/Exception
#53 = Utf8 java/lang/Exception
#54 = InvokeDynamic #5:#14 // #5:accept:()Ljava/util/function/Consumer;
#55 = Fieldref #56.#58 // java/lang/System.out:Ljava/io/PrintStream;
#56 = Class #57 // java/lang/System
#57 = Utf8 java/lang/System
#58 = NameAndType #59:#60 // out:Ljava/io/PrintStream;
#59 = Utf8 out
#60 = Utf8 Ljava/io/PrintStream;
#61 = String #62 // JRE:
#62 = Utf8 JRE:
#63 = Methodref #64.#66 // java/io/PrintStream.print:(Ljava/lang/String;)V
#64 = Class #65 // java/io/PrintStream
#65 = Utf8 java/io/PrintStream
#66 = NameAndType #67:#68 // print:(Ljava/lang/String;)V
#67 = Utf8 print
#68 = Utf8 (Ljava/lang/String;)V
#69 = String #70 // java.version
#70 = Utf8 java.version
#71 = Methodref #56.#72 // java/lang/System.getProperty:(Ljava/lang/String;)Ljava/lang/String;
#72 = NameAndType #73:#74 // getProperty:(Ljava/lang/String;)Ljava/lang/String;
#73 = Utf8 getProperty
#74 = Utf8 (Ljava/lang/String;)Ljava/lang/String;
#75 = Methodref #30.#76 // java/util/Optional.ofNullable:(Ljava/lang/Object;)Ljava/util/Optional;
#76 = NameAndType #77:#78 // ofNullable:(Ljava/lang/Object;)Ljava/util/Optional;
#77 = Utf8 ofNullable
#78 = Utf8 (Ljava/lang/Object;)Ljava/util/Optional;
#79 = NameAndType #15:#80 // accept:(Ljava/io/PrintStream;)Ljava/util/function/Consumer;
#80 = Utf8 (Ljava/io/PrintStream;)Ljava/util/function/Consumer;
#81 = InvokeDynamic #6:#79 // #6:accept:(Ljava/io/PrintStream;)Ljava/util/function/Consumer;
#82 = String #83 // \n----------------------------
#83 = Utf8 \n----------------------------
#84 = Methodref #64.#85 // java/io/PrintStream.println:(Ljava/lang/String;)V
#85 = NameAndType #86:#68 // println:(Ljava/lang/String;)V
#86 = Utf8 println
#87 = Methodref #88.#90 // java/lang/Class.getDeclaredMethods:()[Ljava/lang/reflect/Method;
#88 = Class #89 // java/lang/Class
#89 = Utf8 java/lang/Class
#90 = NameAndType #91:#92 // getDeclaredMethods:()[Ljava/lang/reflect/Method;
#91 = Utf8 getDeclaredMethods
#92 = Utf8 ()[Ljava/lang/reflect/Method;
#93 = Methodref #94.#96 // java/util/Arrays.stream:([Ljava/lang/Object;)Ljava/util/stream/Stream;
#94 = Class #95 // java/util/Arrays
#95 = Utf8 java/util/Arrays
#96 = NameAndType #97:#98 // stream:([Ljava/lang/Object;)Ljava/util/stream/Stream;
#97 = Utf8 stream
#98 = Utf8 ([Ljava/lang/Object;)Ljava/util/stream/Stream;
#99 = InvokeDynamic #7:#79 // #7:accept:(Ljava/io/PrintStream;)Ljava/util/function/Consumer;
#100 = InterfaceMethodref #101.#103 // java/util/stream/Stream.forEach:(Ljava/util/function/Consumer;)V
#101 = Class #102 // java/util/stream/Stream
#102 = Utf8 java/util/stream/Stream
#103 = NameAndType #104:#39 // forEach:(Ljava/util/function/Consumer;)V
#104 = Utf8 forEach
#105 = Utf8 args
#106 = Utf8 [Ljava/lang/String;
#107 = Utf8 staticLocal
#108 = Utf8 Ljava/util/function/Consumer<Ljava/lang/Byte;>;
#109 = Utf8 lambda$0
#110 = Utf8 o
#111 = Utf8 Ljava/lang/String;
#112 = Utf8 lambda$1
#113 = Utf8 (Ljava/lang/Integer;)V
#114 = Utf8 Ljava/lang/Integer;
#115 = Utf8 lambda$2
#116 = Utf8 (Ljava/lang/Long;)V
#117 = Utf8 Ljava/lang/Long;
#118 = Utf8 lambda$3
#119 = Utf8 (Ljava/lang/Float;)V
#120 = Utf8 Ljava/lang/Float;
#121 = Utf8 lambda$4
#122 = Utf8 (Ljava/lang/Double;)V
#123 = Utf8 Ljava/lang/Double;
#124 = Utf8 lambda$5
#125 = Utf8 (Ljava/lang/Byte;)V
#126 = Utf8 Ljava/lang/Byte;
#127 = Utf8 SourceFile
#128 = Utf8 LambdaTest.java
#129 = Utf8 BootstrapMethods
#130 = Methodref #131.#133 // java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/Me
thodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
#131 = Class #132 // java/lang/invoke/LambdaMetafactory
#132 = Utf8 java/lang/invoke/LambdaMetafactory
#133 = NameAndType #134:#135 // metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHa
ndle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
#134 = Utf8 metafactory
#135 = Utf8 (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodT
ype;)Ljava/lang/invoke/CallSite;
#136 = MethodHandle #6:#130 // invokestatic java/lang/invoke/LambdaMetafactory.metafactory:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/l
ang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;
#137 = Utf8 (Ljava/lang/Object;)V
#138 = MethodType #137 // (Ljava/lang/Object;)V
#139 = Methodref #1.#140 // LambdaTest.lambda$0:(Ljava/lang/String;)V
#140 = NameAndType #109:#68 // lambda$0:(Ljava/lang/String;)V
#141 = MethodHandle #6:#139 // invokestatic LambdaTest.lambda$0:(Ljava/lang/String;)V
#142 = MethodType #68 // (Ljava/lang/String;)V
#143 = MethodType #137 // (Ljava/lang/Object;)V
#144 = Methodref #1.#145 // LambdaTest.lambda$1:(Ljava/lang/Integer;)V
#145 = NameAndType #112:#113 // lambda$1:(Ljava/lang/Integer;)V
#146 = MethodHandle #6:#144 // invokestatic LambdaTest.lambda$1:(Ljava/lang/Integer;)V
#147 = MethodType #113 // (Ljava/lang/Integer;)V
#148 = MethodType #137 // (Ljava/lang/Object;)V
#149 = Methodref #1.#150 // LambdaTest.lambda$2:(Ljava/lang/Long;)V
#150 = NameAndType #115:#116 // lambda$2:(Ljava/lang/Long;)V
#151 = MethodHandle #6:#149 // invokestatic LambdaTest.lambda$2:(Ljava/lang/Long;)V
#152 = MethodType #116 // (Ljava/lang/Long;)V
#153 = MethodType #137 // (Ljava/lang/Object;)V
#154 = Methodref #1.#155 // LambdaTest.lambda$3:(Ljava/lang/Float;)V
#155 = NameAndType #118:#119 // lambda$3:(Ljava/lang/Float;)V
#156 = MethodHandle #6:#154 // invokestatic LambdaTest.lambda$3:(Ljava/lang/Float;)V
#157 = MethodType #119 // (Ljava/lang/Float;)V
#158 = MethodType #137 // (Ljava/lang/Object;)V
#159 = Methodref #1.#160 // LambdaTest.lambda$4:(Ljava/lang/Double;)V
#160 = NameAndType #121:#122 // lambda$4:(Ljava/lang/Double;)V
#161 = MethodHandle #6:#159 // invokestatic LambdaTest.lambda$4:(Ljava/lang/Double;)V
#162 = MethodType #122 // (Ljava/lang/Double;)V
#163 = MethodType #137 // (Ljava/lang/Object;)V
#164 = Methodref #1.#165 // LambdaTest.lambda$5:(Ljava/lang/Byte;)V
#165 = NameAndType #124:#125 // lambda$5:(Ljava/lang/Byte;)V
#166 = MethodHandle #6:#164 // invokestatic LambdaTest.lambda$5:(Ljava/lang/Byte;)V
#167 = MethodType #125 // (Ljava/lang/Byte;)V
#168 = MethodType #137 // (Ljava/lang/Object;)V
#169 = MethodHandle #5:#63 // invokevirtual java/io/PrintStream.print:(Ljava/lang/String;)V
#170 = MethodType #68 // (Ljava/lang/String;)V
#171 = MethodType #137 // (Ljava/lang/Object;)V
#172 = Methodref #64.#173 // java/io/PrintStream.println:(Ljava/lang/Object;)V
#173 = NameAndType #86:#137 // println:(Ljava/lang/Object;)V
#174 = MethodHandle #5:#172 // invokevirtual java/io/PrintStream.println:(Ljava/lang/Object;)V
#175 = Utf8 (Ljava/lang/reflect/Method;)V
#176 = MethodType #175 // (Ljava/lang/reflect/Method;)V
#177 = Utf8 InnerClasses
#178 = Class #179 // java/lang/invoke/MethodHandles$Lookup
#179 = Utf8 java/lang/invoke/MethodHandles$Lookup
#180 = Class #181 // java/lang/invoke/MethodHandles
#181 = Utf8 java/lang/invoke/MethodHandles
#182 = Utf8 Lookup
{
static final java.util.function.Consumer<java.lang.String> staticField;
descriptor: Ljava/util/function/Consumer;
flags: ACC_STATIC, ACC_FINAL
Signature: #8 // Ljava/util/function/Consumer<Ljava/lang/String;>;
final java.util.function.Consumer<java.lang.Integer> instancefield;
descriptor: Ljava/util/function/Consumer;
flags: ACC_FINAL
Signature: #10 // Ljava/util/function/Consumer<Ljava/lang/Integer;>;
static {};
descriptor: ()V
flags: ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: invokedynamic #17, 0 // InvokeDynamic #0:accept:()Ljava/util/function/Consumer;
5: putstatic #18 // Field staticField:Ljava/util/function/Consumer;
8: return
LineNumberTable:
line 6: 0
LocalVariableTable:
Start Length Slot Name Signature
LambdaTest();
descriptor: ()V
flags:
Code:
stack=2, locals=2, args_size=1
0: aload_0
1: invokespecial #23 // Method java/lang/Object."<init>":()V
4: aload_0
5: invokedynamic #25, 0 // InvokeDynamic #1:accept:()Ljava/util/function/Consumer;
10: putfield #26 // Field instancefield:Ljava/util/function/Consumer;
13: invokedynamic #28, 0 // InvokeDynamic #2:accept:()Ljava/util/function/Consumer;
18: astore_1
19: invokestatic #29 // Method java/util/Optional.empty:()Ljava/util/Optional;
22: invokedynamic #35, 0 // InvokeDynamic #3:accept:()Ljava/util/function/Consumer;
27: invokevirtual #36 // Method java/util/Optional.ifPresent:(Ljava/util/function/Consumer;)V
30: return
LineNumberTable:
line 9: 0
line 7: 4
line 10: 13
line 11: 19
line 12: 30
LocalVariableTable:
Start Length Slot Name Signature
0 31 0 this LLambdaTest;
19 12 1 constructorLocal Ljava/util/function/Consumer;
LocalVariableTypeTable:
Start Length Slot Name Signature
19 12 1 constructorLocal Ljava/util/function/Consumer<Ljava/lang/Long;>;
void method();
descriptor: ()V
flags:
Code:
stack=1, locals=2, args_size=1
0: invokedynamic #46, 0 // InvokeDynamic #4:accept:()Ljava/util/function/Consumer;
5: astore_1
6: return
LineNumberTable:
line 15: 0
line 16: 6
LocalVariableTable:
Start Length Slot Name Signature
0 7 0 this LLambdaTest;
6 1 1 instanceLocal Ljava/util/function/Consumer;
LocalVariableTypeTable:
Start Length Slot Name Signature
6 1 1 instanceLocal Ljava/util/function/Consumer<Ljava/lang/Double;>;
public static void main(java.lang.String[]) throws java.lang.Exception;
descriptor: ([Ljava/lang/String;)V
flags: ACC_PUBLIC, ACC_STATIC
Exceptions:
throws java.lang.Exception
Code:
stack=2, locals=2, args_size=1
0: invokedynamic #54, 0 // InvokeDynamic #5:accept:()Ljava/util/function/Consumer;
5: astore_1
6: getstatic #55 // Field java/lang/System.out:Ljava/io/PrintStream;
9: ldc #61 // String JRE:
11: invokevirtual #63 // Method java/io/PrintStream.print:(Ljava/lang/String;)V
14: ldc #69 // String java.version
16: invokestatic #71 // Method java/lang/System.getProperty:(Ljava/lang/String;)Ljava/lang/String;
19: invokestatic #75 // Method java/util/Optional.ofNullable:(Ljava/lang/Object;)Ljava/util/Optional;
22: getstatic #55 // Field java/lang/System.out:Ljava/io/PrintStream;
25: invokedynamic #81, 0 // InvokeDynamic #6:accept:(Ljava/io/PrintStream;)Ljava/util/function/Consumer;
30: invokevirtual #36 // Method java/util/Optional.ifPresent:(Ljava/util/function/Consumer;)V
33: getstatic #55 // Field java/lang/System.out:Ljava/io/PrintStream;
36: ldc #82 // String \n----------------------------
38: invokevirtual #84 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
41: ldc #1 // class LambdaTest
43: invokevirtual #87 // Method java/lang/Class.getDeclaredMethods:()[Ljava/lang/reflect/Method;
46: invokestatic #93 // Method java/util/Arrays.stream:([Ljava/lang/Object;)Ljava/util/stream/Stream;
49: getstatic #55 // Field java/lang/System.out:Ljava/io/PrintStream;
52: invokedynamic #99, 0 // InvokeDynamic #7:accept:(Ljava/io/PrintStream;)Ljava/util/function/Consumer;
57: invokeinterface #100, 2 // InterfaceMethod java/util/stream/Stream.forEach:(Ljava/util/function/Consumer;)V
62: return
LineNumberTable:
line 19: 0
line 21: 6
line 22: 14
line 23: 33
line 24: 41
line 25: 62
LocalVariableTable:
Start Length Slot Name Signature
0 63 0 args [Ljava/lang/String;
6 57 1 staticLocal Ljava/util/function/Consumer;
LocalVariableTypeTable:
Start Length Slot Name Signature
6 57 1 staticLocal Ljava/util/function/Consumer<Ljava/lang/Byte;>;
}
import java.util.Arrays;
import java.util.Optional;
import java.util.function.Consumer;
public class LambdaTest {
final static Consumer<String> staticField = o -> {};
final Consumer<Integer> instancefield = o -> {};
LambdaTest() {
final Consumer<Long> constructorLocal = o -> {};
Optional.<Float> empty().ifPresent(o -> {}); // inline
}
void method() {
final Consumer<Double> instanceLocal = o -> {};
}
public static void main(String[] args) throws Exception {
final Consumer<Byte> staticLocal = o -> {};
System.out.print("JRE:");
Optional.ofNullable(System.getProperty("java.version")).ifPresent(System.out::print);
System.out.println("\n----------------------------");
Arrays.stream(LambdaTest.class.getDeclaredMethods()).forEach(System.out::println);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment