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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user