Improved: General refactoring and code improvements, package
org.apache.ofbiz.widget.cache.
Thanks Dennis Balkir for reporting and providing the patch.
@@ -30,7 +30,9 @@ public class ScreenCache extends AbstractCache {
public GenericWidgetOutput get(String screenName, WidgetContextCacheKey wcck) {
UtilCache<WidgetContextCacheKey,GenericWidgetOutput> screenCache = getCache(screenName);
- if (screenCache == null) return null;
+ if (screenCache == null) {
+ return null;
+ }
return screenCache.get(wcck);
}
@@ -41,10 +43,16 @@ public class ScreenCache extends AbstractCache {
public GenericWidgetOutput remove(String screenName, WidgetContextCacheKey wcck) {
UtilCache<WidgetContextCacheKey,GenericWidgetOutput> screenCache = getCache(screenName);
- if (Debug.verboseOn()) Debug.logVerbose("Removing from ScreenCache with key [" + wcck + "], will remove from this cache: " + (screenCache == null ? "[No cache found to remove from]" : screenCache.getName()), module);
- if (screenCache == null) return null;
+ if (Debug.verboseOn()) {
+ Debug.logVerbose("Removing from ScreenCache with key [" + wcck + "], will remove from this cache: " + (screenCache == null ? "[No cache found to remove from]" : screenCache.getName()), module);
+ }
+ if (screenCache == null) {
+ return null;
+ }
GenericWidgetOutput retVal = screenCache.remove(wcck);
- if (Debug.verboseOn()) Debug.logVerbose("Removing from ScreenCache with key [" + wcck + "], found this in the cache: " + retVal, module);
+ if (Debug.verboseOn()) {
+ Debug.logVerbose("Removing from ScreenCache with key [" + wcck + "], found this in the cache: " + retVal, module);
+ }
return retVal;
}
}
