Map localizationPaths,
Collection resource_bundles,
int initCapacity)
{
this.initCapacity = initCapacity;
messages = new LightHashMap(initCapacity);
locale = main.getLocale();
// use a somewhat decent initial capacity, proper calculation would require java 1.6
addResourceMessages( main );
synchronized (localizationPaths)
{
for (Iterator iter = localizationPaths.keySet().iterator(); iter.hasNext();){
String localizationPath = (String) iter.next();
ClassLoader classLoader = (ClassLoader) localizationPaths.get(localizationPath);
addPluginBundle(localizationPath, classLoader);
}
}
if (resource_bundles != null) {
synchronized (resource_bundles)
{
for (Iterator itr = resource_bundles.iterator(); itr.hasNext();) {
addResourceMessages((ResourceBundle)itr.next());
}
}
}
used_messages = new LightHashMap( messages.size());
synchronized( bundle_map ){
bundle_map.put( this, NULL_OBJECT );