m_driver = new PostgresqlDriver();
m_schema = new CfbSchema(m_driver);
m_locale = locale;
- m_bundle = null;
m_config = new Config();
m_configFile = new File("config.properties");
m_output = null;
}
- CfbBundle getBundle() {
+ static CfbBundle getBundle(Locale locale) {
CfbBundle bundle = m_bundle;
if (null == bundle) {
synchronized(CFB.class) {
if (null == m_bundle) {
- m_bundle = bundle = CfbBundle.getInst(m_locale);
+ m_bundle = bundle = CfbBundle.getInst(locale);
}
}
}
}
String trans(String key) {
- return getBundle().get(key);
+ return getBundle(m_locale).get(key);
}
String getenv(String varName) {
Analysis prior = store.getPrior(analysis);
Delta delta = new Delta(prior, analysis);
- HtmlReport report = new HtmlReport(getBundle(), messageMap.getColl(), delta);
+ HtmlReport report = new HtmlReport(getBundle(m_locale), messageMap.getColl(), delta);
if (null != m_output) {
report.write(m_output);
}
- Notifier notifier = new Notifier(getBundle(), m_config);
+ Notifier notifier = new Notifier(getBundle(m_locale), m_config);
notifier.sendEmailIfNeeded(pw, report);
}
catch (StoreException exc) {
import net.jaekl.cfb.db.driver.DbDriver;
public class CFBMock extends CFB {
- private CfbBundleMock mock_bundle;
-
CFBMock(Locale locale, DbDriver driver)
{
super(locale);
m_driver = driver;
m_schema = new CfbSchema(m_driver);
- mock_bundle = new CfbBundleMock();
- }
-
- @Override
- CfbBundle getBundle()
- {
- return mock_bundle;
- }
+ m_bundle = new CfbBundleMock();
+ }
}