[Demonstration 1]

[Buggy Method]
private void compressDirectoryToZipfile(String rootDir, String sourceDir, ZipOutputStream out) throws Exception {
    getLog().info("Compressing test dir [" + sourceDir + "]");
    File sourceDirFile = new File(sourceDir);
    if (sourceDirFile.listFiles() == null) {
        getLog().warn("No files in directory [" + sourceDir + "]");
        return;
    }
    for (File file : sourceDirFile.listFiles()) {
        if (file.isDirectory()) {
            compressDirectoryToZipfile(rootDir, sourceDir + File.separator + file.getName(), out);
        } else {
            ZipEntry entry = new ZipEntry(sourceDir.replace(rootDir, "") + file.getName());
            out.putNextEntry(entry);
            FileInputStream in = new FileInputStream(sourceDir + File.separator + file.getName());
            IOUtils.copy(in, out);
            IOUtils.closeQuietly(in);
        }
    }
}

[Buggy Hunk]
ZipEntry entry = new ZipEntry(sourceDir.replace(rootDir, "") + file.getName());

[Patch]
ZipEntry entry = new ZipEntry(sourceDir.replace(rootDir + File.separator, "").replaceAll("\\\\",  "/") + "/" + file.getName());

[Demonstration 2]

[Buggy Method]
public static BioLockJProperties readProps(final String filePath, final BioLockJProperties defaultProps) throws Exception {
    final File inFile = new File(filePath);
    if (inFile.exists()) {
        final InputStream in = new FileInputStream(filePath);
        final BioLockJProperties tempProps = (defaultProps == null) ? new BioLockJProperties() : new BioLockJProperties(defaultProps);
        tempProps.load(in);
        in.close();
        return tempProps;
    }
    return null;
}

[Buggy Hunk]
final InputStream in = new FileInputStream( filePath );

[Patch]
final FileInputStream in = new FileInputStream( filePath );

[Demonstration 3]

[Buggy Method]
public void updateChildenOrientations() {
    Iterator<Limb> itr = attachedChildren.iterator();
    while (itr.hasNext()) {
        itr.next().updateWorldOrientation();
    }
}

[Buggy Hunk]
itr.next().updateWorldOrientation();

[Patch]
itr.next().parentRotated();