[Demonstration 1]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.summary_layout);
    long lastGameID = getIntent().getLongExtra("lastGame", 0);
    GameOutcome lastGame = PlayerDataDbHelper.getOutcome(this, lastGameID);
    mode = lastGame.getMode();
    long lastGameTime = lastGame.getElapsed() / 1000;
    TextView elapsed = (TextView) findViewById(R.id.elapsedTime);
    if (lastGame.getOutcome() == GameResult.Win)
        elapsed.setText(String.format("%d:%02d", lastGameTime / 60, lastGameTime % 60));
    else
        elapsed.setText(":(");
    GameSummaryListItemCursorAdapter adapter = new GameSummaryListItemCursorAdapter(this, PlayerDataDbHelper.getBestOutcomes(this, lastGame.getMode(), 5, lastGame.wasHintUsed()), 0);
    ListView listView = (ListView) findViewById(R.id.listView);
    listView.setAdapter(adapter);
    if (lastGame.getOutcome() == GameResult.Win)
        messageUser(getResources().getString(lastGame.wasHintUsed() ? R.string.hintUsed : R.string.hintNotUsed));
    else
        messageUser(getResources().getString(R.string.lostGame));
}

[Buggy Hunk]
ListView listView = (ListView) findViewById(R.id.listView);

[Patch]
ListView listView = (ListView) findViewById(R.id.topTimes);

[Demonstration 2]

[Buggy Method]
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.choose_area);
    listView = (ListView) findViewById(R.id.list_view);
    titleText = (TextView) findViewById(R.id.title_text);
    adapter = new ArrayAdapter<>(this, R.layout.simple_list_item, dataList);
    listView.setAdapter(adapter);
    listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (currentLevel == LEVEL_PROVINCE) {
                selectedProvince = provinceList.get(position);
                queryCities();
            } else if (currentLevel == LEVEL_CITY) {
                selectedCity = cityList.get(position);
                queryCounties();
            }
        }
    });
    weatherDB = WeatherDB.getInstance(this);
    queryProvinces();
}

[Buggy Hunk]
adapter = new ArrayAdapter<>(this, R.layout.simple_list_item, dataList);

[Patch]
adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, dataList);

[Demonstration 3]

[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));