[Demonstration 1]

[Buggy Method]
public static void unzip(String zipFilePath, String targetPath, boolean overwrite) throws IOException {
    ZipFile zipFile = new ZipFile(zipFilePath);
    Enumeration<ZipEntry> entryEnum = zipFile.getEntries();
    if (null != entryEnum) {
        while (entryEnum.hasMoreElements()) {
            ZipEntry zipEntry = (ZipEntry) entryEnum.nextElement();
            if (zipEntry.isDirectory()) {
                File dir = new File(targetPath + File.separator + zipEntry.getName());
                dir.mkdirs();
            } else {
                File targetFile = new File(targetPath + File.separator + zipEntry.getName());
                if (!targetFile.exists() || overwrite) {
                    targetFile.getParentFile().mkdirs();
                    write(zipFile.getInputStream(zipEntry), new FileOutputStream(targetFile));
                }
            }
        }
    }
    zipFile.close();
}

[Buggy Hunk]
ZipFile zipFile = new ZipFile(zipFilePath);

[Patch]
ZipFile zipFile = new ZipFile(zipFilePath, DEFAULT_CHARSET_NAME);

[Demonstration 2]

[Buggy Method]
@Test
public void testExtract() throws IOException {
    Set<String> classPaths = ClassPathUtil.getClassPaths();
    for (String classPath : classPaths) {
        File jarFile = new File(classPath);
        if (jarFile.exists()) {
            JarUtil.extract(jarFile, targetDirectory);
            break;
        }
    }
}

[Buggy Hunk]
Set<String> classPaths = ClassPathUtil.getClassPaths();

[Patch]
Set<String> classPaths = ClassPathUtil.getBootstrapClassPaths();

[Demonstration 3]

[Buggy Method]
private void buildCriteria(String type, String grade, String variety, String size, String packageName, String transMode, String district, Criteria cirteria) {
    if (type != null && !type.equalsIgnoreCase(ALL)) {
        cirteria.and(("type")).is(type);
    }
    if (packageName != null && !packageName.equals(ALL)) {
        cirteria.and(("package")).is(packageName);
    }
    if (size != null && !size.equals(ALL)) {
        cirteria.and(("size")).is(size);
    }
    if (grade != null && !grade.equals(ALL)) {
        cirteria.and(("grade")).is(grade);
    }
    if (variety != null && !variety.equals(ALL)) {
        cirteria.and(("variety")).is(variety);
    }
    if (transMode != null && !transMode.equalsIgnoreCase(ALL)) {
        cirteria.and("transMode").is(transMode);
    }
    if (district != null && !district.equalsIgnoreCase(ALL)) {
        cirteria.and("district").is(district);
    }
}

[Buggy Hunk]
cirteria.and(("type")).is(type);

[Patch]
cirteria.and(("type")).in(Lists.newArrayList(type.toUpperCase(),type.toLowerCase()));