[Demonstration 1]

[Buggy Method]
public boolean updateFeed() {
    synchronized (YoutubeFeedListener.class) {
        try (XmlReader reader = new XmlReader(new URL(instance.getYoutubeFeed()))) {
            SyndFeedInput input = new SyndFeedInput();
            this.feed = input.build(reader);
            log.trace("updated feed of %s", getChannelId());
        } catch (FeedException e) {
            log.error("was unable to parse feed", e);
            return false;
        } catch (MalformedURLException e) {
            log.error(String.format("youtube feed URL is malformed, please check the configurations " + "for channel-id %s", getChannelId()), e);
            return false;
        } catch (IOException e) {
            log.error("an error occurred whilst trying to read the stream of the provided youtube-feed", e);
            return false;
        }
        return true;
    }
}

[Buggy Hunk]
log.trace("updated feed of %s", getChannelId());

[Patch]
log.trace(String.format("updated feed of %s", getChannelId()));

[Demonstration 2]

[Buggy Method]
public ResponseEntity<String> getBatchResult(String batchId) {
    String mainUrl = properties.getProperty("streetlight.url.main");
    String batchUrl = properties.getProperty("streelight.url.getDevice.batch");
    String json = properties.getProperty("streetlight.url.controller.ser");
    String url = mainUrl + batchUrl;
    List<Object> ParamData = new ArrayList<Object>();
    ParamData.add("batchId=" + batchId);
    ParamData.add("ser=" + json);
    String params = StringUtils.join(ParamData, "&");
    url = url + "?" + params;
    return getRequest(url);
}

[Buggy Hunk]
return getRequest(url);

[Patch]
return getRequest(url,true);

[Demonstration 3]

[Buggy Method]
private void communicate(HttpRequest httpRequest, int izou, Context context) {
    IzouConnection izouConnection = izouConnections.get(izou);
    if (izouConnection == null) {
        throw new NotFoundException("No connection to Izou");
    } else if (izouConnection.socket.isClosed()) {
        izouConnections.remove(izou);
        throw new NotFoundException("No connection to Izou");
    } else {
        Blocking.get(() -> {
            BoundedLock.LockHolder lockHolder;
            try {
                lockHolder = izouConnection.lock.lock(10, TimeUnit.SECONDS).orElseThrow(() -> new InternalServerErrorException("1. Izou Connection is busy"));
            } catch (IllegalStateException e) {
                throw new BadRequestException("Maximum of parallel Requests for Izou-Instance reached");
            }
            try {
                if (izouConnection.socket.isClosed() || !(izouConnections.get(izou) == izouConnection)) {
                    throw new InternalServerErrorException("1. Izou Connection closed while waiting for availability");
                }
                InputStream in = izouConnection.socket.getInputStream();
                OutputStream out = izouConnection.socket.getOutputStream();
                // Write the response to the wire
                httpRequest.writeDelimitedTo(out);
                if (httpRequest.getBodySize() != -1) {
                    Long written = Blocking.on(Promise.async(down -> down.accept(writeBody(out, context, httpRequest.getBodySize()))));
                    if (httpRequest.getBodySize() != written) {
                        throw new IzouCommunicationException("Actual Body length does not match content-lenght header");
                    }
                }
                out.flush();
                HttpResponse response = HttpResponse.parseDelimitedFrom(in);
                if (response == null) {
                    throw new IzouCommunicationException("Unable to read response from izou");
                }
                return new Response(response, izouConnection.socket, lockHolder);
            } catch (IzouCommunicationException | SocketException e) {
                izouConnection.socket.close();
                izouConnections.remove(izou);
                throw e;
            } finally {
                lockHolder.unlock();
            }
        }).then(response -> sendResponse(response.httpResponse, response.socket, context, response.lock));
    }
}

[Buggy Hunk]
} catch (IzouCommunicationException | SocketException e) {

[Patch]
} catch (IzouCommunicationException | SocketException | InvalidProtocolBufferException e) {