[Demonstration 1]

[Buggy Method]
public final com.google.protobuf.Message callBlockingMethod(com.google.protobuf.Descriptors.MethodDescriptor method, com.google.protobuf.RpcController controller, com.google.protobuf.Message request) throws com.google.protobuf.ServiceException {
    if (method.getService() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException("Service.callBlockingMethod() given method descriptor for " + "wrong service type.");
    }
    switch(method.getIndex()) {
        case 0:
            return impl.getMobCompactRegions(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterMobCompactionStatusProtos.GetMobCompactionRegionsRequest) request);
        case 1:
            return impl.updateMobCompactionAsMajor(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterMobCompactionStatusProtos.UpdateMobCompactionAsMajorRequest) request);
        default:
            throw new java.lang.AssertionError("Can't get here.");
    }
}

[Buggy Hunk]
return impl.getMobCompactRegions(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterMobCompactionStatusProtos.GetMobCompactionRegionsRequest)request);

[Patch]
return impl.getMobCompactionRegions(controller, (org.apache.hadoop.hbase.protobuf.generated.MasterMobCompactionStatusProtos.GetMobCompactionRegionsRequest)request);

[Demonstration 2]

[Buggy Method]
private int readXMLComment(final Line firstLine, final int start) {
    Line line = firstLine;
    if (start + 3 < line.value.length()) {
        if (line.value.charAt(2) == '-' && line.value.charAt(3) == '-') {
            int pos = start + 4;
            while (line != null) {
                while (pos < line.value.length() && line.value.charAt(pos) != '-') {
                    pos++;
                }
                if (pos == line.value.length()) {
                    line = line.next;
                    pos = 0;
                } else {
                    if (pos + 2 < line.value.length()) {
                        if (line.value.charAt(pos + 1) == '-' && line.value.charAt(pos + 2) == '>') {
                            this.xmlEndLine = line;
                            return pos + 3;
                        }
                    }
                    pos++;
                }
            }
        }
    }
    return -1;
}

[Buggy Hunk]
if (line.value.charAt(2) == '-' && line.value.charAt(3) == '-')

[Patch]
if (line.value.charAt(start + 2) == '-' && line.value.charAt(start + 3) == '-')

[Demonstration 3]

[Buggy Method]
@Override
public int compare(ArrayList<Float> a, ArrayList<Float> b) {
    return b.get(hv.length + 1).compareTo(a.get(hv.length + 1));
}

[Buggy Hunk]
return b.get(hv.length+1).compareTo(a.get(hv.length+1));

[Patch]
return b.get(v.length).compareTo(a.get(v.length));