Skip to content

Commit 8c6046f

Browse files
committed
Remove unnecessary var re-assignment
1 parent 70c4394 commit 8c6046f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

app/src/main/java/fr/free/nrw/commons/category/CategorizationFragment.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ public void onSaveInstanceState(Bundle outState) {
584584
public boolean onOptionsItemSelected(MenuItem menuItem) {
585585
switch(menuItem.getItemId()) {
586586
case R.id.menu_save_categories:
587-
ArrayList<String> selectedCategories = new ArrayList<String>();
587+
final ArrayList<String> selectedCategories = new ArrayList<String>();
588588
int numberSelected = 0;
589589

590590
for(CategoryItem item: categoriesAdapter.getItems()) {
@@ -594,9 +594,6 @@ public boolean onOptionsItemSelected(MenuItem menuItem) {
594594
}
595595
}
596596

597-
//Need to reassign to a final variable to use in inner class
598-
final ArrayList<String> finalCategories = selectedCategories;
599-
600597
//If no categories selected, display warning to user
601598
if (numberSelected == 0) {
602599
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
@@ -612,7 +609,7 @@ public void onClick(DialogInterface dialog, int id) {
612609
builder.setNegativeButton("Yes, submit", new DialogInterface.OnClickListener() {
613610
public void onClick(DialogInterface dialog, int id) {
614611
//Proceed to submission
615-
onCategoriesSaveHandler.onCategoriesSave(finalCategories);
612+
onCategoriesSaveHandler.onCategoriesSave(selectedCategories);
616613
return;
617614
}
618615
});
@@ -621,7 +618,7 @@ public void onClick(DialogInterface dialog, int id) {
621618
dialog.show();
622619
} else {
623620
//Proceed to submission
624-
onCategoriesSaveHandler.onCategoriesSave(finalCategories);
621+
onCategoriesSaveHandler.onCategoriesSave(selectedCategories);
625622
return true;
626623
}
627624
}

0 commit comments

Comments
 (0)