[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 getReviewsFromApi(final Activity activity, final Movie movie, final ReviewsCallback callback) {
    if (Util.isConnected(activity, false)) {
        AsyncTask.execute(new Runnable() {

            @Override
            public void run() {
                String apiUrl = String.format(TMDB_API_REVIEWS_URL, movie.getId(), activity.getString(R.string.tmdb_api_key));
                final List<Review> reviews = new ArrayList<>();
                try {
                    JSONArray reviewsJson = WEBB.get(apiUrl).asJsonObject().getBody().getJSONArray("results");
                    reviews.addAll(toReviews(reviewsJson));
                } catch (final Exception e) {
                    activity.runOnUiThread(new Runnable() {

                        @Override
                        public void run() {
                            callback.error(e);
                        }
                    });
                }
                if (reviews.isEmpty()) {
                    Review review = new Review();
                    review.setContent(activity.getString(R.string.no_review_found));
                    reviews.add(review);
                }
                activity.runOnUiThread(new Runnable() {

                    @Override
                    public void run() {
                        callback.success(reviews);
                    }
                });
            }
        });
    } else {
        Review review = new Review();
        review.setContent(activity.getString(R.string.connect_internet));
        final List<Review> reviews = new ArrayList<>();
        reviews.add(review);
        activity.runOnUiThread(new Runnable() {

            @Override
            public void run() {
                callback.success(reviews);
            }
        });
    }
}

[Buggy Hunk]
review.setContent(activity.getString(R.string.connect_internet));

[Patch]
review.setContent(activity.getString(R.string.conn_internet));

[Demonstration 3]

[Buggy Method]
public static void showFailureDialog(Activity activity, int actResp, int errorCode) {
    if (activity == null) {
        Log.e("GameHelper", "*** No Activity. Can't show failure dialog!");
        return;
    }
    Dialog errorDialog = null;
    switch(actResp) {
        case GamesActivityResultCodes.RESULT_APP_MISCONFIGURED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(activity, GameHelperUtils.R_APP_MISCONFIGURED));
            break;
        case GamesActivityResultCodes.RESULT_SIGN_IN_FAILED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(activity, GameHelperUtils.R_SIGN_IN_FAILED));
            break;
        case GamesActivityResultCodes.RESULT_LICENSE_FAILED:
            errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(activity, GameHelperUtils.R_LICENSE_FAILED));
            break;
        default:
            // No meaningful Activity response code, so generate default Google
            // Play services dialog
            errorDialog = GoogleApiAvailability.getErrorDialog(activity, errorCode, RC_UNUSED);
            if (errorDialog == null) {
                // get fallback dialog
                Log.e("GameHelper", "No standard error dialog available. Making fallback dialog.");
                errorDialog = makeSimpleDialog(activity, GameHelperUtils.getString(activity, GameHelperUtils.R_UNKNOWN_ERROR) + " " + GameHelperUtils.errorCodeToString(errorCode));
            }
    }
    errorDialog.show();
}

[Buggy Hunk]
errorDialog = GoogleApiAvailability.getErrorDialog(activity, errorCode, RC_UNUSED);

[Patch]
errorDialog = GoogleApiAvailability.getInstance().getErrorDialog(activity, errorCode, RC_UNUSED);