[Demonstration 1]

[Buggy Method]
private static String getDeviceId(Context context) {
    StringBuilder deviceId = new StringBuilder();
    // 渠道标志
    deviceId.append("a");
    try {
        // wifi mac地址
        WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        WifiInfo info = wifi.getConnectionInfo();
        String wifiMac = info.getMacAddress();
        if (!TextUtils.isEmpty(wifiMac)) {
            deviceId.append("wifi");
            deviceId.append(wifiMac);
            LogExt.e("getDeviceId : ", deviceId.toString());
            return deviceId.toString();
        }
        // IMEI（imei）
        TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        String imei = tm.getDeviceId();
        if (!TextUtils.isEmpty(imei)) {
            deviceId.append("imei");
            deviceId.append(imei);
            LogExt.e("getDeviceId : ", deviceId.toString());
            return deviceId.toString();
        }
        // 序列号（sn）
        String sn = tm.getSimSerialNumber();
        if (!TextUtils.isEmpty(sn)) {
            deviceId.append("sn");
            deviceId.append(sn);
            LogExt.e("getDeviceId : ", deviceId.toString());
            return deviceId.toString();
        }
        // 如果上面都没有， 则生成一个id：随机码
        String uuid = getUUID(context);
        if (!TextUtils.isEmpty(uuid)) {
            deviceId.append("id");
            deviceId.append(uuid);
            LogExt.e("getDeviceId : ", deviceId.toString());
            return deviceId.toString();
        }
    } catch (Exception e) {
        e.printStackTrace();
        deviceId.append("id").append(getUUID(context));
    }
    LogExt.e("getDeviceId : ", deviceId.toString());
    return deviceId.toString();
}

[Buggy Hunk]
String uuid = getUUID(context);

[Patch]
String uuid = UUID.randomUUID().toString();

[Demonstration 2]

[Buggy Method]
public void draw(GOut g) {
    GSprite spr = item.spr();
    if (spr != null) {
        Coord sz = spr.sz();
        g.defstate();
        if (olcol.get() != null)
            g.usestate(new ColorMask(olcol.get()));
        drawmain(g, spr);
        g.defstate();
        if (item.num >= 0) {
            g.atext(Integer.toString(item.num), sz, 0, 1);
        } else if (itemnum.get() != null) {
            g.aimage(itemnum.get(), sz, 1, 1);
        }
        if (item.meter > 0) {
            double a = ((double) item.meter) / 100.0;
            g.chcolor(255, 255, 255, 64);
            Coord half = sz.div(2);
            g.prect(half, half.inv(), half, a * Math.PI * 2);
            g.chcolor();
        }
        if (Shovel.getSettings().showQuality && item.ready()) {
            ItemQualityInfo qualityInfo = item.getItemQualityInfo();
            g.aimage(Utils.renderOutlinedFont(Text.std, Integer.toString(qualityInfo.getMaxValue()), qualityInfo.getMaxColor(), Utils.contrast(qualityInfo.getMaxColor()), 1), sz, 1, 1);
            g.chcolor();
        }
    } else {
        g.image(missing.layer(Resource.imgc).tex(), Coord.z, sz);
    }
}

[Buggy Hunk]
g.aimage(Utils.renderOutlinedFont(Text.std, Integer.toString(qualityInfo.getMaxValue()), qualityInfo.getMaxColor(), Utils.contrast(qualityInfo.getMaxColor()), 1), sz, 1, 1);

[Patch]
g.aimage(Utils.renderOutlinedFont(Text.std, Integer.toString(qualityInfo.getMaxValue()), qualityInfo.getMaxColor(), Color.BLACK, 1), sz, 1, 1);

[Demonstration 3]

[Buggy Method]
public void processedTargetFile(File source) throws Exception {
    String newDestinationPath = source.getAbsolutePath();
    String replacDir = GlobalConfig.projectGroup.replaceAll("\\.", Matcher.quoteReplacement(Matcher.quoteReplacement(File.separator)));
    newDestinationPath = newDestinationPath.replaceAll("com" + Matcher.quoteReplacement(File.separator) + "ly" + Matcher.quoteReplacement(File.separator) + "gproject" + Matcher.quoteReplacement(File.separator) + "example", replacDir + Matcher.quoteReplacement(File.separator) + GlobalConfig.projectName);
    newDestinationPath = newDestinationPath.replaceAll(sourceDir.getAbsolutePath(), targetDir.getAbsolutePath());
    newDestinationPath = newDestinationPath.replaceAll(Matcher.quoteReplacement(File.separator) + "example", Matcher.quoteReplacement(File.separator) + GlobalConfig.projectName);
    newDestinationPath = additionProcessDestinationPath(sourceDir, targetDir, source, newDestinationPath);
    if (!source.getAbsolutePath().endsWith(".vmtemp")) {
        FileUtils.copyFile(source, new File(newDestinationPath));
    } else {
        // 删除vm后最为默认文件名
        String newName = StringUtils.removeEndIgnoreCase(newDestinationPath, ".vmtemp");
        processBeGeneratedFileName(source, newName);
    }
    //        FileUtils.forceDeleteOnExit(new File(destination.getAbsolutePath()));
}

[Buggy Hunk]
newDestinationPath = newDestinationPath.replaceAll(sourceDir.getAbsolutePath(), targetDir.getAbsolutePath());

[Patch]
newDestinationPath = newDestinationPath.replaceAll( Matcher.quoteReplacement(sourceDir.getAbsolutePath()), Matcher.quoteReplacement(targetDir.getAbsolutePath()));