[Demonstration 1]

[Buggy Method]
public Scraper url(URL url) throws MalformedURLException {
    this.url = url;
    this.extractedFields = null;
    extractor.url(url);
    if (this.extractedFields != null) {
        this.extractedFields.clear();
    }
    if (this.sessionIDName != null) {
        try {
            this.sessionIDName = ScraperUtil.extractSessionId(this.url, sessionIDName);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    String hostName = "http://".concat(url.getHost());
    baseUrl = new URL(hostName);
    return this;
}

[Buggy Hunk]
e.printStackTrace();

[Patch]
log.error(MessageFormat.format("io error scraping url: {0}", url), e);

[Demonstration 2]

[Buggy Method]
static Response fromApacheResponse(HttpResponse response) throws IOException {
    int statusCode = response.getStatusLine().getStatusCode();
    String body = extractBody(response);
    return new Response(statusCode, body);
}

[Buggy Hunk]
static Response fromApacheResponse(HttpResponse response) throws IOException {

[Patch]
protected static Response fromApacheResponse(HttpResponse response) throws IOException {

[Demonstration 3]

[Buggy Method]
private String setURL(String url) {
    this.url = url;
}

[Buggy Hunk]
private String setURL(String url) {

[Patch]
public String setURL(String url) {