Skip to content

Commit

Permalink
Ensuring immutability of data returned for lookups
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
tomaytotomato committed Aug 9, 2024
1 parent 265c818 commit 69eae09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/src/main/java/com/tomaytotomato/LocationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.tomaytotomato.usecase.FindCity;
import com.tomaytotomato.usecase.FindCountry;
import com.tomaytotomato.usecase.FindState;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -150,7 +151,7 @@ public Optional<Country> findCountryByISO3Code(String iso3Code) {
}

public List<Country> findAllCountries() {
return countries;
return Collections.unmodifiableList(countries);
}

/**
Expand Down

0 comments on commit 69eae09

Please sign in to comment.