[Demonstration 1]

[Buggy Method]
private void exeCmd(String commandStr) {
    BufferedReader br = null;
    try {
        Process p = Runtime.getRuntime().exec(commandStr);
        br = new BufferedReader(new InputStreamReader(p.getInputStream()));
        String line = null;
        StringBuilder sb = new StringBuilder();
        while ((line = br.readLine()) != null) {
            sb.append(line + "\n");
        }
        output = sb.toString();
        System.out.println(sb.toString());
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (br != null) {
            try {
                br.close();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}

[Buggy Hunk]
br = new BufferedReader(new InputStreamReader(p.getInputStream()));

[Patch]
br = new BufferedReader(new InputStreamReader(p.getInputStream(),"UTF-8"));

[Demonstration 2]

[Buggy Method]
@SuppressWarnings("unchecked")
public Model getModel(int method, String uri) {
    try {
        // log.debug("looking for model for <" + method + "|" + uri + ">");
        CachedModel c = null;
        synchronized (modelMap) {
            c = modelMap.get(method + "|" + uri);
            // log.debug("uri=" + (method + "|" + uri));
            if (c == null) {
                /**
                 * looking for the model class
                 */
                String name = (pack + "." + uri).replace("/", ".").replace("..", ".");
                Class<Model> c1 = (Class<Model>) Class.forName(name, false, classLoader);
                /**
                 * cache it and cache all the path
                 */
                Map<Integer, Map<String, Model.PathMapping>> path = _loadPath(c1);
                if (path != null && path.size() > 0) {
                    String u = uri;
                    // if (!u.endsWith("/")) {
                    // u += "/";
                    // }
                    for (int m1 : path.keySet()) {
                        Map<String, Model.PathMapping> p = path.get(m1);
                        for (String s : p.keySet()) {
                            c = CachedModel.create(c1, path, this);
                            _cache(m1 + "|" + u + "/" + s, c);
                            // log.debug("uri=" + (m1 + "|" + u + "/" + s));
                        }
                        // c = CachedModel.create(c1, path, this);
                        // _cache(m1 + "|" + u, c);
                        // log.debug("uri=" + (m1 + "|" + u));
                    }
                } else {
                    c = CachedModel.create(c1, path, this);
                    _cache(method + "|" + uri, c);
                    // log.debug("uri=" + (method + "|" + uri));
                }
            }
        }
        if (c != null) {
            Model m = c.create(uri);
            return m;
        }
        // System.out.println("loading [" + name + "], c=" + c);
    } catch (Throwable e) {
        /**
         * not found, or is not a model, ignore the exception
         */
    }
    Module e = floor();
    if (e != null) {
        return e.getModel(method, uri);
    }
    return null;
}

[Buggy Hunk]
if (e != null) {

[Patch]
if (e != null && e.getId() != this.id) {

[Demonstration 3]

[Buggy Method]
private static double arcAngle(Point center, Point a, Point b, Rect area, int radius) {
    double angle = threePointsAngle(center, a, b);
    Point innerPoint = findMidNormalPoint(center, a, b, area, radius);
    Point midInsectPoint = new Point((a.x + b.x) / 2, (a.y + b.y) / 2);
    double distance = pointsDistance(midInsectPoint, innerPoint);
    if (distance > radius) {
        return 360 - angle;
    }
    return angle;
}

[Buggy Hunk]
Point innerPoint = findMidNormalPoint(center, a, b, area, radius);

[Patch]
Point innerPoint = findMidnormalPoint(center, a, b, area, radius);