[Demonstration 1]

[Buggy Method]
public static Result service(String ownerName, String projectName, String service, boolean isAdvertise) throws IOException, UnsupportedOperationException, ServletException {
    if (!isSupportedService(service)) {
        return forbidden(String.format("Unsupported service: '%s'", service));
    }
    Project project = Project.findByOwnerAndProjectName(ownerName, projectName);
    if (project == null) {
        return notFound();
    }
    models.User user = UserApp.currentUser();
    if (!isAllowed(project, service)) {
        if (user.isAnonymous()) {
            return BasicAuthAction.unauthorized(response());
        } else {
            // If you want the Git client showing your custom message to
            // the user, the Content-Type should be exact "text/plain"
            // without any parameter. For more details, see the code at
            // https://github.com/git/git/commit/426e70d4a11ce3b4f70636d57c6a0ab16ae08a00#diff-eea0ad565ec5903a11b6023755d491cfR154
            response().setHeader("Content-Type", "text/plain");
            return forbidden(String.format("'%s' has no permission to '%s/%s'.", user.name, ownerName, projectName));
        }
    }
    if (isAdvertise) {
        return ok(RepositoryService.gitAdvertise(project, service, response()));
    } else {
        if (request().body().isMaxSizeExceeded()) {
            return status(REQUEST_ENTITY_TOO_LARGE);
        } else {
            user.visits(project);
            return ok(RepositoryService.gitRpc(project, service, request(), response()));
        }
    }
}

[Buggy Hunk]
user.name, ownerName, projectName));

[Patch]
user.loginId, ownerName, projectName));

[Demonstration 2]

[Buggy Method]
public static void main(String[] args) {
    sm = new ServerManager(new PortPool(51000, 52000));
    //        Server netServer = new Server();
    //        netServer.addListener(new MasterListener());
    //todo: bind server and run
    Runtime.getRuntime().addShutdownHook(new Thread(sm::killAllServers));
    Console cns = new Console();
    cns.addCommand(new Command("stop", (a) -> {
        System.out.println("Server stopped.");
        System.exit(0);
        return "";
    }));
    cns.addCommand(new Command("host", (input) -> {
        ServerInfo si = null;
        try {
            si = sm.createServer(input[1], input[2]);
        } catch (NoPortsLeftException e) {
            return "Can't create server. No ports left";
        }
        if (si == null) {
            return "Can't create server. Unknown error";
        }
        return "Server created:" + si.toString();
    }));
    cns.addCommand(new Command("list", (a) -> {
        StringBuilder sb = new StringBuilder();
        for (ServerInfo si : sm.getServerList()) {
            sb.append(si.toString() + "\n");
        }
        return sb.toString();
    }));
    cns.addCommand(new Command("command", (input) -> {
        sm.pushMessage(input[1], input[2]);
        return "Command pushed to the server";
    }));
    cns.addCommand(new Command("read", (input) -> {
        return sm.getOutput(input[1]);
    }));
    cns.start();
    try {
        WebServer webServer = new WebServer();
    } catch (Exception e) {
        System.out.println("Can't start web server");
        e.printStackTrace();
    }
}

[Buggy Hunk]
si = sm.createServer(input[1], input[2]);

[Patch]
si = sm.createServer(input[1], input[2], "");

[Demonstration 3]

[Buggy Method]
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.mobile_activity_settings);
    ButterKnife.bind(this);
}

[Buggy Hunk]
public void onCreate(Bundle savedInstanceState) {

[Patch]
public void onCreate(final Bundle savedInstanceState) {