[Demonstration 1]

[Buggy Method]
public static void main(String[] args) throws Exception {
    try {
        //Initialize Bank
        Bank object = new Bank();
        //add accounts
        object.accounts.add(new Account("user1", "abc", "user1"));
        object.accounts.add(new Account("user2", "123", "user2"));
        object.accounts.add(new Account("user3", "1a2b", "user3"));
        object.accounts.add(new Account("user4", "xyz", "user4"));
        object.accounts.add(new Account("user5", "password", "user5"));
        //BankInterface stub = (BankInterface) UnicastRemoteObject.exportObject(object, 0);
        // Using 7777 as the default port if none is specified
        int hostport = (args.length < 1) ? 7777 : args[0];
        // Starting the RMI registry to use in our application
        // Don't need to start RMI registry before running the server with this command
        LocateRegistry.createRegistry(hostport);
        // Getting a registry to use in this application
        Registry registry = LocateRegistry.getRegistry(hostport);
        // Binding our application to this registry.
        registry.bind("Bank", object);
        System.out.println("Server ready");
    } catch (Exception e) {
        System.err.println("Server exception: " + e.toString());
        e.printStackTrace();
    }
}

[Buggy Hunk]
int hostport = (args.length < 1) ? 7777 : args[0]; // Using 7777 as the default port if none is specified

[Patch]
int hostport = (args.length < 1) ? 7777 : Integer.parseInt(args[0]); // Using 7777 as the default port if none is specified

[Demonstration 2]

[Buggy Method]
static private int jjMoveStringLiteralDfa1_0(long active0) {
    try {
        curChar = input_stream.readChar();
    } catch (java.io.IOException e) {
        jjStopStringLiteralDfa_0(0, active0);
        return 1;
    }
    switch(curChar) {
        case 50:
            if ((active0 & 0x10000L) != 0L)
                return jjStopAtPos(1, 16);
            break;
        case 72:
            return jjMoveStringLiteralDfa2_0(active0, 0xa00L);
        case 78:
            return jjMoveStringLiteralDfa2_0(active0, 0x2000L);
        case 79:
            if ((active0 & 0x1000L) != 0L)
                return jjStartNfaWithStates_0(1, 12, 34);
            return jjMoveStringLiteralDfa2_0(active0, 0x400L);
        case 82:
            return jjMoveStringLiteralDfa2_0(active0, 0x100L);
        default:
            break;
    }
    return jjStartNfa_0(0, active0);
}

[Buggy Hunk]
static private int jjMoveStringLiteralDfa1_0(long active0)

[Patch]
private int jjMoveStringLiteralDfa1_0(long active0)

[Demonstration 3]

[Buggy Method]
@Override
public int optIntOf(String path, int def) {
    final Value value = valueOf(path);
    return value.hasValue ? asInt(value) : def;
}

[Buggy Hunk]
return value.hasValue ? asInt(value) : def;

[Patch]
return isNumeric(value) ? asInt(value) : def;