Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A scala case class decompiled using javap
public class Book implements scala.Product,scala.Serializable {
public static scala.Option<scala.Tuple3<java.lang.Object, java.lang.String, java.lang.Object>> unapply(Book);
Code:
0: getstatic #20 // Field Book$.MODULE$:LBook$;
3: aload_0
4: invokevirtual #22 // Method Book$.unapply:(LBook;)Lscala/Option;
7: areturn
public static Book apply(int, java.lang.String, long);
Code:
0: getstatic #20 // Field Book$.MODULE$:LBook$;
3: iload_0
4: aload_1
5: lload_2
6: invokevirtual #26 // Method Book$.apply:(ILjava/lang/String;J)LBook;
9: areturn
public static scala.Function1<scala.Tuple3<java.lang.Object, java.lang.String, java.lang.Object>, Book> tupled();
Code:
0: getstatic #20 // Field Book$.MODULE$:LBook$;
3: invokevirtual #30 // Method Book$.tupled:()Lscala/Function1;
6: areturn
public static scala.Function1<java.lang.Object, scala.Function1<java.lang.String, scala.Function1<java.lang.Object, Book>>> curried();
Code:
0: getstatic #20 // Field Book$.MODULE$:LBook$;
3: invokevirtual #33 // Method Book$.curried:()Lscala/Function1;
6: areturn
public int id$1();
Code:
0: aload_0
1: getfield #43 // Field id:I
4: ireturn
public java.lang.String title$1();
Code:
0: aload_0
1: getfield #49 // Field title:Ljava/lang/String;
4: areturn
public long isbn$1();
Code:
0: aload_0
1: getfield #53 // Field isbn:J
4: lreturn
public Book copy(int, java.lang.String, long);
Code:
0: new #2 // class Book
3: dup
4: iload_1
5: aload_2
6: lload_3
7: invokespecial #58 // Method "<init>":(ILjava/lang/String;J)V
10: areturn
public int copy$default$1();
Code:
0: aload_0
1: invokespecial #61 // Method id:()I
4: ireturn
public java.lang.String copy$default$2();
Code:
0: aload_0
1: invokespecial #64 // Method title:()Ljava/lang/String;
4: areturn
public long copy$default$3();
Code:
0: aload_0
1: invokespecial #67 // Method isbn:()J
4: lreturn
public java.lang.String productPrefix();
Code:
0: ldc #69 // String Book
2: areturn
public int productArity();
Code:
0: iconst_3
1: ireturn
public java.lang.Object productElement(int);
Code:
0: iload_1
1: istore_2
2: iload_2
3: tableswitch { // 0 to 2
0: 60
1: 53
2: 43
default: 28
}
28: new #74 // class java/lang/IndexOutOfBoundsException
31: dup
32: iload_1
33: invokestatic #80 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
36: invokevirtual #83 // Method java/lang/Object.toString:()Ljava/lang/String;
39: invokespecial #86 // Method java/lang/IndexOutOfBoundsException."<init>":(Ljava/lang/String;)V
42: athrow
43: aload_0
44: invokevirtual #88 // Method isbn$1:()J
47: invokestatic #92 // Method scala/runtime/BoxesRunTime.boxToLong:(J)Ljava/lang/Long;
50: goto 67
53: aload_0
54: invokevirtual #94 // Method title$1:()Ljava/lang/String;
57: goto 67
60: aload_0
61: invokevirtual #96 // Method id$1:()I
64: invokestatic #80 // Method scala/runtime/BoxesRunTime.boxToInteger:(I)Ljava/lang/Integer;
67: areturn
public scala.collection.Iterator<java.lang.Object> productIterator();
Code:
0: getstatic #104 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
3: aload_0
4: invokevirtual #108 // Method scala/runtime/ScalaRunTime$.typedProductIterator:(Lscala/Product;)Lscala/collection/Iterator;
7: areturn
public boolean canEqual(java.lang.Object);
Code:
0: aload_1
1: instanceof #2 // class Book
4: ireturn
public int hashCode();
Code:
0: ldc #113 // int -889275714
2: istore_1
3: iload_1
4: aload_0
5: invokevirtual #96 // Method id$1:()I
8: invokestatic #119 // Method scala/runtime/Statics.mix:(II)I
11: istore_1
12: iload_1
13: aload_0
14: invokevirtual #94 // Method title$1:()Ljava/lang/String;
17: invokestatic #123 // Method scala/runtime/Statics.anyHash:(Ljava/lang/Object;)I
20: invokestatic #119 // Method scala/runtime/Statics.mix:(II)I
23: istore_1
24: iload_1
25: aload_0
26: invokevirtual #88 // Method isbn$1:()J
29: invokestatic #127 // Method scala/runtime/Statics.longHash:(J)I
32: invokestatic #119 // Method scala/runtime/Statics.mix:(II)I
35: istore_1
36: iload_1
37: iconst_3
38: invokestatic #130 // Method scala/runtime/Statics.finalizeHash:(II)I
41: ireturn
public java.lang.String toString();
Code:
0: getstatic #104 // Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$;
3: aload_0
4: invokevirtual #134 // Method scala/runtime/ScalaRunTime$._toString:(Lscala/Product;)Ljava/lang/String;
7: areturn
public boolean equals(java.lang.Object);
Code:
0: aload_0
1: aload_1
2: if_acmpeq 105
5: aload_1
6: astore_2
7: aload_2
8: instanceof #2 // class Book
11: ifeq 19
14: iconst_1
15: istore_3
16: goto 21
19: iconst_0
20: istore_3
21: iload_3
22: ifeq 109
25: aload_1
26: checkcast #2 // class Book
29: astore 4
31: aload_0
32: invokevirtual #96 // Method id$1:()I
35: aload 4
37: invokevirtual #96 // Method id$1:()I
40: if_icmpne 101
43: aload_0
44: invokevirtual #94 // Method title$1:()Ljava/lang/String;
47: aload 4
49: invokevirtual #94 // Method title$1:()Ljava/lang/String;
52: astore 5
54: dup
55: ifnonnull 67
58: pop
59: aload 5
61: ifnull 75
64: goto 101
67: aload 5
69: invokevirtual #137 // Method java/lang/Object.equals:(Ljava/lang/Object;)Z
72: ifeq 101
75: aload_0
76: invokevirtual #88 // Method isbn$1:()J
79: aload 4
81: invokevirtual #88 // Method isbn$1:()J
84: lcmp
85: ifne 101
88: aload 4
90: aload_0
91: invokevirtual #139 // Method canEqual:(Ljava/lang/Object;)Z
94: ifeq 101
97: iconst_1
98: goto 102
101: iconst_0
102: ifeq 109
105: iconst_1
106: goto 110
109: iconst_0
110: ireturn
public Book(int, java.lang.String, long);
Code:
0: aload_0
1: iload_1
2: putfield #43 // Field id:I
5: aload_0
6: aload_2
7: putfield #49 // Field title:Ljava/lang/String;
10: aload_0
11: lload_3
12: putfield #53 // Field isbn:J
15: aload_0
16: invokespecial #144 // Method java/lang/Object."<init>":()V
19: aload_0
20: invokestatic #150 // Method scala/Product$class.$init$:(Lscala/Product;)V
23: return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.