[Demonstration 1]

[Buggy Method]
@Override
public void draw(final Graphics g) {
    for (final GameEntity object : objects) {
        if (object.shape instanceof RectShape) {
            final int x = (int) ((RectShape) object.shape).min.x;
            final int y = (int) ((RectShape) object.shape).min.y;
            final int width = (int) (((RectShape) object.shape).max.x - ((RectShape) object.shape).min.x);
            final int height = (int) (((RectShape) object.shape).max.y - ((RectShape) object.shape).min.y);
            if (!object.sleeping) {
                g.setColor(new Color(50, 100, 200));
            } else {
                g.setColor(new Color(200, 200, 200));
            }
            g.fillRect(x, y, width, height);
            g.setColor(Color.BLACK);
            g.drawRect(x, y, width, height);
        } else if (object.shape instanceof CircleShape) {
            final int radius = (int) ((CircleShape) object.shape).radius;
            final int x = (int) ((CircleShape) object.shape).center.x - radius;
            final int y = (int) ((CircleShape) object.shape).center.y - radius;
            if (!object.sleeping) {
                g.setColor(new Color(200, 100, 50));
            } else {
                g.setColor(new Color(200, 200, 200));
            }
            g.fillOval(x, y, radius * 2, radius * 2);
            g.setColor(Color.BLACK);
            g.drawOval(x, y, radius * 2, radius * 2);
        }
    }
    for (final Joint j : joints) {
        g.setColor(Color.RED);
        final float x1 = j.a.center().x;
        final float y1 = j.a.center().y;
        final float x2 = j.b.center().x;
        final float y2 = j.b.center().y;
        g.drawLine((int) x1, (int) y1, (int) x2, (int) y2);
        final int distance = (int) Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
        g.drawString(distance + "\\" + j.distance, (int) x1, (int) y1 - 30);
    }
    g.setColor(Color.RED);
    g.drawString("Entities: " + objects.size(), 10, 15);
    g.drawString("FPS: " + getCurrentFPS(), 10, 30);
    g.drawString("UPS: " + getCurrentUPS(), 10, 45);
}

[Buggy Hunk]
g.drawString(distance + "\\" + j.distance, (int) x1, (int) y1 - 30);

[Patch]
g.drawString("" + distance / j.distance, (int) x1, (int) y1 - 30);

[Demonstration 2]

[Buggy Method]
private void grabStatsOnly() {
    String endMsg = "";
    String endTitle = "";
    try {
        boolean gotStats, hasCorruption, goodCard;
        setStartTime();
        success = false;
        goodCard = executeFile(new File(SCRIPT_SUBDIR + "checkConnection.txt"));
        if (!goodCard) {
            return;
        }
        TBLoader.status2.setText("Checking Memory Card");
        Logger.LogString("STATUS:Checking Memory Card");
        hasCorruption = !executeFile(new File(SCRIPT_SUBDIR + "chkdsk.txt"));
        if (hasCorruption) {
            TBLoader.currentDrive.corrupted = true;
            TBLoader.status2.setText(TBLoader.status2.getText() + "...Corrupted\nGetting Stats");
            Logger.LogString("STATUS:Corrupted...Getting Stats");
            executeFile(new File(SCRIPT_SUBDIR + "chkdsk-save.txt"));
        } else {
            TBLoader.status2.setText(TBLoader.status2.getText() + "...Good\nGetting Stats");
            Logger.LogString("STATUS:Good Card\nGetting Stats");
        }
        gotStats = executeFile(new File(SCRIPT_SUBDIR + "grab.txt"));
        callback.logTBData("stats-only");
        if (gotStats) {
            TBLoader.status2.setText(TBLoader.status2.getText() + "...Got Stats\nErasing Flash Stats");
            Logger.LogString("STATUS:Got Stats!\nErasing Flash Stats");
            executeFile(new File(SCRIPT_SUBDIR + "eraseFlashStats.txt"));
            TBLoader.status2.setText(TBLoader.status2.getText() + "...Erased Flash Stats\nDisconnecting");
            Logger.LogString("STATUS:Erased Flash Stats");
            Logger.LogString("STATUS:Disconnecting TB");
            executeFile(new File(SCRIPT_SUBDIR + "disconnect.txt"));
            TBLoader.status2.setText(TBLoader.status2.getText() + "...Complete");
            Logger.LogString("STATUS:Complete");
            success = true;
            endMsg = new String("Got Stats!");
            endTitle = new String("Success");
        } else {
            TBLoader.status2.setText(TBLoader.status2.getText() + "...No Stats!\n");
            Logger.LogString("STATUS:No Stats!");
            endMsg = new String("Could not get stats for some reason.");
            endTitle = new String("Failure");
        }
        // zip up stats
        String sourceFullPath = TEMP_COLLECTION_DIR + TBLoader.syncSubPath;
        String targetFullPath = copyTo + TBLoader.syncSubPath + ".zip";
        File sourceFile = new File(sourceFullPath);
        sourceFile.getParentFile().mkdirs();
        ZipUnzip.zip(sourceFile, new File(targetFullPath), true);
        FileUtils.deleteDirectory(sourceFile);
    } catch (IOException e) {
        Logger.LogString("Unable to zip device files:" + e.getMessage());
        Logger.flush();
        e.printStackTrace();
    } finally {
        callback.finishCopy(success, id, this.mode, endMsg, endTitle);
    }
}

[Buggy Hunk]
callback.finishCopy(success, id, this.mode, endMsg, endTitle);

[Patch]
callback.onCopyFinished(success, tbSrn, this.operation, endMsg, endTitle);

[Demonstration 3]

[Buggy Method]
@Override
public void draw(Graphics2D g) {
    g.setColor(Color.YELLOW);
    g.setFont(scoreFont);
    String txtScore = "Score: " + SCORE;
    g.drawString(txtScore, (Display.WIDTH / 2) - (g.getFontMetrics().stringWidth(txtScore) / 2), g.getFontMetrics().getHeight());
    for (int i = 0; i < health; i++) {
        g.drawImage(healthSprite, i * (healthSprite.getWidth()), Display.HEIGHT - (healthSprite.getHeight() - 5), healthSprite.getWidth() - 10, healthSprite.getHeight() - 10, null);
    }
    playerAnimation.draw(g);
}

[Buggy Hunk]
playerAnimation.draw(g);

[Patch]
playerAnimation.draw(g, getRectangle().x, getRectangle().y, getRectangle().width, getRectangle().height);