[Demonstration 1]

[Buggy Method]
@Override
public void enterAtomic_function_skeleton(PDDLParser.Atomic_function_skeletonContext ctx) {
    Variable[] variables = new Variable[0];
    if (ctx.typed_list_variable() != null) {
        // The predicate formula has parameters
        TypedListVariableListener typedListVariable = new TypedListVariableListener(domain);
        WALKER.walk(typedListVariable, ctx.typed_list_variable());
        variables = typedListVariable.variables.toArray(new Variable[typedListVariable.variables.size()]);
    }
    domain.addFunction(new Function(Utils.capitalize(ctx.function_symbol().name().getText()), function_type, variables));
}

[Buggy Hunk]
WALKER.walk(typedListVariable, ctx.typed_list_variable());

[Patch]
ParseTreeWalker.DEFAULT.walk(typedListVariable, ctx.typed_list_variable());

[Demonstration 2]

[Buggy Method]
@Override
public Void visitCategory_interface(ObjCParser.Category_interfaceContext ctx) {
    String classInterfaceText = tokens.getText(ctx.getSourceInterval());
    int startIndex = outputBuffer.indexOf(classInterfaceText);
    int startEndIndexIndex = outputBuffer.indexOf(Keywords.END);
    if (startIndex < 0)
        return super.visitCategory_interface(ctx);
    isProtocol = false;
    className = ctx.class_name().IDENTIFIER().getText();
    superClassName = null;
    categoryClassName = ctx.category_name().IDENTIFIER().getText();
    int indexOfFirstNewLine = outputBuffer.indexOf("\n", startIndex);
    int indexOfBrace = outputBuffer.indexOf("{", startIndex);
    int finalIndexToConsider = (indexOfBrace >= 0) ? indexOfBrace : indexOfFirstNewLine;
    String suffix = ((indexOfBrace >= 0) ? EMPTY_STRING : "{\n\npublic:\n\n");
    className = translateIdentifier(className);
    categoryClassName = translateIdentifier(categoryClassName);
    outputBuffer.replace(startEndIndexIndex, startEndIndexIndex + Keywords.END.length(), String.format("\nCREATE_FUNC(%s);\n\n%s\n\n};\n\n#endif // __%s_H__", className, translatePrivateMethodsDeclaration(), className.toUpperCase())).replace(startIndex, finalIndexToConsider, translateClassDeclaration(ctx.protocol_reference_list()) + suffix);
    return super.visitCategory_interface(ctx);
}

[Buggy Hunk]
categoryClassName = ctx.category_name().IDENTIFIER().getText();

[Patch]
categoryClassName = ctx.category_name() != null? ctx.category_name().IDENTIFIER().getText() : null;

[Demonstration 3]

[Buggy Method]
private String resolveName() {
    String name = Classes.getNonDynamic(getClass()).getSimpleName();
    if (name.equals(Container.class.getSimpleName())) {
        return name + '#' + ID_COUNTER.getAndIncrement();
    }
    if (name.endsWith("Container")) {
        return CAMEL_TO_DASH.matcher(name).replaceAll("$1-$2").substring(0, "Container".length() + 1).toLowerCase();
    }
    return name;
}

[Buggy Hunk]
.substring(0, "Container".length() + 1)

[Patch]
.substring(0, "Container".length() - 2)