[Demonstration 1]

[Buggy Method]
public static String readAsString(File file) throws IOException {
    InputStream in = null;
    ByteArrayOutputStream baos = new ByteArrayOutputStream((int) file.length());
    try {
        in = new FileInputStream(file);
        if (((int) file.length()) > 0) {
            byte[] buffer = new byte[(int) file.length()];
            for (int n = -1; (n = in.read(buffer)) > -1; ) {
                baos.write(buffer, 0, n);
            }
        }
    } finally {
        forceClosed(in);
    }
    return baos.toString();
}

[Buggy Hunk]
byte[] buffer = new byte[(int) file.length()];

[Patch]
byte[] buffer = new byte[1024];

[Demonstration 2]

[Buggy Method]
public TaskDefinition updateTaskDefinition(UUID taskId, TaskDefinition taskDefinition) {
    TaskDefinition oldTaskDef = taskManager.read(taskId);
    if (oldTaskDef != null) {
        if (!taskManager.update(taskId, taskDefinition)) {
            oldTaskDef = null;
        }
    }
    return oldTaskDef;
}

[Buggy Hunk]
public TaskDefinition updateTaskDefinition(UUID taskId, TaskDefinition taskDefinition) {

[Patch]
public TaskDefinition updateTaskDefinition(UUID taskId, TaskDefinition taskDefinition) throws CrudsException {

[Demonstration 3]

[Buggy Method]
public static JeezAPIInterface getAPI() {
    if (service == null) {
        ServiceGenerator.createService(null);
    }
    return service;
}

[Buggy Hunk]
ServiceGenerator.createService(null);

[Patch]
service = ServiceGenerator.createService(null);