[Demonstration 1]

[Buggy Method]
public static int postJsonString(String url, String jsonString) throws IOException {
    HttpClient httpClient = HttpClients.createDefault();
    HttpPost post = new HttpPost(url);
    post.setEntity(new StringEntity(jsonString, ContentType.create("application/json")));
    HttpResponse response = httpClient.execute(post);
    return response.getStatusLine().getStatusCode();
}

[Buggy Hunk]
post.setEntity(new StringEntity(jsonString, ContentType.create("application/json")));

[Patch]
post.setEntity(new StringEntity(jsonString, ContentType.create("application/json", "UTF-8")));

[Demonstration 2]

[Buggy Method]
public HttpResponse makeHttpPostRequest(final String actionUrl, final String connectionToken, final List<BasicNameValuePair> params) throws IOException {
    final String csrfToken = getCSrfToken(connectionToken);
    HttpResponse response = null;
    try {
        final HttpPost post = new HttpPost(actionUrl);
        // add header
        post.setHeader("User-Agent", USER_AGENT);
        post.setHeader("X-CSRF-TOKEN", csrfToken);
        final List<NameValuePair> urlParameters = new ArrayList<NameValuePair>();
        for (final BasicNameValuePair nameValuePair : params) {
            urlParameters.add(nameValuePair);
        }
        if (connectionToken != null) {
            post.setHeader("Cookie", "JSESSIONID=" + connectionToken);
        }
        HttpEntity entity;
        entity = new UrlEncodedFormEntity(urlParameters, "utf-8");
        post.setEntity(entity);
        response = httpClient.execute(post);
    } catch (final Exception e) {
        System.out.println("Exceptiop " + e.getMessage());
    }
    return response;
}

[Buggy Hunk]
response = httpClient.execute(post);

[Patch]
response = ignoreSSLhttpClientFactory.buildHttpClient().execute(post);

[Demonstration 3]

[Buggy Method]
public String format(Object o, String defaultIfNull) {
    if (o == null) {
        return defaultIfNull;
    }
    return format.format(o);
}

[Buggy Hunk]
return format.format(o);

[Patch]
return format.get().format(o);