[Demonstration 1]

[Buggy Method]
public static void main(String[] args) {
    // Variables
    vars = new TreeMap<String, Variable>();
    String varFile = args[0];
    try {
        BufferedReader br = new BufferedReader(new FileReader(varFile));
        String line;
        while ((line = br.readLine()) != null) {
            // Get variable data, initialize, and put into map
            String[] split = line.split(":");
            String name = split[0];
            // split at whitespaces
            String[] stringValues = line.split("\\s+");
            ArrayList<Integer> values = new ArrayList<Integer>();
            for (String v : stringValues) {
                values.add(Integer.parseInt(v));
            }
            vars.put(name, new Variable(name, values));
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    // Constraints
    cons = new ArrayList<Constraint>();
    String conFile = args[1];
    try {
        BufferedReader br = new BufferedReader(new FileReader(conFile));
        String line;
        while ((line = br.readLine()) != null) {
            // Get constraint data, initialize, and put into list
            // split at whitespaces
            String[] split = line.split("\\s+");
            String lhsName = split[0];
            String rhsName = split[2];
            char op = split[1].toCharArray()[0];
            Variable lhs = vars.get(lhsName);
            Variable rhs = vars.get(rhsName);
            if (lhs == null || rhs == null) {
                throw new IllegalArgumentException("Constraint variable not in variable file");
            }
            cons.add(new Constraint(lhs, rhs, op));
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    // Forward Checking or Not
    boolean forwardChecking = (args[2] == "fc");
}

[Buggy Hunk]
String[] stringValues = line.split("\\s+"); // split at whitespaces

[Patch]
String[] stringValues = split[1].trim().split("\\s+"); // split at whitespaces

[Demonstration 2]

[Buggy Method]
public String getDebugComponentTrees(final String filter) {
    final StringBuilder s = new StringBuilder();
    for (final WicketTesterHelper.ComponentData obj : WicketTesterHelper.getComponentData(getLastRenderedPage())) {
        if (obj.path.matches(".*" + filter + ".*")) {
            s.append("path\t").append(obj.path).append(" \t").append(obj.type).append(" \t[").append(obj.value).append("]\n");
        }
    }
    return s.toString();
}

[Buggy Hunk]
for (final WicketTesterHelper.ComponentData obj : WicketTesterHelper.getComponentData(getLastRenderedPage())) {

[Patch]
for (final WicketTesterHelper.ComponentData obj : RMTWicketTesterHelper.getComponentData(getLastRenderedPage(), false)) {

[Demonstration 3]

[Buggy Method]
public static void main(String[] args) {
    MY_ADDR = args[0];
    MY_PORT = Integer.parseInt(args[1]);
    //		TODO pull in ip address dynamically
    //		int temp = Integer.parseInt(args[0]);
    //		serverAddr = (InetAddress)temp;
    JFrame frame = new JFrame();
    frame.setTitle("Client Port #" + MY_PORT);
    frame.setSize(500, 150);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setResizable(false);
    frame.addWindowListener(new ClientWindowListener());
    frame.add(new Client());
    frame.setVisible(true);
    //		new Client().setVisible(true);
    //		TODO check if this is client 0 and start sprite moving
    if (otherClients.size() == 0) {
        System.out.println("about to initialize new point");
        theSprite.setPoint(new Point(0, 50));
    }
}

[Buggy Hunk]
MY_ADDR = args[0];

[Patch]
SERVER_ADDR = args[0];