[Demonstration 1]

[Buggy Method]
private void login() {
    database = database.child(Username);
    database.addListenerForSingleValueEvent(new ValueEventListener() {

        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            if (dataSnapshot.exists()) {
                Coordinator coordinator = dataSnapshot.getValue(Coordinator.class);
                String p = coordinator.getPassword();
                if (!Password.equals(coordinator.getPassword())) {
                    Toast.makeText(getBaseContext(), "Wrong Password", Toast.LENGTH_SHORT).show();
                } else {
                    session.create_oldusersession(Username, coordinator.getName());
                    LeasingManagers.setOnlineStatus(Username);
                    String myFCMToken;
                    if (FirebaseInstanceId.getInstance().getToken() == null)
                        myFCMToken = sharedPreferences.getString("myFCMToken", "");
                    else
                        myFCMToken = FirebaseInstanceId.getInstance().getToken();
                    if (!myFCMToken.equals("")) {
                        DBREF.child("Fcmtokens").child(Username).child("token").setValue(myFCMToken);
                        goToTabLayout();
                    } else
                        Toast.makeText(coordinatorLogin.this, "You will need to clear the app data or reinstall the app to make it work properly", Toast.LENGTH_LONG).show();
                }
            } else {
                Toast.makeText(getBaseContext(), "Coordinator Not Registered", Toast.LENGTH_SHORT).show();
            }
        }

        @Override
        public void onCancelled(DatabaseError databaseError) {
        }
    });
}

[Buggy Hunk]
database = database.child(Username);

[Patch]
database = DBREF.child("Coordinator").child(Username).getRef();

[Demonstration 2]

[Buggy Method]
@SuppressWarnings("unchecked")
public static ItemStack deserItemStack(JsonElement json) {
    if (json.isJsonNull())
        return null;
    JsonObject dto = json.getAsJsonObject();
    ItemStack stack = new ItemStack(Material.valueOf(dto.get("type").getAsString()), dto.get("amount").getAsInt(), dto.get("damage").getAsShort());
    if (dto.has("meta")) {
        Type mapType = new TypeToken<Map<String, Object>>() {
        }.getType();
        ItemMeta meta = (ItemMeta) ConfigurationSerialization.deserializeObject(dblHack(GSON.fromJson(dto.get("meta"), mapType)), ConfigurationSerialization.getClassByAlias("ItemMeta"));
        stack.setItemMeta(meta);
    }
    return stack;
}

[Buggy Hunk]
if (json.isJsonNull())

[Patch]
if (json == null || json.isJsonNull())

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