// Is cache there?
if (!this.countryCache.iterator().hasNext()) {
// Get whole list
- final List<Country> list = this.countryBean.allCountries();
+ final List<Country> countries = this.countryBean.allCountries();
// Add all
- for (final Iterator<Country> iterator = list.iterator(); iterator.hasNext();) {
- // Get next element
- final Country next = iterator.next();
-
+ for (final Country country : countries) {
// Add it to cache
- this.countryCache.put(next.getCountryId(), next);
+ this.countryCache.put(country.getCountryId(), country);
}
}
}