[Demonstration 1]

[Buggy Method]
private void scomponiMessaggio(String messaggio) throws NumberFormatException, GiocatoreNonTrovato, InterruptedException {
    try {
        String[] dati = messaggio.split(" ");
        if (dati[0].equals("registrazione")) {
            convalida(dati);
        } else if (dati[0].equals("login")) {
            gestisciLogin(dati);
        } else if (dati[0].equals("convalida")) {
            gestisciConvalida(dati);
        } else if (dati[0].equals("recupero")) {
            gestisciRecupero(dati);
        } else {
            sleep(75);
            run();
        }
    } catch (SqlOccupato ex) {
        sleep(75);
        scomponiMessaggio(messaggio);
    }
}

[Buggy Hunk]
sleep(75);

[Patch]
sleep(random(50, 100));

[Demonstration 2]

[Buggy Method]
public static NicDto createNICTransferObject(final IpPoolManagement ip, final IRESTBuilder restBuilder) throws Exception {
    NicDto dto = ModelTransformer.transportFromPersistence(NicDto.class, ip);
    dto.setSequence(Integer.valueOf(ip.getRasd().getConfigurationName()));
    dto.setLinks(restBuilder.buildNICLinks(ip));
    return dto;
}

[Buggy Hunk]
dto.setSequence(Integer.valueOf(ip.getRasd().getConfigurationName()));

[Patch]
dto.setSequence(Long.valueOf(ip.getAttachmentOrder()).intValue());

[Demonstration 3]

[Buggy Method]
public int SizeReturner(int r, int c, boolean b) {
    if (!b) {
        if (r > c) {
            switch(r) {
                case 1:
                    return 18;
                case 2:
                    return 17;
                case 3:
                    return 15;
                case 4:
                    return 13;
                case 5:
                    return 12;
                case 6:
                    return 11;
                case 7:
                    return 10;
                case 8:
                    return 10;
                case 9:
                    return 9;
            }
        } else {
            switch(c) {
                case 1:
                    return 18;
                case 2:
                    return 17;
                case 3:
                    return 15;
                case 4:
                    return 13;
                case 5:
                    return 12;
                case 6:
                    return 11;
                case 7:
                    return 10;
                case 8:
                    return 10;
                case 9:
                    return 9;
            }
        }
    } else {
        if (r > c) {
            switch(r) {
                case 1:
                    return 15;
                case 2:
                    return 14;
                case 3:
                    return 12;
                case 4:
                    return 10;
                case 5:
                    return 9;
                case 6:
                    return 8;
                case 7:
                    return 7;
                case 8:
                    return 7;
                case 9:
                    return 6;
            }
        } else {
            switch(c) {
                case 1:
                    return 15;
                case 2:
                    return 14;
                case 3:
                    return 12;
                case 4:
                    return 10;
                case 5:
                    return 9;
                case 6:
                    return 8;
                case 7:
                    return 7;
                case 8:
                    return 7;
                case 9:
                    return 6;
            }
        }
    }
    return 0;
}

[Buggy Hunk]
public int SizeReturner(int r, int c,boolean b)

[Patch]
private int SizeReturner(int r, int c,boolean b)