Source:
<code>protected void onHandleIntent(Intent intent) { FormResourceDAO formResourceDAO = AppDatabase.getDatabase(OpenMRS.getInstance().getApplicationContext()).formResourceDAO(); if (NetworkUtils.isOnline()) { Call<Results<FormResourceEntity>> call = apiService.getForms(); call.enqueue(new Callback<Results<FormResourceEntity>>() { @Override public void onResponse(@NonNull Call<Results<FormResourceEntity>> call, @NonNull Response<Results<FormResourceEntity>> response) { if (response.isSuccessful()) { <START> formResourceDAO.deleteALlForms(); <END> formresourcelist = response.body().getResults(); int size = formresourcelist.size(); for (int i = 0; i < size; i++) { formResourceDAO.addFormResource(formresourcelist.get(i)); } } } @Override public void onFailure(@NonNull Call<Results<FormResourceEntity>> call, @NonNull Throwable t) { ToastUtil.error(t.getMessage()); } }); Call<Results<EncounterType>> call2 = apiService.getEncounterTypes(); call2.enqueue(new Callback<Results<EncounterType>>() { @Override public void onResponse(@NonNull Call<Results<EncounterType>> call, @NonNull Response<Results<EncounterType>> response) { if (response.isSuccessful()) { formResourceDAO.deleteALlForms(); Results<EncounterType> encountertypelist = response.body(); for (EncounterType enctype : encountertypelist.getResults()) enctype.save(); } } @Override public void onFailure(@NonNull Call<Results<EncounterType>> call, @NonNull Throwable t) { ToastUtil.error(t.getMessage()); } }); } }</code><technical_language>Typo in deleteALlForms -> deleteAllForms</technical_language>

Target:
protected void onHandleIntent(Intent intent) { FormResourceDAO formResourceDAO = AppDatabase.getDatabase(OpenMRS.getInstance().getApplicationContext()).formResourceDAO(); EncounterTypeRoomDAO encounterTypeRoomDAO = AppDatabase.getDatabase(OpenMRS.getInstance().getApplicationContext()).encounterTypeRoomDAO(); if (NetworkUtils.isOnline()) { Call<Results<FormResourceEntity>> call = apiService.getForms(); call.enqueue(new Callback<Results<FormResourceEntity>>() { @Override public void onResponse(@NonNull Call<Results<FormResourceEntity>> call, @NonNull Response<Results<FormResourceEntity>> response) { if (response.isSuccessful()) { formResourceDAO.deleteAllForms(); formresourcelist = response.body().getResults(); int size = formresourcelist.size(); for (int i = 0; i < size; i++) { formResourceDAO.addFormResource(formresourcelist.get(i)); } } } @Override public void onFailure(@NonNull Call<Results<FormResourceEntity>> call, @NonNull Throwable t) { ToastUtil.error(t.getMessage()); } }); Call<Results<EncounterType>> call2 = apiService.getEncounterTypes(); call2.enqueue(new Callback<Results<EncounterType>>() { @Override public void onResponse(@NonNull Call<Results<EncounterType>> call, @NonNull Response<Results<EncounterType>> response) { if (response.isSuccessful()) { encounterTypeRoomDAO.deleteAllEncounterTypes(); Results<EncounterType> encounterTypeList = response.body(); for (EncounterType encounterType : encounterTypeList.getResults()) encounterTypeRoomDAO.addEncounterType(encounterType); } } @Override public void onFailure(@NonNull Call<Results<EncounterType>> call, @NonNull Throwable t) { ToastUtil.error(t.getMessage()); } }); } }