Improved: Remove redundant null checks (OFBIZ-10911)

Redundant null checks detected by Eclipse has been removed.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1857089 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mathieu Lirzin
2019-04-07 23:02:39 +00:00
parent f3a39e9665
commit d639aba7e7
30 changed files with 164 additions and 214 deletions
@@ -197,9 +197,7 @@ public final class ScriptUtil {
localContext.put("context", context);
ScriptContext scriptContext = new SimpleScriptContext();
ScriptHelper helper = new ScriptHelperImpl(scriptContext);
if (helper != null) {
localContext.put(SCRIPT_HELPER_KEY, helper);
}
localContext.put(SCRIPT_HELPER_KEY, helper);
Bindings bindings = new SimpleBindings(localContext);
scriptContext.setBindings(bindings, ScriptContext.ENGINE_SCOPE);
return scriptContext;
@@ -136,7 +136,6 @@ public final class UtilURL {
}
} catch (java.net.MalformedURLException e) {
Debug.logError(e, "unable to retrieve URL for file: " + filename, module);
url = null;
}
return url;
}
@@ -341,7 +341,7 @@ public final class FreeMarkerWorker {
@SuppressWarnings("unchecked")
public static <T> T unwrap(Object o) {
Object returnObj = null;
Object returnObj;
if (o == TemplateModel.NOTHING) {
returnObj = null;
@@ -349,6 +349,8 @@ public final class FreeMarkerWorker {
returnObj = o.toString();
} else if (o instanceof BeanModel) {
returnObj = ((BeanModel) o).getWrappedObject();
} else {
returnObj = null;
}
return (T) returnObj;