Skip to content

Instantly share code, notes, and snippets.

@LeastFixedPoint
Created September 21, 2012 23:14
Show Gist options
  • Save LeastFixedPoint/3764452 to your computer and use it in GitHub Desktop.
Save LeastFixedPoint/3764452 to your computer and use it in GitHub Desktop.
for (String x = "Blah"; x != null; x = null) {
System.out.println("OMG");
}
0: ldc #19 // String Blah
2: astore_1
3: goto 16
6: getstatic #21 // Field java/lang/System.out:Ljava/io/PrintStream;
9: ldc #27 // String OMG
11: invokevirtual #29 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
14: aconst_null
15: astore_1
16: aload_1
17: ifnonnull 6
20: return
String x = "Blah";
if (x != null) {
System.out.println("OMG");
}
0: ldc #19 // String Blah
2: astore_1
3: aload_1
4: ifnull 15
7: getstatic #21 // Field java/lang/System.out:Ljava/io/PrintStream;
10: ldc #27 // String OMG
12: invokevirtual #29 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
15: return
for (String x = "Blah"; x != null;) {
System.out.println("OMG");
break;
}
0: ldc #19 // String Blah
2: astore_1
3: aload_1
4: ifnull 15
7: getstatic #21 // Field java/lang/System.out:Ljava/io/PrintStream;
10: ldc #27 // String OMG
12: invokevirtual #29 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
15: return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment