Author: jleroux
Date: Fri May 6 08:53:52 2011
New Revision: 1100138
URL:
http://svn.apache.org/viewvc?rev=1100138&view=revLog:
Fixes some other forgotten formatting issues in previous commit (r1100130). And Mostly removes an useless duplicated snippet
<<A patch from Philippe Mouawad "ResourceBundleMapWrapper memory usage improvement"
https://issues.apache.org/jira/browse/OFBIZ-4268Patch that creates the Map only when it is required>>
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java?rev=1100138&r1=1100137&r2=1100138&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/ResourceBundleMapWrapper.java Fri May 6 08:53:52 2011
@@ -191,13 +191,10 @@ public class ResourceBundleMapWrapper im
* @see java.util.Map#size()
*/
public int size() {
- if(isMapInitialized)
- {
+ if(isMapInitialized) {
// this is an approximate size, won't include elements from parent bundles
return topLevelMap.size() -1;
- }
- else
- {
+ } else {
return resourceBundle.keySet().size();
}
}
@@ -248,8 +245,7 @@ public class ResourceBundleMapWrapper im
*/
public Object get(Object arg0) {
Object value = null;
- if(isMapInitialized)
- {
+ if(isMapInitialized) {
value = this.topLevelMap.get(arg0);
}
@@ -261,13 +257,6 @@ public class ResourceBundleMapWrapper im
// do nothing, this will be handled by recognition that the value is still null
}
}
- if (value == null) {
- try {
- value = this.resourceBundle.getString((String) arg0);
- } catch (MissingResourceException mre) {
- // do nothing, this will be handled by recognition that the value is still null
- }
- }
}
/* we used to do this here, but now we'll do it in the top-level class since doing it here would prevent searching down the stack
if (value == null) {