[Demonstration 1]

[Buggy Method]
private String[] splitByChar(final char[] s, final char splitChar) {
    final ArrayList<String> splitByCharCache = this.splitByCharCache;
    splitByCharCache.clear();
    // splitByCharCache.clear();
    final int length = s.length;
    int offset = 0;
    int count = 0;
    for (int i = 0; i < length; i++) {
        if (s[i] == splitChar) {
            if (count > 0) {
                splitByCharCache.add(new String(s, offset, count));
            }
            offset = i + 1;
            count = 0;
        } else {
            count++;
        }
    }
    if (count > 0) {
        splitByCharCache.add(new String(s, offset, count));
    }
    return splitByCharCache.toArray(new String[splitByCharCache.size()]);
}

[Buggy Hunk]
private String[] splitByChar(final char[] s, final char splitChar) {

[Patch]
public String[] splitByChar(final char[] s, final char splitChar) {

[Demonstration 2]

[Buggy Method]
@Override
public void visit(ReturnStatement node) {
    super.visit(node);
    // if we have a yield statement here, we have to set the generator jump destination to this label
    if (node instanceof YieldStatement) {
        setGeneratorLabel((ClassDeclaration) node.getParentNodeByType(ClassDeclaration.class), "yield" + ((YieldStatement) node).getYieldStatementIndex());
    }
    if (node.getParameter() != null) {
        ASTNode parent = node.getParentNodeByType(FunctionDeclaration.class);
        LLVMIdentifier<LLVMType> returnValue = stack.pop();
        TypeDeclaration returnType = ((FunctionDeclaration) parent).getReturnType();
        if (returnType instanceof ClassDeclaration) {
            returnType = codeGenerator.mapAbstractGenericToConcreteIfApplicable((ClassDeclaration) returnType);
        }
        codeGenerator.returnValue(contextUtils.active(), returnValue, returnType);
    } else {
        codeGenerator.returnValue(contextUtils.active(), (LLVMIdentifier<LLVMType>) (LLVMIdentifier<?>) llvmIdentifierFactory.voidId(), CoreClasses.voidType());
    }
    // if we have a yield statement here, we have to add a label to jump to
    if (node instanceof YieldStatement) {
        String yieldLabel = codeGenerator.createLabelPrefix("yield", node);
        contextUtils.active().label(yieldLabel);
    }
}

[Buggy Hunk]
String yieldLabel = codeGenerator.createLabelPrefix("yield", node);

[Patch]
String yieldLabel = "yield" + ((YieldStatement) node).getYieldStatementIndex();

[Demonstration 3]

[Buggy Method]
public static String decompress(final byte[] strBytes) {
    if (strBytes[0] == UNCOMPRESSED_FLAG) {
        return new String(strBytes, 1, strBytes.length, Charsets.UTF_8);
    }
    final StringBuilder out = new StringBuilder();
    for (int i = 0; i < strBytes.length; i++) {
        final char b = (char) (0xFF & strBytes[i]);
        if (b == 254) {
            out.append((char) strBytes[++i]);
        } else if (b == 255) {
            final byte length = strBytes[++i];
            for (int j = 1; j <= length; j++) {
                out.append((char) strBytes[i + j]);
            }
            i += length;
        } else {
            final int loc = 0xFF & b;
            out.append(REVERSE_CODEBOOK[loc]);
        }
    }
    return out.toString();
}

[Buggy Hunk]
final byte length = strBytes[++i];

[Patch]
final int length = 0xFF & strBytes[++i];