[Demonstration 1]

[Buggy Method]
@Transactional(readOnly = true)
public static Result view(Long id) {
    Media media = Media.findById(id);
    if (Secured.viewMedia(media)) {
        if (media == null) {
            return redirect(controllers.routes.Application.index());
        } else {
            Logger.info("File found, filename = " + media.fileName + " filetype = " + media.mimetype + " filepath = " + media.url);
            response().setHeader("Content-disposition", "inline; filename=\"" + media.fileName + "\"");
            return ok(media.file);
        }
    } else {
        flash("error", "Dazu hast du keine Berechtigung!");
        return redirect(controllers.routes.Application.index());
    }
}

[Buggy Hunk]
Logger.info("File found, filename = " + media.fileName + " filetype = " + media.mimetype + " filepath = " + media.url);

[Patch]
Logger.info("File found, filename = " + media.fileName + " filetype = " + media.mimetype + " filepath = " + media.url + " file = " + media.file);

[Demonstration 2]

[Buggy Method]
public boolean place(Simulation simulation) {
    if (carried.size() == 0) {
        debug("Alert: tried to place nothing");
        return false;
    }
    Coordinate position = getFrontCoordinates(simulation);
    if (simulation.isFreeTile(position) == false) {
        debug("Alert: tried to place on occupied space");
        return false;
    }
    Entity entity = carried.remove(carried.size() - 1);
    // adds it
    entity.setPosition(simulation, position);
    return true;
}

[Buggy Hunk]
entity.setPosition(simulation, position); // adds it

[Patch]
entity.placeAt(simulation, position);

[Demonstration 3]

[Buggy Method]
@Override
protected String doInBackground(String... params) {
    String address = params[0];
    String response = getRequest(address);
    JSONObject json = null;
    try {
        json = new JSONObject(response);
        //checking if the AsyncTask is executed with a click from the category recyclerView or from the autocomplete fragment
        if (json.has("results")) {
            JSONArray array = json.getJSONArray("results");
            for (int i = 0; i < array.length(); i++) {
                JSONObject myobj = array.getJSONObject(i);
                String placeID = (String) myobj.get("place_id");
                address = "https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=" + String.valueOf(lastLocation.getLatitude()) + "," + String.valueOf(lastLocation.getLongitude()) + "&destinations=place_id:" + placeID + "&key=AIzaSyDWeC1Uu7iVM2HyHi-dc6Xvde6b45vSFl4";
                String distanceResponse = getRequest(address);
                JSONObject distanceJson = new JSONObject(distanceResponse);
                JSONObject distanceRows = (JSONObject) distanceJson.getJSONArray("rows").get(0);
                JSONArray distanceElements = (JSONArray) distanceRows.getJSONArray("elements");
                // distance and duration
                JSONObject distanceAndDuration = distanceElements.getJSONObject(0);
                JSONObject distanceObj = distanceAndDuration.getJSONObject("distance");
                JSONObject durationObj = distanceAndDuration.getJSONObject("duration");
                JSONObject geometry = myobj.getJSONObject("geometry");
                geometry.put("distance", distanceObj);
                geometry.put("duration", durationObj);
            }
        }
        if (json.has("result")) {
            address = "https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=" + String.valueOf(lastLocation.getLatitude()) + "," + String.valueOf(lastLocation.getLongitude()) + "&destinations=place_id:" + autocompletePlaceID + "&key=AIzaSyDWeC1Uu7iVM2HyHi-dc6Xvde6b45vSFl4";
            String distanceResponse = getRequest(address);
            JSONObject distanceJson = new JSONObject(distanceResponse);
            JSONObject distanceRows = (JSONObject) distanceJson.getJSONArray("rows").get(0);
            JSONArray distanceElements = distanceRows.getJSONArray("elements");
            // distance and duration
            JSONObject distanceAndDuration = distanceElements.getJSONObject(0);
            JSONObject distanceObj = distanceAndDuration.getJSONObject("distance");
            JSONObject durationObj = distanceAndDuration.getJSONObject("duration");
            JSONObject geometry = json.getJSONObject("result").getJSONObject("geometry");
            geometry.put("distance", distanceObj);
            geometry.put("duration", durationObj);
        }
    } catch (JSONException e) {
        e.printStackTrace();
    }
    response = json.toString();
    return response;
}

[Buggy Hunk]
JSONArray distanceElements = (JSONArray) distanceRows.getJSONArray("elements");

[Patch]
JSONArray distanceElements = distanceRows.getJSONArray("elements");