@@ -54,14 +54,14 @@ public void test_simple_live() {
5454 }
5555
5656 @ Test
57- public void test_simple_death () throws Exception {
57+ public void test_simple_death () {
5858 CFG cfg = buildCFG ("void foo(int a) { int i; /* should not be live here */ if (false) ; i = 0; }" );
5959 LiveVariables liveVariables = LiveVariables .analyze (cfg );
6060 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (3 ))).isEmpty ();
6161 }
6262
6363 @ Test
64- public void test_field_not_tracked () throws Exception {
64+ public void test_field_not_tracked () {
6565 CFG cfg = buildCFG ("void foo(int a) { field = 0; /* fields should not be tracked */ if (false) ; foo(field); }" );
6666 LiveVariables liveVariables = LiveVariables .analyze (cfg );
6767 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (3 ))).isEmpty ();
@@ -72,15 +72,15 @@ public void test_field_not_tracked() throws Exception {
7272 }
7373
7474 @ Test
75- public void test_while_loop () throws Exception {
75+ public void test_while_loop () {
7676 CFG cfg = buildCFG ("void foo(boolean condition) { while (condition) { int x = 0; use(x); x = 1; /* x should not be live here*/}}" );
7777 LiveVariables liveVariables = LiveVariables .analyze (cfg );
7878 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (3 ))).hasSize (1 );
7979 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (4 ))).hasSize (1 );
8080 }
8181
8282 @ Test
83- public void in_of_first_block_should_be_empty () throws Exception {
83+ public void in_of_first_block_should_be_empty () {
8484 CFG cfg = buildCFG ("boolean foo(int a) { foo(a);}" );
8585 LiveVariables liveVariables = LiveVariables .analyze (cfg );
8686 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (0 ))).isEmpty ();
@@ -103,23 +103,21 @@ public void lambdas_read_liveness() {
103103 }
104104
105105 @ Test
106- public void anonymous_class_liveness () throws Exception {
106+ public void anonymous_class_liveness () {
107107 CFG cfg = buildCFG ("boolean foo(int a) { if(true) { System.out.println(''); } new Object() { String toString(){return a;} }; }" );
108108 LiveVariables liveVariables = LiveVariables .analyze (cfg );
109109 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (0 ))).isEmpty ();
110110 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (2 ))).hasSize (1 );
111111 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (3 ))).hasSize (1 );
112112
113- cfg = buildCFG ("boolean foo(int a) { if(true) { System.out.println(''); } new Object() { String toString(){return a = 2;} }; }" );
113+ cfg = buildCFG ("boolean foo(int a) { if(true) { new A().field = 2; System.out.println(''); } new Object() { String toString(){return a = 2;} }; }" );
114114 liveVariables = LiveVariables .analyze (cfg );
115+ cfg .debugTo (System .out );
115116 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (0 ))).isEmpty ();
116117 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (2 ))).isEmpty ();
117118 assertThat (liveVariables .getOut (cfg .reversedBlocks ().get (3 ))).isEmpty ();
118119 }
120+
121+
119122
120- @ Test
121- public void assignement_with_parenthesis () throws Exception {
122-
123-
124- }
125123}
0 commit comments