From e5968667f0fe07ccaeba196dcf9715d69959966a Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 6 Aug 2015 11:11:37 +0200 Subject: [PATCH] =?utf8?q?bundle=20is=20now=20static=20as=20only=20one=20i?= =?utf8?q?nstance=20is=20enough=20+=20initBundle()=20added=20Signed-off-by?= =?utf8?q?:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/org/mxchange/jcore/BaseFrameworkSystem.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/org/mxchange/jcore/BaseFrameworkSystem.java b/src/org/mxchange/jcore/BaseFrameworkSystem.java index 6063611..bbaf0a4 100644 --- a/src/org/mxchange/jcore/BaseFrameworkSystem.java +++ b/src/org/mxchange/jcore/BaseFrameworkSystem.java @@ -61,7 +61,7 @@ public class BaseFrameworkSystem implements FrameworkInterface { /** * Bundle instance */ - private final ResourceBundle bundle; + private static ResourceBundle bundle; /** * Client instance @@ -88,7 +88,6 @@ public class BaseFrameworkSystem implements FrameworkInterface { */ { LOG = LogManager.getLogger(this); - bundle = ResourceBundle.getBundle(FrameworkInterface.I18N_BUNDLE_FILE); // NOI18N } /** @@ -99,6 +98,20 @@ public class BaseFrameworkSystem implements FrameworkInterface { this.initProperties(); } + /** + * Initializes i18n bundles + */ + protected void initBundle () { + // Is the bundle set? + if (bundle instanceof ResourceBundle) { + // Is already set + throw new IllegalStateException("called twice"); + } + + // Set instance + bundle = ResourceBundle.getBundle(FrameworkInterface.I18N_BUNDLE_FILE); // NOI18N + } + /** * Application instance * -- 2.39.5