

public class TestNested {

    static void showBox(VBox box) {
        System.out.println("Value for box " + box + " -> " + box.getValue());
    }


    public static void main(String[] args) {
        Transaction.transactionallyDo(new TransactionalCommand() {
                public void doIt() {
                    final VBox<Long> b1 = new VBox<Long>();
                    final VBox<Long> b2 = new VBox<Long>();
                    b1.setValue(1L);
                    b2.setValue(2L);
                    
                    showBox(b1);
                    showBox(b2);
                    
                    try {
                        Transaction.transactionallyDo(new TransactionalCommand() {
                                public void doIt() {
                                    try {
                                        Transaction.transactionallyDo(new TransactionalCommand() {
                                                public void doIt() {
                                                    b1.setValue(b1.getValue() + 3);
                                                    b2.setValue(b2.getValue() + 6);
                                                    throw new Error("Some");
                                                }
                                            });
                                    } catch (Throwable e) { }
                                    
                                    showBox(b1);
                                    showBox(b2);
                                    
                                    Transaction.transactionallyDo(new TransactionalCommand() {
                                            public void doIt() {
                                                b1.setValue(b1.getValue() + 3);
                                                b2.setValue(b2.getValue() + 6);
                                            }
                                        });
                                    
                                    showBox(b1);
                                    showBox(b2);
                                    throw new Error("Ola");
                                }
                            });
                        
                    } catch (Throwable e) { }
                    
                    showBox(b1);
                    showBox(b2);
                }
            });
    }
}

@@ -1,9 +1,24 @@
+import jvstm.*;
 %0A
-
 %0Apublic 
@@ -141,21 +141,16 @@
  box.get
-Value
 ());%0A   
@@ -446,24 +446,19 @@
      b1.
-setValue
+put
 (1L);%0A  
@@ -478,24 +478,19 @@
      b2.
-setValue
+put
 (2L);%0A  
@@ -1022,36 +1022,26 @@
      b1.
-setValue
+put
 (b1.get
-Value
 () + 3);
@@ -1096,36 +1096,26 @@
      b2.
-setValue
+put
 (b2.get
-Value
 () + 6);
@@ -1739,28 +1739,18 @@
  b1.
-setValue
+put
 (b1.get
-Value
 () +
@@ -1809,28 +1809,18 @@
  b2.
-setValue
+put
 (b2.get
-Value
 () +

fix example TestNested so that it compiles