You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2018/12/24 09:02:54 UTC

svn commit: r1849675 - /ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java

Author: adityasharma
Date: Mon Dec 24 09:02:54 2018
New Revision: 1849675

URL: http://svn.apache.org/viewvc?rev=1849675&view=rev
Log:
Improved: Refactor boolean returns for UtilHttp methods
(OFBIZ-10726)
Improved boolean returns with single statement, replacing if blocks with explicit boolean return. Improves code in checkURLforSpiders().

Modified:
    ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java

Modified: ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java?rev=1849675&r1=1849674&r2=1849675&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilHttp.java Mon Dec 24 09:02:54 2018
@@ -1515,10 +1515,7 @@ public final class UtilHttp {
 
         String spiderRequest = (String) request.getAttribute("_REQUEST_FROM_SPIDER_");
         if (UtilValidate.isNotEmpty(spiderRequest)) {
-            if ("Y".equals(spiderRequest)) {
-                return true;
-            }
-            return false;
+            return "Y".equals(spiderRequest);
         }
         String initialUserAgent = request.getHeader("User-Agent") != null ? request.getHeader("User-Agent") : "";
         List<String> spiderList = StringUtil.split(UtilProperties.getPropertyValue("url", "link.remove_lsessionid.user_agent_list"), ",");