Sat, 14 Sep 2013 19:04:47 +0100
7047734: javac, the LVT is not generated correctly in several scenarios
Reviewed-by: jjg, mcimadamore
1 /* /nodynamiccopyright/ */
3 public class TestCaseIf {
5 @AliveRange(varName="o", bytecodeStart=9, bytecodeLength=5)
6 @AliveRange(varName="o", bytecodeStart=17, bytecodeLength=1)
7 void m0(String[] args) {
8 Object o;
9 if (args[0] != null) {
10 o = "";
11 o.hashCode();
12 }
13 o = "";
14 }
16 @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=5)
17 @AliveRange(varName="o", bytecodeStart=18, bytecodeLength=1)
18 void m1() {
19 Object o;
20 int i = 5;
21 if (i == 5) {
22 o = "";
23 o.hashCode();
24 }
25 o = "";
26 }
28 @AliveRange(varName="o", bytecodeStart=10, bytecodeLength=5)
29 @AliveRange(varName="o", bytecodeStart=18, bytecodeLength=1)
30 void m2() {
31 Object o;
32 int i = 5;
33 if (!(i == 5)) {
34 o = "";
35 o.hashCode();
36 }
37 o = "";
38 }
40 @AliveRange(varName="o", bytecodeStart=15, bytecodeLength=5)
41 @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=1)
42 void m3(String[] args) {
43 Object o;
44 if (args[0] != null && args[1] != null) {
45 o = "";
46 o.hashCode();
47 }
48 o = "";
49 }
51 @AliveRange(varName="o", bytecodeStart=15, bytecodeLength=5)
52 @AliveRange(varName="o", bytecodeStart=23, bytecodeLength=1)
53 void m4(String[] args) {
54 Object o;
55 if (args[0] != null || args[1] != null) {
56 o = "";
57 o.hashCode();
58 }
59 o = "";
60 }
61 }