[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 ArrayList<Claim> loadNotUserClaims(User user) {
    ArrayList<Claim> claims = new ArrayList<Claim>();
    SharedPreferences claimCounterFile = this.context.getSharedPreferences("claimCounter", 0);
    int mostRecentClaimId = claimCounterFile.getInt("claimCount", 0);
    Claim claim;
    User currentUser;
    int currentUserId;
    int actualUserId = user.getId();
    for (int i = 1; i <= mostRecentClaimId; i++) {
        claim = new Claim(i);
        currentUser = claim.getUser();
        if (currentUser != null) {
            currentUserId = currentUser.getId();
            // Checks to make sure the Claim does NOT belong to the Actual
            // user and that the claims have a submitted status
            if ((claim.getId() != -1) && (actualUserId != currentUserId) && (claim.getStatus() == Constants.statusSubmitted)) {
                claims.add(claim);
            }
        }
    }
    return claims;
}

[Buggy Hunk]
(claim.getStatus() == Constants.statusSubmitted)){

[Patch]
(claim.getStatus().equals(Constants.statusSubmitted))){

[Demonstration 3]

[Buggy Method]
@Override
public List<Claim> getClaimsOfUser(String uniqueUserId, List<MetaClaim> metaClaims) throws IdentityStoreException, UserNotFoundException {
    identityStoreInterceptors.forEach(LambdaExceptionUtils.rethrowConsumer(identityStoreInterceptor -> identityStoreInterceptor.doPreGetClaimsOfUser(uniqueUserId, metaClaims)));
    List<Claim> claims = identityStore.getClaimsOfUser(uniqueUserId);
    identityStoreInterceptors.forEach(LambdaExceptionUtils.rethrowConsumer(identityStoreInterceptor -> identityStoreInterceptor.doPostGetClaimsOfUser(uniqueUserId, metaClaims, claims)));
    return claims;
}

[Buggy Hunk]
List<Claim> claims = identityStore.getClaimsOfUser(uniqueUserId);

[Patch]
List<Claim> claims = identityStore.getClaimsOfUser(uniqueUserId, metaClaims);