Improved: Refactor boolean returns for UtilHttp methods

(OFBIZ-10726)
Improves code in isJavaScriptEnabled()
Instead of using if-else block, a ternary operator is used for improving readability.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849738 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aditya Sharma
2018-12-26 04:56:33 +00:00
parent 958d72dbcf
commit 0abeb293a8
@@ -1551,10 +1551,7 @@ public final class UtilHttp {
public static boolean isJavaScriptEnabled(HttpServletRequest request) {
HttpSession session = request.getSession();
Boolean javaScriptEnabled = (Boolean) session.getAttribute("javaScriptEnabled");
if (javaScriptEnabled != null) {
return javaScriptEnabled;
}
return false;
return javaScriptEnabled != null ? javaScriptEnabled : false;
}
/** Returns the number or rows submitted by a multi form.