package org.automon.helloworld;

/**
 * Created by stevesouza on 2/13/15.
 */
public class HelloWorld {

    public String getFirstName() {
        return "Steve";
    }

    public String getLastName() {
        return "Souza";
    }

    public void iMessedUp() {
        throw new RuntimeException("I really did it this time!");
    }

    public static void main(String[] args) throws Exception {
        HelloWorld hw = new HelloWorld();
        int loops = (args==null || args.length==0) ? 1 : Integer.valueOf(args[0]);
        for (int i=0;i<loops;i++) {
            System.out.println("     ** loop "+i+" of "+loops);
            System.out.println("      ** "+hw.getFirstName());
            System.out.println("      ** "+hw.getLastName());
            try {
                hw.iMessedUp();
            } catch (RuntimeException excepion) {
                // hidden exception
            }
            Thread.sleep(1000);
        }
    }
}

@@ -37,41 +37,65 @@
 %0A * 
-Created by stevesouza on 2/13/15.
+Program used as basis for simple Automon example programs
 %0A */
@@ -371,23 +371,15 @@
 lic 
-static 
 void 
-mai
+ru
 n(St
@@ -414,50 +414,8 @@
 n %7B%0A
-        HelloWorld hw = new HelloWorld();%0A
     
@@ -636,19 +636,16 @@
    ** %22+
-hw.
 getFirst
@@ -696,19 +696,16 @@
    ** %22+
-hw.
 getLastN
@@ -750,11 +750,8 @@
     
-hw.
 iMes
@@ -896,21 +896,171 @@
 );%0A        %7D
+%0A%0A    %7D%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        HelloWorld helloWorld = new HelloWorld();%0A        helloWorld.run(args);
 %0A    %7D%0A%7D%0A

refactor - made HelloWorld class more reusable