[Demonstration 1]

[Buggy Method]
private void initializeMousePointerImage() {
    URL resource = this.getClass().getResource("images/Cursor.png");
    if (resource == null) {
        System.err.println("Could not find mousePointerImage!");
    }
    mousePointerImage = Toolkit.getDefaultToolkit().createImage(resource);
}

[Buggy Hunk]
URL resource = this.getClass().getResource("images/Cursor.png");

[Patch]
URL resource = ClassLoader.getSystemResource("Cursor.png");

[Demonstration 2]

[Buggy Method]
private static Map<String, String> generateHeaders(String host) {
    Validate.notNull(host);
    Map<String, String> ret = new HashMap<>();
    // content-length is added by parent class
    ret.put("Host", host);
    ret.put("Connection", "Close");
    return ret;
}

[Buggy Hunk]
Map<String, String> ret = new HashMap<>();

[Patch]
Map<String, String> ret = new LinkedHashMap<>();

[Demonstration 3]

[Buggy Method]
public void saveCommit(long commitNumber) throws RepositoryException {
    try {
        Snapshot snapshot = new Snapshot();
        for (String filename : trackedFiles) {
            File file = new File(workingDirectory, filename);
            if (file.exists()) {
                String hash = FileSystem.getNewHash(file);
                snapshot.addFile(filename, hash);
                File dataFile = new File(getDataDirectory(), "data");
                if (!dataFile.exists()) {
                    FileUtils.copyFile(file, dataFile);
                }
            }
        }
        SnapshotSerializer.writeSnapshot(snapshot, getSnapshotFile(commitNumber));
    } catch (IOException e) {
        throw new RepositoryException(e);
    }
}

[Buggy Hunk]
File dataFile = new File(getDataDirectory(), "data");

[Patch]
File dataFile = new File(getDataDirectory(), hash);