[Demonstration 1]

[Buggy Method]
private void unbindRuleContent(StyleRule styleRule) {
    unbind(styleRule.getMatchingInternalsObservable());
}

[Buggy Hunk]
unbind(styleRule.getMatchingInternalsObservable());

[Patch]
unbind(ruleMatchBindings.remove(styleRule));

[Demonstration 2]

[Buggy Method]
private void restoreStage(final String id, BoundingBox box) {
    LOGGER.info("Restoring stage with ID {} and bounding box {}", id, box);
    if (id == null) {
        LOGGER.warn("Stage identifier is null, cannot restore window");
        return;
    }
    if (id.startsWith("#GroovyObjectId:")) {
        // Handled elsewhere in open()
        return;
    }
    if (id.startsWith(DetachViewStageController.class.getName() + " detached ")) {
        // Remove the prefix before the name of the detached class
        final String toDetach = id.substring((DetachViewStageController.class.getName() + " detached ").length());
        injector.getInstance(DetachViewStageController.class).selectForDetach(toDetach);
        return;
    }
    switch(id) {
        case "de.prob2.ui.ProB2":
            // The main stage's size is restored in the application start method.
            return;
        case "de.prob2.ui.consoles.groovy.objects.GroovyObjectStage":
            injector.getInstance(GroovyInterpreter.class).exec(new ConsoleInstruction("inspect", ConsoleInstructionOption.ENTER));
            return;
        default:
            LOGGER.info("No special handling for stage identifier {}, will use injection", id);
    }
    Class<?> clazz;
    try {
        clazz = Class.forName(id);
    } catch (ClassNotFoundException e) {
        LOGGER.warn("Class not found, cannot restore window", e);
        return;
    }
    Class<? extends Stage> stageClazz;
    try {
        stageClazz = clazz.asSubclass(Stage.class);
    } catch (ClassCastException e) {
        LOGGER.warn("Class is not a subclass of javafx.stage.Stage, cannot restore window", e);
        return;
    }
    try {
        final Stage stage = injector.getInstance(stageClazz);
        stage.show();
    } catch (RuntimeException e) {
        LOGGER.warn("Failed to restore window", e);
    }
}

[Buggy Hunk]
if (id.startsWith(DetachViewStageController.class.getName() + " detached ")) {

[Patch]
if (id.startsWith(DetachViewStageController.class.getName() + " detached ".toUpperCase())) {

[Demonstration 3]

[Buggy Method]
private long[] getPattern(String string) {
    switch(sharedPreferences.getString("notification_vibrate_choice_friends", "vibrate_short")) {
        case "vibrate_short":
            return new long[] { 0, 200 };
        case "vibrate_long":
            return new long[] { 0, 400 };
        case "vibrate_double":
            return new long[] { 0, 200, 200, 200 };
        case "vibrate_double_long":
            return new long[] { 0, 400, 300, 400 };
        default:
            return new long[0];
    }
}

[Buggy Hunk]
switch (sharedPreferences.getString("notification_vibrate_choice_friends", "vibrate_short")) {

[Patch]
switch (sharedPreferences.getString(string, "vibrate_short")) {