[Demonstration 1]

[Buggy Method]
public void getImageListByDir() {
    File sdPath = Environment.getExternalStorageDirectory();
    //查找文件夹
    File[] files = sdPath.listFiles(new FilenameFilter() {

        @Override
        public boolean accept(File dir, String name) {
            if (!name.contains(".zip") && (name.contains("体育") || name.contains("生活") || name.contains("汽车") || name.contains("明星") || name.contains("时尚") || name.contains("旅行"))) {
                return true;
            }
            return false;
        }
    });
    //查找文件夹里面的图片
    for (File file : files) {
        File[] files_inDir = file.listFiles(new FilenameFilter() {

            @Override
            public boolean accept(File dir, String name) {
                if (name.contains("type") || name.contains(".xml")) {
                    return false;
                }
                return true;
            }
        });
        for (File imageFile : files_inDir) {
            imagePathList.add(imageFile.getAbsolutePath());
        }
        File[] xmlFiles = file.listFiles(new FilenameFilter() {

            @Override
            public boolean accept(File dir, String name) {
                if (name.contains("xml")) {
                    return true;
                }
                return false;
            }
        });
        getTittleAndContentMap(xmlFiles[0]);
    }
}

[Buggy Hunk]
if (!name.contains(".zip") && (name.contains("体育") || name.contains("生活") || name.contains("汽车") || name.contains("明星") || name.contains("时尚") || name.contains("旅行"))) {

[Patch]
if ((new File(dir+"/"+name)).isDirectory() && !name.contains(".zip") && (name.contains("体育") || name.contains("生活") || name.contains("汽车") || name.contains("明星") || name.contains("时尚") || name.contains("旅行"))) {

[Demonstration 2]

[Buggy Method]
@Override
public List<ImageDto> listImages(ImageMappingUsecase.Request request) {
    ImageMappingUsecase.Response response = new ImageMappingUsecase.Response();
    new ImageMappingUsecase().execute(request, response);
    return response.imageMapping().asList().stream().map(mapping -> {
        try {
            URI uri = mapping.uri();
            String name = mapping.name();
            return new ImageDto(name, uri);
        } catch (URISyntaxException e) {
            // todo:...
        }
        return null;
    }).collect(Collectors.toList());
}

[Buggy Hunk]
String name = mapping.name();

[Patch]
String name = mapping.id();

[Demonstration 3]

[Buggy Method]
private void createMasterNode() throws UnknownHostAndPortException {
    String hostAndPort = props.getProperty("redis.hostAndPort");
    if (hostAndPort == null) {
        this.close();
        throw new UnknownHostAndPortException("set property like this redis.hostAndPort=192.168.1.10:6371");
    }
    int index = Integer.valueOf(ZKUtil.getData(client, clusterPath));
    String nodePath = StringUtil.append(clusterPath, "/", hostAndPort);
    ZKUtil.setData(client, clusterPath, String.valueOf(index + 1).getBytes());
    ZKUtil.create(client, nodePath, CreateMode.EPHEMERAL, String.valueOf(index).getBytes());
}

[Buggy Hunk]
int index = Integer.valueOf(ZKUtil.getData(client, clusterPath));

[Patch]
int index = ZKUtil.children(client, clusterPath).size();