[Demonstration 1]

[Buggy Method]
public void postComment(int number, String comment) {
    System.out.println("Posting: " + comment);
    if (this.dryRun) {
        System.out.println("Dry run - Not posting to github");
        return;
    }
    final String requestUrl = baseUrl + "/issues/" + number + "/comments";
    final HttpPost post = new HttpPost(requestUrl);
    try {
        post.setEntity(new StringEntity("{\"body\": \"" + comment + "\"}"));
        final HttpResponse execute = execute(post);
    } catch (Exception e) {
        e.printStackTrace(System.err);
    } finally {
        post.abort();
    }
}

[Buggy Hunk]
final HttpResponse execute = execute(post);

[Patch]
execute(post);

[Demonstration 2]

[Buggy Method]
public static void parseCategory(Element element) {
    String itemID = "";
    String category = "";
    parseWriter(categoryWriter, itemID, category);
}

[Buggy Hunk]
public static void parseCategory(Element element)

[Patch]
public static void parseCategory(Element element) throws IOException

[Demonstration 3]

[Buggy Method]
public List<IWlanElement> decode(byte[] frame) {
    // list of wlan element id to be created
    List<IWlanElement> listOfElements = new ArrayList<IWlanElement>();
    if (frame.length >= 2) {
        // decode frame until no element id frame can be read
        boolean endOfFrame = false;
        byte[] currentFrame = frame;
        while (!endOfFrame) {
            byte elementId = currentFrame[0];
            int length = currentFrame[1] & 0xFF;
            byte[] treatedFrame = new byte[length];
            IWlanElement element = null;
            System.arraycopy(currentFrame, 2, treatedFrame, 0, length);
            boolean done = false;
            switch(elementId) {
                case SSIDElement.id:
                    done = true;
                    element = new SSIDElement(treatedFrame);
                    break;
                case SupportedRateElement.id:
                    done = true;
                    element = new SupportedRateElement(treatedFrame);
                    break;
                case HTCapabilitiesElement.id:
                    done = true;
                    element = new HTCapabilitiesElement(treatedFrame);
                    break;
                case ExtendedSupportedRateElement.id:
                    done = true;
                    element = new ExtendedSupportedRateElement(treatedFrame);
                    break;
                case TimElement.id:
                    done = true;
                    element = new TimElement(treatedFrame);
                    break;
                case ErpElement.id:
                    done = true;
                    element = new ErpElement(treatedFrame);
                    break;
                case DsssParameterSetElement.id:
                    done = true;
                    element = new DsssParameterSetElement(treatedFrame);
                    break;
            }
            if (!done && WlanDecoder.DISPLAY_ELEMENT_NOT_DECODED) {
                System.out.println("Element id not decoded => " + (elementId & 0XFF));
            }
            if (element != null) {
                listOfElements.add(element);
            }
            if ((currentFrame.length - length - 2) > 0) {
                byte[] dest = new byte[currentFrame.length - length - 2];
                System.arraycopy(currentFrame, length + 2, dest, 0, currentFrame.length - length - 2);
                currentFrame = dest;
            } else {
                endOfFrame = true;
            }
        }
    }
    return listOfElements;
}

[Buggy Hunk]
if ((currentFrame.length - length - 2) > 0) {

[Patch]
if ((currentFrame.length - length - 2) >= 2) {