[Demonstration 1]

[Buggy Method]
private void drawGraphic(Path2D path, Style style, String[] labels, Graphics2D g2d) {
    Point centroid = new Point((int) path.getBounds().getCenterX(), (int) path.getBounds().getCenterY());
    if (style instanceof CircleStyle) {
        CircleStyle cstyle = (CircleStyle) style;
        if (style.getFill() != null) {
            g2d.setColor(style.getFill());
            g2d.fillOval(centroid.x - (int) cstyle.getRadius(), centroid.y - (int) cstyle.getRadius(), (int) cstyle.getRadius() * 2, (int) cstyle.getRadius() * 2);
        }
        if (style.getLine() != null) {
            g2d.setColor(style.getLine());
            if (style.getStroke() != null) {
                g2d.setStroke(style.getStroke());
            } else {
                g2d.setStroke(new BasicStroke(1f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
            }
            g2d.drawOval(centroid.x - (int) cstyle.getRadius(), centroid.y - (int) cstyle.getRadius(), (int) cstyle.getRadius() * 2, (int) cstyle.getRadius() * 2);
        }
    } else if (style instanceof TextStyle) {
        if (((TextStyle) style).getFormat() != null && !((TextStyle) style).getFormat().isEmpty()) {
            String[] texts = ((TextStyle) style).getFormat().split("\\\\n");
            for (int i = 0; i < texts.length; i++) {
                String[] attrs = getAllAttributes(style.getStyleRule(), null);
                for (int i2 = 0; i2 < attrs.length; i2++) {
                    String attrname = attrs[i2];
                    if (texts[i].contains("{" + attrname + "}")) {
                        texts[i] = texts[i].replace("{" + attrname + "}", labels[i2]);
                    }
                }
            }
            if (style.getFill() == null) {
                g2d.setColor(Color.BLACK);
            } else {
                g2d.setColor(style.getFill());
            }
            Font font = ((TextStyle) style).getFont();
            if (font != null) {
                g2d.setFont(font);
            }
            FontMetrics metrics = g2d.getFontMetrics(g2d.getFont());
            for (int i = 0; i < texts.length; i++) {
                int y = (centroid.y - metrics.getHeight() / 2 * texts.length) + metrics.getAscent() + i * (metrics.getHeight() / 2);
                g2d.drawString(texts[i], centroid.x - metrics.stringWidth(texts[i]) / 2, y);
            }
        }
    }
    if (style instanceof Style) {
        if (style.getFill() != null) {
            g2d.setColor(style.getFill());
            g2d.fill(path);
        }
        if (style.getLine() != null) {
            g2d.setColor(style.getLine());
            if (style.getStroke() != null) {
                g2d.setStroke(style.getStroke());
            } else {
                g2d.setStroke(new BasicStroke(1f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
            }
            g2d.draw(path);
        }
    }
}

[Buggy Hunk]
String[] attrs = getAllAttributes(style.getStyleRule(),null);

[Patch]
String[] attrs = style.getStyleRule().getAttributes();

[Demonstration 2]

[Buggy Method]
public List<BaseComponent[]> getPage(int page, boolean isPlayer) {
    int startIndex;
    int endIndex;
    if (isPlayer) {
        startIndex = (page - 1) * PLAYER_HEIGHT;
        endIndex = page * PLAYER_HEIGHT;
    } else {
        startIndex = (page - 1) * CONSOLE_HEIGHT;
        endIndex = page * CONSOLE_HEIGHT;
    }
    if (startIndex > lines.size()) {
        endIndex = lines.size() - 1;
        startIndex = endIndex;
    } else if (endIndex >= lines.size()) {
        endIndex = lines.size() - 1;
    }
    return lines.subList(startIndex, endIndex);
}

[Buggy Hunk]
if (startIndex > lines.size()) {

[Patch]
if (startIndex >= lines.size()) {

[Demonstration 3]

[Buggy Method]
private boolean setPerspective(Object param) {
    T host = getHostView();
    boolean ret = false;
    if (host != null) {
        float value = WXUtils.getFloatByViewport(param, getInstance().getInstanceViewPortWidth());
        float scale = host.getResources().getDisplayMetrics().density;
        if (!Float.isNaN(value) && value > 0) {
            host.setCameraDistance(value * scale);
            ret = true;
        } else {
            host.setCameraDistance(Float.MAX_VALUE);
        }
    }
    return ret;
}

[Buggy Hunk]
float value = WXUtils.getFloatByViewport(param, getInstance().getInstanceViewPortWidth());

[Patch]
float value = WXViewUtils.getRealPxByWidth(WXUtils.getFloat(param), getInstance().getInstanceViewPortWidth());