[Demonstration 1]

[Buggy Method]
private void updateSearchLabel(String s) {
    if (s != null) {
        String[] array = s.split(",");
        if (array[0].equals("searchForCitedBy")) {
            Platform.runLater(() -> searchLabel.setText(array[1]));
        } else {
            Platform.runLater(() -> searchLabelSFA.setText(array[1]));
        }
    }
}

[Buggy Hunk]
private void updateSearchLabel(String s) {

[Patch]
void updateSearchLabel(String s) {

[Demonstration 2]

[Buggy Method]
private static RemoteDataBean sendRequest(String url, List<Cookie> cookies, HttpServletRequest request, HttpServletResponse response) throws IOException, UnknownTypeException {
    URL action = new URL(url);
    HttpURLConnection connection = (HttpURLConnection) action.openConnection();
    setRequestHeader(request, connection, cookies);
    try {
        connection.connect();
    } catch (ConnectException e) {
        throw new ConnectException("Failed to connect to " + url + ": Connection refused");
    }
    int statusCode = connection.getResponseCode();
    if (statusCode == HttpURLConnection.HTTP_MOVED_PERM || statusCode == HttpURLConnection.HTTP_MOVED_TEMP) {
        String location = connection.getHeaderField("location");
        if (location != null) {
            return sendRequest(location, cookies, request, response);
        }
    }
    InputStream inputStream;
    String contentEncoding = connection.getContentEncoding();
    try {
        if (contentEncoding == null) {
            inputStream = connection.getInputStream();
        } else {
            switch(contentEncoding.toLowerCase()) {
                case "gzip":
                    inputStream = new GZIPInputStream(connection.getInputStream());
                    break;
                case "deflate":
                    inputStream = new DeflaterInputStream(connection.getInputStream());
                    break;
                default:
                    throw new IOException("Does not support the Content-Encoding: " + contentEncoding);
            }
        }
    } catch (IOException e) {
        throw new IOException("Server returned HTTP response code: " + statusCode + " for URL: " + url);
    }
    RemoteDataBean remoteData = new RemoteDataBean();
    remoteData.setUrl(url);
    remoteData.setData(stream2string(inputStream));
    setResponseHeader(response, connection);
    response.setHeader("X-Target-Url", url);
    inputStream.close();
    return remoteData;
}

[Buggy Hunk]
remoteData.setData(stream2string(inputStream));

[Patch]
remoteData.setData(stream2string(inputStream).trim());

[Demonstration 3]

[Buggy Method]
@Override
public void showHttpError(int code) {
    WebService.handlerRequestError(getApplicationContext(), code);
}

[Buggy Hunk]
WebService.handlerRequestError(getApplicationContext(), code);

[Patch]
WebService.handlerRequestError(this, code);