From: Roland Haeder <roland@mxchange.org>
Date: Thu, 6 Aug 2015 09:11:37 +0000 (+0200)
Subject: bundle is now static as only one instance is enough + initBundle() added
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e5968667f0fe07ccaeba196dcf9715d69959966a;p=jcore.git

bundle is now static as only one instance is enough + initBundle() added
Signed-off-by:Roland Häder <roland@mxchange.org>
---

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
 	 *