[Demonstration 1]

[Buggy Method]
public void open() {
    Class.forName("com.mysql.jdbc.Driver");
    conn = DriverManager.getConnection("jdbc:mysql://cslvm74.csc.calpoly.edu/cjacob07", "cjacob07", "Ma94ne07k");
}

[Buggy Hunk]
public void open() {

[Patch]
public void open() throws Exception {

[Demonstration 2]

[Buggy Method]
@Override
public void run() {
    //this is what combines the threads. "this refers to it being the child process"
    synchronized (this) {
        System.out.println("im here");
        //notify();
        try {
            Thread.sleep(100);
        } catch (InterruptedException e3) {
            // TODO Auto-generated catch block
            e3.printStackTrace();
        }
        try {
            System.out.println("Locked!");
            //notify();
            wait();
            System.out.println("Freed!");
        } catch (InterruptedException e2) {
            // TODO Auto-generated catch block
            e2.printStackTrace();
        }
        //this is an infinite loop to keep checking for updates
        while (true) {
            try {
                Thread.sleep(200);
            } catch (InterruptedException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
            //check to see if the global was clicked(something was clicked/flagged)
            //System.out.println(selectedTerritory);
            if (selectedTerritory != -1) {
                System.out.println("aGlobal: " + selectedTerritory);
                //notify the parent that something was clicked
                notify();
                System.out.println("waiting inner...");
                //wait for parent to respond with notify
                try {
                    wait();
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            //System.out.println("beep..."+aGlobalClicked);
        }
    }
}

[Buggy Hunk]
if(selectedTerritory!=-1){

[Patch]
if(selectedTerritory!=-1||nextPhase){

[Demonstration 3]

[Buggy Method]
@Override
public void onClick(View v) {
    launchContactActivity(finalContactId, context);
}

[Buggy Hunk]
launchContactActivity(finalContactId, context);

[Patch]
launchContactActivity(contactId, context);