Skip to content

Instantly share code, notes, and snippets.

@rightfold

rightfold/a.java Secret

Created June 27, 2015 23:54
Show Gist options
  • Save rightfold/554c9e4bd8ce297590ab to your computer and use it in GitHub Desktop.
Save rightfold/554c9e4bd8ce297590ab to your computer and use it in GitHub Desktop.
import java.util.stream.Stream;
class a { public static Object f() {
int n = 42;
return Stream.<Integer>of().map(x -> x * n);
} }
class a {
a();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static java.lang.Object f();
Code:
0: bipush 42
2: istore_0
3: iconst_0
4: anewarray #2 // class java/lang/Integer
7: invokestatic #3 // InterfaceMethod java/util/stream/Stream.of:([Ljava/lang/Object;)Ljava/util/stream/Stream;
10: iload_0
11: invokedynamic #4, 0 // InvokeDynamic #0:apply:(I)Ljava/util/function/Function;
16: invokeinterface #5, 2 // InterfaceMethod java/util/stream/Stream.map:(Ljava/util/function/Function;)Ljava/util/stream/Stream;
21: areturn
private static java.lang.Integer lambda$f$0(int, java.lang.Integer);
Code:
0: aload_1
1: invokevirtual #6 // Method java/lang/Integer.intValue:()I
4: iload_0
5: imul
6: invokestatic #7 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
9: areturn
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment