[Demonstration 1]

[Buggy Method]
public static void main(String[] args) {
    try {
        String path = args[0];
        Parser parser = new Parser(path);
        parser.analyzerFile(path);
        parser.parser();
        System.out.println(LEGAL_FILE);
    } catch (ArrayIndexOutOfBoundsException e) {
        System.err.println(e.getMessage());
    } catch (IOException e) {
        System.out.println(FILE_ERROR);
    } catch (IllegalException e) {
        System.err.println(e.getMessage());
        System.out.println(ILLEGAL_FILE);
    }
}

[Buggy Hunk]
Parser parser = new Parser(path);

[Patch]
Parser parser = new Parser();

[Demonstration 2]

[Buggy Method]
@Bean
public RepositoryInvokerFactory repositoryInvokerFactory() {
    RepositoryInvokerFactory repositoryInvokerFactory = super.repositoryInvokerFactory();
    return new DynamicRepositoryInvokerFactory(repositories(), repositoryInvokerFactory);
}

[Buggy Hunk]
RepositoryInvokerFactory repositoryInvokerFactory = super.repositoryInvokerFactory();

[Patch]
RepositoryInvokerFactory repositoryInvokerFactory = super.repositoryInvokerFactory(defaultConversionService());

[Demonstration 3]

[Buggy Method]
public int getAltitude() {
    int factor = -1;
    if (Integer.parseInt(binarySentence.substring(15, 16), 2) == 0)
        factor = 100;
    else
        factor = 25;
    int result = factor * Integer.parseInt(binarySentence.substring(8, 15) + binarySentence.substring(16, 20), 2);
    if (result < -1000 || result > 50175)
        System.out.println("Error at getAltitude!");
    return result;
}

[Buggy Hunk]
System.out.println("Error at getAltitude!");

[Patch]
throw new AdsMessageException(3, "Plausibility Check failed at altitude calculation: Accepted range -1000 < x < 50175. x is: " + result);