[Demonstration 1]

[Buggy Method]
public static void startServer(int port) throws Exception {
    Server server = new Server(port);
    webSocketHandler = new WebSocketHandler() {

        @Override
        public void configure(WebSocketServletFactory factory) {
            factory.getPolicy().setIdleTimeout(600000);
            factory.register(DoodleSocket.class);
        }
    };
    webSocketHandler.setHandler(new WebsiteHandler());
    server.setHandler(webSocketHandler);
    server.start();
    System.out.println("DoodleDebug server running at http://localhost:" + port);
    server.join();
}

[Buggy Hunk]
Server server = new Server(port);

[Patch]
server = new Server(port);

[Demonstration 2]

[Buggy Method]
private static boolean isValidPort(int port) {
    return port >= 0 && port <= 49151;
}

[Buggy Hunk]
private static boolean isValidPort(int port) {

[Patch]
static boolean isValidPort(int port) {

[Demonstration 3]

[Buggy Method]
@Override
public String getHeader(String name) {
    return sanitizeHeader(name);
}

[Buggy Hunk]
return sanitizeHeader(name);

[Patch]
return sanitizeHeader(super.getHeader(name));