X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2FCfbBundle.java;h=b46b2905722a3eaaed88a054f2ed188b4a9405e1;hp=5f5aa9ee8b52ce303cf45c623a8853800c32b1e4;hb=bedb0c5b72bcbbbcc2b8d11575ad99489aef6853;hpb=e39cfda923b6edce0fb80211cc927a7534abba10 diff --git a/prod/net/jaekl/cfb/CfbBundle.java b/prod/net/jaekl/cfb/CfbBundle.java index 5f5aa9e..b46b290 100644 --- a/prod/net/jaekl/cfb/CfbBundle.java +++ b/prod/net/jaekl/cfb/CfbBundle.java @@ -58,6 +58,11 @@ public class CfbBundle { m_bundle = QDBundleFactory.getInst().getBundle(BUNDLE_NAME, locale); } + // This constructor is intended only for use during unit testing. + CfbBundle() { + m_bundle = null; + } + public String get(String key, Object... arguments) { try { if (null != m_bundle) { @@ -71,10 +76,15 @@ public class CfbBundle { // Fall through to the fallback behaviour below } + return fallbackGet(key, arguments); + } + + String fallbackGet(String key, Object... arguments) { StringBuilder sb = new StringBuilder("[" + key + "]"); for (Object obj : arguments) { sb.append("[" + obj + "]"); } return sb.toString(); + } }