From f01ce54991733c8e2276e55d665bafb164f581a9 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 09:11:18 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20return=20unmodifyable=20list=20?= =?utf8?q?instead=20of=20array=20-=20use=20correct=20property=20name=20Sig?= =?utf8?q?ned-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../mxchange/addressbook/beans/country/CountryWebBean.java | 5 +++-- .../addressbook/beans/country/CountryWebController.java | 3 ++- web/WEB-INF/templates/generic/form_personal_data.tpl | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java b/src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java index 126a0267..b6b171ff 100644 --- a/src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/country/CountryWebBean.java @@ -16,6 +16,7 @@ package org.mxchange.addressbook.beans.country; * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ +import java.util.Collections; import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; @@ -69,9 +70,9 @@ public class CountryWebBean implements CountryWebController { } @Override - public Country[] allCountries () { + public List allCountries () { // Return "cached" version - return (Country[]) this.countryList.toArray(); + return Collections.unmodifiableList(this.countryList); } @PostConstruct diff --git a/src/java/org/mxchange/addressbook/beans/country/CountryWebController.java b/src/java/org/mxchange/addressbook/beans/country/CountryWebController.java index b1a80240..311af3bc 100644 --- a/src/java/org/mxchange/addressbook/beans/country/CountryWebController.java +++ b/src/java/org/mxchange/addressbook/beans/country/CountryWebController.java @@ -17,6 +17,7 @@ package org.mxchange.addressbook.beans.country; * this program. If not, see . */ import java.io.Serializable; +import java.util.List; import org.mxchange.jcountry.data.Country; /** @@ -31,5 +32,5 @@ public interface CountryWebController extends Serializable { *

* @return All countries */ - public Country[] allCountries (); + public List allCountries (); } diff --git a/web/WEB-INF/templates/generic/form_personal_data.tpl b/web/WEB-INF/templates/generic/form_personal_data.tpl index fd33b314..0d3b3703 100644 --- a/web/WEB-INF/templates/generic/form_personal_data.tpl +++ b/web/WEB-INF/templates/generic/form_personal_data.tpl @@ -114,7 +114,7 @@

- +
-- 2.39.5