svn commit: r1812256 - in /ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content: ./ compdoc/ content/ data/ survey/ webapp/ftl/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1812256 - in /ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content: ./ compdoc/ content/ data/ survey/ webapp/ftl/

Deepak Dixit-5
Author: deepak
Date: Mon Oct 16 08:19:31 2017
New Revision: 1812256

URL: http://svn.apache.org/viewvc?rev=1812256&view=rev
Log:
Inconsistent String Comparisons, Applied patch for Application content classes.
Thanks Devanshu Vyas for your contribution (OFBIZ-9254)

Modified:
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/UploadContentAndImage.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/CheckPermissionTransform.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
    ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementEvents.java Mon Oct 16 08:19:31 2017
@@ -96,10 +96,10 @@ public class ContentManagementEvents {
                 try {
                     if (UtilValidate.isNotEmpty(paramValue)) {
                         if (!paramValue.equals(pubValue)) {
-                            if (paramValue.equalsIgnoreCase("Y")) {
+                            if ("Y".equalsIgnoreCase(paramValue)) {
                                 serviceIn.put("fromDate", UtilDateTime.nowTimestamp());
                                 dispatcher.runSync("createContentAssoc", serviceIn);
-                            } else if (paramValue.equalsIgnoreCase("N") && pubValue.equalsIgnoreCase("Y")) {
+                            } else if ("N".equalsIgnoreCase(paramValue) && "Y".equalsIgnoreCase(pubValue)) {
                                 serviceIn.put("thruDate", UtilDateTime.nowTimestamp());
                                 Timestamp fromDate = (Timestamp)map.get(pubContentId + "FromDate");
                                 serviceIn.put("fromDate", fromDate);
@@ -107,7 +107,7 @@ public class ContentManagementEvents {
                             }
                         }
                     } else if (UtilValidate.isNotEmpty(pubValue)) {
-                        if (pubValue.equalsIgnoreCase("Y")) {
+                        if ("Y".equalsIgnoreCase(pubValue)) {
                                 serviceIn.put("thruDate", UtilDateTime.nowTimestamp());
                                 Timestamp fromDate = (Timestamp)map.get(pubContentId + "FromDate");
                                 serviceIn.put("fromDate", fromDate);

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java Mon Oct 16 08:19:31 2017
@@ -447,7 +447,7 @@ public class ContentManagementServices {
               Debug.logInfo("updateSiteRoles, fromDate(1):" + fromDate, module);
           }
           serviceContext.put("roleTypeId", siteRole);
-          if (siteRoleVal != null && siteRoleVal.equalsIgnoreCase("Y")) {
+          if (siteRoleVal != null && "Y".equalsIgnoreCase(siteRoleVal)) {
               // for now, will assume that any error is due to duplicates - ignore
               if (fromDate == null) {
                   try {
@@ -508,7 +508,7 @@ public class ContentManagementServices {
           Map<String, Object> ctx = checkPermModel.makeValid(context, ModelService.IN_PARAM);
           Map<String, Object> thisResult = dispatcher.runSync("checkContentPermission", ctx);
           String permissionStatus = (String)thisResult.get("permissionStatus");
-          if (UtilValidate.isNotEmpty(permissionStatus) && permissionStatus.equalsIgnoreCase("granted")) {
+          if (UtilValidate.isNotEmpty(permissionStatus) && "granted".equalsIgnoreCase(permissionStatus)) {
               result = persistDataResourceAndDataMethod(dctx, context);
           }
           else {
@@ -578,7 +578,7 @@ public class ContentManagementServices {
       String mimeTypeId = (String) newDrContext.get("mimeTypeId");
       if (imageDataBytes != null && (mimeTypeId == null || (mimeTypeId.indexOf("image") >= 0) || (mimeTypeId.indexOf("application") >= 0))) {
           mimeTypeId = (String) context.get("_imageData_contentType");
-          if (dataResourceTypeId.equals("IMAGE_OBJECT")) {
+          if ("IMAGE_OBJECT".equals(dataResourceTypeId)) {
               String fileName = (String) context.get("_imageData_fileName");
               newDrContext.put("objectInfo", fileName);
           }
@@ -598,7 +598,7 @@ public class ContentManagementServices {
           dataResource = (GenericValue)thisResult.get("dataResource");
           Map<String, Object> fileContext = new HashMap<String, Object>();
           fileContext.put("userLogin", userLogin);
-          if (dataResourceTypeId.equals("IMAGE_OBJECT")) {
+          if ("IMAGE_OBJECT".equals(dataResourceTypeId)) {
               if (imageDataBytes != null) {
                   fileContext.put("dataResourceId", dataResourceId);
                   fileContext.put("imageData", imageDataBytes);
@@ -608,9 +608,9 @@ public class ContentManagementServices {
                       return ServiceUtil.returnError(errorMsg);
                   }
               }
-          } else if (dataResourceTypeId.equals("SHORT_TEXT")) {
-          } else if (dataResourceTypeId.startsWith("SURVEY")) {
-          } else if (dataResourceTypeId.indexOf("_FILE") >=0) {
+          } else if ("SHORT_TEXT".equals(dataResourceTypeId)) {
+          } else if ("SURVEY".startsWith(dataResourceTypeId)) {
+          } else if ("_FILE".indexOf(dataResourceTypeId) >=0) {
               Map<String, Object> uploadImage = new HashMap<String, Object>();
               uploadImage.put("userLogin", userLogin);
               uploadImage.put("dataResourceId", dataResourceId);
@@ -641,7 +641,7 @@ public class ContentManagementServices {
           Map<String, Object> fileContext = new HashMap<String, Object>();
           fileContext.put("userLogin", userLogin);
           String forceElectronicText = (String)context.get("forceElectronicText");
-          if (dataResourceTypeId.equals("IMAGE_OBJECT")) {
+          if ("IMAGE_OBJECT".equals(dataResourceTypeId)) {
               if (imageDataBytes != null || "true".equalsIgnoreCase(forceElectronicText)) {
                   fileContext.put("dataResourceId", dataResourceId);
                   fileContext.put("imageData", imageDataBytes);
@@ -651,9 +651,9 @@ public class ContentManagementServices {
                       return ServiceUtil.returnError(errorMsg);
                   }
               }
-          } else if (dataResourceTypeId.equals("SHORT_TEXT")) {
-          } else if (dataResourceTypeId.startsWith("SURVEY")) {
-          } else if (dataResourceTypeId.indexOf("_FILE") >=0) {
+          } else if ("SHORT_TEXT".equals(dataResourceTypeId)) {
+          } else if ("SURVEY".startsWith(dataResourceTypeId)) {
+          } else if ("_FILE".indexOf(dataResourceTypeId) >=0) {
               Map<String, Object> uploadImage = new HashMap<String, Object>();
               uploadImage.put("userLogin", userLogin);
               uploadImage.put("dataResourceId", dataResourceId);
@@ -718,7 +718,7 @@ public class ContentManagementServices {
             String siteRoleVal = (String)context.get(cappedSiteRole);
             Object fromDate = context.get(cappedSiteRole + "FromDate");
             serviceContext.put("roleTypeId", siteRole);
-            if (siteRoleVal != null && siteRoleVal.equalsIgnoreCase("Y")) {
+            if (siteRoleVal != null && "Y".equalsIgnoreCase(siteRoleVal)) {
                 // for now, will assume that any error is due to duplicates - ignore
                 if (fromDate == null) {
                     try {
@@ -775,7 +775,7 @@ public class ContentManagementServices {
             }
             pkFields.put(fieldName, fieldValue);
         }
-        boolean doLink = (action != null && action.equalsIgnoreCase("Y")) ? true : false;
+        boolean doLink = (action != null && "Y".equalsIgnoreCase(action)) ? true : false;
         if (Debug.infoOn()) {
             Debug.logInfo("in updateOrRemove, context:" + context, module);
         }
@@ -996,7 +996,7 @@ public class ContentManagementServices {
             thisContent.store();
             List<GenericValue> kids = ContentWorker.getAssociatedContent(thisContent, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
             for (GenericValue kidContent : kids) {
-                if (contentTypeId.equals("OUTLINE_NODE")) {
+                if ("OUTLINE_NODE".equals(contentTypeId)) {
                     updateOutlineNodeChildren(kidContent, false, context);
                 } else {
                     updatePageNodeChildren(kidContent, context);
@@ -1037,7 +1037,7 @@ public class ContentManagementServices {
             thisContent.store();
             List<GenericValue> kids = ContentWorker.getAssociatedContent(thisContent, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
             for (GenericValue kidContent : kids) {
-                if (contentTypeId.equals("OUTLINE_NODE")) {
+                if ("OUTLINE_NODE".equals(contentTypeId)) {
                     updateOutlineNodeChildren(kidContent, true, context);
                 } else {
                     kidContent.put("contentTypeId", "PAGE_NODE");
@@ -1130,20 +1130,20 @@ public class ContentManagementServices {
         Long branchCount = (Long)content.get("childBranchCount");
         if (forceOutline) {
             newContentTypeId = "OUTLINE_NODE";
-        } else if (contentTypeId == null || contentTypeId.equals("DOCUMENT")) {
+        } else if (contentTypeId == null || "DOCUMENT".equals(contentTypeId)) {
             if (UtilValidate.isEmpty(dataResourceId) || (branchCount != null && branchCount.intValue() > 0)) {
                 newContentTypeId = "OUTLINE_NODE";
             } else {
                 newContentTypeId = "PAGE_NODE";
             }
-        } else if (contentTypeId.equals("SUBPAGE_NODE")) {
+        } else if ("SUBPAGE_NODE".equals(contentTypeId)) {
             newContentTypeId = "PAGE_NODE";
         }
 
         content.put("contentTypeId", newContentTypeId);
         content.store();
 
-        if (contentTypeId == null || contentTypeId.equals("DOCUMENT") || contentTypeId.equals("OUTLINE_NODE")) {
+        if (contentTypeId == null || "DOCUMENT".equals(contentTypeId) || "OUTLINE_NODE".equals(contentTypeId)) {
             List<GenericValue> kids = ContentWorker.getAssociatedContent(content, "from", UtilMisc.toList("SUB_CONTENT"), null, null, null);
             for (GenericValue kidContent : kids) {
                 updateOutlineNodeChildren(kidContent, forceOutline, context);

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementWorker.java Mon Oct 16 08:19:31 2017
@@ -300,7 +300,7 @@ public final class ContentManagementWork
             Map<String, Object> results = null;
             results = EntityPermissionChecker.checkPermission(content, statusId, userLogin, passedPurposes, targetOperationList, roles, delegator, security, entityAction);
             String permissionStatus = (String)results.get("permissionStatus");
-            if (permissionStatus != null && permissionStatus.equalsIgnoreCase("granted")) {
+            if (permissionStatus != null && "granted".equalsIgnoreCase(permissionStatus)) {
                 String [] arr = {contentId,templateTitle};
                 permittedPublishPointList.add(arr);
             }
@@ -571,7 +571,7 @@ public final class ContentManagementWork
             Map<String, Object> results = null;
             results = EntityPermissionChecker.checkPermission(content, statusId, userLogin, passedPurposes, targetOperationList, roles, delegator, security, entityAction);
             String permissionStatus = (String)results.get("permissionStatus");
-            if (permissionStatus != null && permissionStatus.equalsIgnoreCase("granted")) {
+            if (permissionStatus != null && "granted".equalsIgnoreCase(permissionStatus)) {
                 String [] arr = {contentId,contentName};
                 permittedDepartmentPointList.add(arr);
             }

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/compdoc/CompDocServices.java Mon Oct 16 08:19:31 2017
@@ -165,17 +165,17 @@ public class CompDocServices {
                 }
                 byte [] inputByteArray = null;
                 PdfReader reader = null;
-                if (inputMimeType != null && inputMimeType.equals("application/pdf")) {
+                if (inputMimeType != null && "application/pdf".equals(inputMimeType)) {
                     ByteBuffer byteBuffer = DataResourceWorker.getContentAsByteBuffer(delegator, thisDataResourceId, https, webSiteId, locale, rootDir);
                     inputByteArray = byteBuffer.array();
                     reader = new PdfReader(inputByteArray);
-                } else if (inputMimeType != null && inputMimeType.equals("text/html")) {
+                } else if (inputMimeType != null && "text/html".equals(inputMimeType)) {
                     ByteBuffer byteBuffer = DataResourceWorker.getContentAsByteBuffer(delegator, thisDataResourceId, https, webSiteId, locale, rootDir);
                     inputByteArray = byteBuffer.array();
                     String s = new String(inputByteArray);
                     Debug.logInfo("text/html string:" + s, module);
                     continue;
-                } else if (inputMimeType != null && inputMimeType.equals("application/vnd.ofbiz.survey.response")) {
+                } else if (inputMimeType != null && "application/vnd.ofbiz.survey.response".equals(inputMimeType)) {
                     String surveyResponseId = dataResource.getString("relatedDetailId");
                     String surveyId = null;
                     String acroFormContentId = null;
@@ -290,15 +290,15 @@ public class CompDocServices {
                 inputMimeType = dataResource.getString("mimeTypeId");
             }
             byte [] inputByteArray = null;
-            if (inputMimeType != null && inputMimeType.equals("application/pdf")) {
+            if (inputMimeType != null && "application/pdf".equals(inputMimeType)) {
                 ByteBuffer byteBuffer = DataResourceWorker.getContentAsByteBuffer(delegator, dataResourceId, https, webSiteId, locale, rootDir);
                 inputByteArray = byteBuffer.array();
-            } else if (inputMimeType != null && inputMimeType.equals("text/html")) {
+            } else if (inputMimeType != null && "text/html".equals(inputMimeType)) {
                 ByteBuffer byteBuffer = DataResourceWorker.getContentAsByteBuffer(delegator, dataResourceId, https, webSiteId, locale, rootDir);
                 inputByteArray = byteBuffer.array();
                 String s = new String(inputByteArray);
                 Debug.logInfo("text/html string:" + s, module);
-            } else if (inputMimeType != null && inputMimeType.equals("application/vnd.ofbiz.survey.response")) {
+            } else if (inputMimeType != null && "application/vnd.ofbiz.survey.response".equals(inputMimeType)) {
                 String surveyResponseId = dataResource.getString("relatedDetailId");
                 String surveyId = null;
                 String acroFormContentId = null;

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentPermissionServices.java Mon Oct 16 08:19:31 2017
@@ -219,8 +219,8 @@ public class ContentPermissionServices {
             errBuf.append(permissionStatus);
         }
 
-        if ((permissionStatus.equals("granted") && displayPassCond)
-            || (permissionStatus.equals("rejected") && displayFailCond)) {
+        if (("granted".equals(permissionStatus) && displayPassCond)
+            || ("rejected".equals(permissionStatus) && displayFailCond)) {
             // Don't show this if passed on 'hasEntityPermission'
             if (displayFailCond || displayPassCond) {
               if (!passed) {
@@ -299,7 +299,7 @@ public class ContentPermissionServices {
             Debug.logError(e, "Problem checking permissions", "ContentServices");
         }
         permissionStatus = (String)permResults.get("permissionStatus");
-        if (permissionStatus == null || !permissionStatus.equals("granted")) {
+        if (permissionStatus == null || !"granted".equals(permissionStatus)) {
             if (bDisplayFailCond != null && bDisplayFailCond.booleanValue()) {
                 String errMsg = (String)permResults.get(ModelService.ERROR_MESSAGE);
                 results.put(ModelService.ERROR_MESSAGE, errMsg);
@@ -315,7 +315,7 @@ public class ContentPermissionServices {
             Debug.logError(e, "Problem checking permissions", "ContentServices");
         }
         permissionStatus = (String)permResults.get("permissionStatus");
-        if (permissionStatus != null && permissionStatus.equals("granted")) {
+        if (permissionStatus != null && "granted".equals(permissionStatus)) {
             results.put("permissionStatus", "granted");
         } else {
             if (bDisplayFailCond != null && bDisplayFailCond.booleanValue()) {

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentSearchSession.java Mon Oct 16 08:19:31 2017
@@ -222,7 +222,7 @@ public class ContentSearchSession {
         String sortAscending = (String) parameters.get("sortAscending");
         boolean ascending = !"N".equals(sortAscending);
         if (sortOrder != null) {
-            if (sortOrder.equals("SortKeywordRelevancy")) {
+            if ("SortKeywordRelevancy".equals(sortOrder)) {
                 searchSetSortOrder(new ContentSearch.SortKeywordRelevancy(), session);
             } else if (sortOrder.startsWith("SortContentField:")) {
                 String fieldName = sortOrder.substring("SortContentField:".length());

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServices.java Mon Oct 16 08:19:31 2017
@@ -111,7 +111,7 @@ public class ContentServices {
             }
 
             String permissionStatus = (String) permResults.get("permissionStatus");
-            if (permissionStatus != null && permissionStatus.equalsIgnoreCase("granted")) {
+            if (permissionStatus != null && "granted".equalsIgnoreCase(permissionStatus)) {
                 permittedList.add(content);
             }
 
@@ -173,7 +173,7 @@ public class ContentServices {
 
         String contentId = (String) context.get("contentId");
         String direction = (String) context.get("direction");
-        if (direction != null && direction.equalsIgnoreCase("From")) {
+        if (direction != null && "From".equalsIgnoreCase(direction)) {
             direction = "From";
         } else {
             direction = "To";
@@ -286,7 +286,7 @@ public class ContentServices {
 
         Map<String, Object> permResults = ContentWorker.callContentPermissionCheckResult(delegator, dispatcher, context);
         String permissionStatus = (String) permResults.get("permissionStatus");
-        if (permissionStatus != null && permissionStatus.equalsIgnoreCase("granted")) {
+        if (permissionStatus != null && "granted".equalsIgnoreCase(permissionStatus)) {
             try {
                 content.create();
             } catch (GenericEntityException e) {
@@ -444,7 +444,7 @@ public class ContentServices {
         permResults = dispatcher.runSync("checkAssocPermission", serviceInMap);
         permissionStatus = (String) permResults.get("permissionStatus");
 
-        if (permissionStatus != null && permissionStatus.equals("granted")) {
+        if (permissionStatus != null && "granted".equals(permissionStatus)) {
             contentAssoc.create();
         } else {
             String errorMsg = (String)permResults.get(ModelService.ERROR_MESSAGE);
@@ -508,7 +508,7 @@ public class ContentServices {
 
         Map<String, Object> permResults = ContentWorker.callContentPermissionCheckResult(delegator, dispatcher, context);
         String permissionStatus = (String) permResults.get("permissionStatus");
-        if (permissionStatus != null && permissionStatus.equalsIgnoreCase("granted")) {
+        if (permissionStatus != null && "granted".equalsIgnoreCase(permissionStatus)) {
             GenericValue userLogin = (GenericValue) context.get("userLogin");
             String userLoginId = (String) userLogin.get("userLoginId");
             String lastModifiedByUserLogin = userLoginId;
@@ -641,7 +641,7 @@ public class ContentServices {
         }
         permissionStatus = (String) permResults.get("permissionStatus");
 
-        if (permissionStatus != null && permissionStatus.equals("granted")) {
+        if (permissionStatus != null && "granted".equals(permissionStatus)) {
             try {
                 contentAssoc.store();
             } catch (GenericEntityException e) {
@@ -732,7 +732,7 @@ public class ContentServices {
         }
         permissionStatus = (String) permResults.get("permissionStatus");
 
-        if (permissionStatus != null && permissionStatus.equals("granted")) {
+        if (permissionStatus != null && "granted".equals(permissionStatus)) {
             try {
                 contentAssoc.store();
             } catch (GenericEntityException e) {
@@ -934,7 +934,7 @@ public class ContentServices {
             if (contentAssocViewFrom != null)
                 isPublished = true;
             if (Debug.infoOn()) Debug.logInfo("in publishContent, contentId:" + contentId + " contentIdTo:" + contentIdTo + " contentAssocTypeId:" + contentAssocTypeId + " publish:" + publish + " isPublished:" + isPublished, module);
-            if (UtilValidate.isNotEmpty(publish) && publish.equalsIgnoreCase("Y")) {
+            if (UtilValidate.isNotEmpty(publish) && "Y".equalsIgnoreCase(publish)) {
                 GenericValue content = EntityQuery.use(delegator).from("Content").where("contentId", contentId).queryOne();
                 String contentStatusId = (String) content.get("statusId");
                 String contentPrivilegeEnumId = (String) content.get("privilegeEnumId");

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentServicesComplex.java Mon Oct 16 08:19:31 2017
@@ -86,7 +86,7 @@ public class ContentServicesComplex {
             EntityExpr mapKeyExpr = EntityCondition.makeCondition("caMapKey", EntityOperator.EQUALS, mapKey);
             exprList.add(mapKeyExpr);
         }
-        if (direction != null && direction.equalsIgnoreCase("From")) {
+        if (direction != null && "From".equalsIgnoreCase(direction)) {
             joinExpr = EntityCondition.makeCondition("caContentIdTo", EntityOperator.EQUALS, contentId);
             viewName = "ContentAssocDataResourceViewFrom";
         } else {
@@ -198,14 +198,14 @@ public class ContentServicesComplex {
         EntityExpr joinExpr = null;
         String viewName = null;
         String contentFieldName = null;
-        if (direction != null && direction.equalsIgnoreCase("From")) {
+        if (direction != null && "From".equalsIgnoreCase(direction)) {
             contentFieldName = "caContentIdTo";
             joinExpr = EntityCondition.makeCondition("caContentIdTo", EntityOperator.EQUALS, contentId);
         } else {
             contentFieldName = "caContentId";
             joinExpr = EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, contentId);
         }
-        if (direction != null && direction.equalsIgnoreCase("From")) {
+        if (direction != null && "From".equalsIgnoreCase(direction)) {
             viewName = "ContentAssocDataResourceViewFrom";
         } else {
             viewName = "ContentAssocDataResourceViewTo";
@@ -236,7 +236,7 @@ public class ContentServicesComplex {
                 .where(conditionList).orderBy("caSequenceNum", "-caFromDate").cache().queryList();
 
         String assocRelationName = null;
-        if (direction != null && direction.equalsIgnoreCase("To")) {
+        if (direction != null && "To".equalsIgnoreCase(direction)) {
             assocRelationName = "ToContent";
         } else {
             assocRelationName = "FromContent";

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java Mon Oct 16 08:19:31 2017
@@ -538,7 +538,7 @@ public class ContentWorker implements or
                     String assocRelation = null;
                     // This needs to be the opposite
                     String relatedDirection = null;
-                    if (direction != null && direction.equalsIgnoreCase("From")) {
+                    if (direction != null && "From".equalsIgnoreCase(direction)) {
                         assocContext.put("contentIdFrom", assocValue.get("contentId"));
                         assocRelation = "ToContent";
                         relatedDirection = "From";
@@ -668,7 +668,7 @@ public class ContentWorker implements or
             for (int i = 0; i < sectionValueList.size(); i++) {
                 GenericValue sectionValue = sectionValueList.get(i);
                 String contentAssocPredicateId = (String)sectionValue.get("contentAssocPredicateId");
-                if (contentAssocPredicateId != null && contentAssocPredicateId.equals("categorizes")) {
+                if (contentAssocPredicateId != null && "categorizes".equals(contentAssocPredicateId)) {
                     sections.add(sectionValue.get("contentIdTo"));
                 }
             }
@@ -685,7 +685,7 @@ public class ContentWorker implements or
             for (int i = 0; i < topicValueList.size(); i++) {
                 GenericValue topicValue = topicValueList.get(i);
                 String contentAssocPredicateId = (String)topicValue.get("contentAssocPredicateId");
-                if (contentAssocPredicateId != null && contentAssocPredicateId.equals("topifies"))
+                if (contentAssocPredicateId != null && "topifies".equals(contentAssocPredicateId))
                     topics.add(topicValue.get("contentIdTo"));
             }
         } catch (GenericEntityException e) {
@@ -781,7 +781,7 @@ public class ContentWorker implements or
 
         List<GenericValue> contentList = new LinkedList<GenericValue>();
         String contentIdName = "contentId";
-        if (linkDir != null && linkDir.equalsIgnoreCase("TO")) {
+        if (linkDir != null && "TO".equalsIgnoreCase(linkDir)) {
             contentIdName = contentIdName.concat("To");
         }
         GenericValue content = null;
@@ -811,7 +811,7 @@ public class ContentWorker implements or
         String origContentId = (String) currentContent.get("contentId");
         String contentIdName = "contentId";
         String contentAssocViewName = "contentAssocView";
-        if (linkDir != null && linkDir.equalsIgnoreCase("TO")) {
+        if (linkDir != null && "TO".equalsIgnoreCase(linkDir)) {
             contentIdName = contentIdName.concat("To");
             contentAssocViewName = contentAssocViewName.concat("To");
         }
@@ -858,7 +858,7 @@ public class ContentWorker implements or
     public static List<GenericValue> getContentAssocsWithId(Delegator delegator, String contentId, Timestamp fromDate, Timestamp thruDate, String direction, List<String> assocTypes) throws GenericEntityException {
         List<EntityCondition> exprList = new LinkedList<EntityCondition>();
         EntityExpr joinExpr = null;
-        if (direction != null && direction.equalsIgnoreCase("From")) {
+        if (direction != null && "From".equalsIgnoreCase(direction)) {
             joinExpr = EntityCondition.makeCondition("contentIdTo", EntityOperator.EQUALS, contentId);
         } else {
             joinExpr = EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, contentId);
@@ -911,7 +911,7 @@ public class ContentWorker implements or
     public static void getContentAncestry(Delegator delegator, String contentId, String contentAssocTypeId, String direction, List<GenericValue> contentAncestorList) throws GenericEntityException {
         String contentIdField = null;
         String contentIdOtherField = null;
-        if (direction != null && direction.equalsIgnoreCase("to")) {
+        if (direction != null && "to".equalsIgnoreCase(direction)) {
             contentIdField = "contentId";
             contentIdOtherField = "contentIdTo";
         } else {
@@ -944,7 +944,7 @@ public class ContentWorker implements or
     public static void getContentAncestryAll(Delegator delegator, String contentId, String passedContentTypeId, String direction, List<String> contentAncestorList) {
         String contentIdField = null;
         String contentIdOtherField = null;
-        if (direction != null && direction.equalsIgnoreCase("to")) {
+        if (direction != null && "to".equalsIgnoreCase(direction)) {
             contentIdField = "contentId";
             contentIdOtherField = "contentIdTo";
         } else {
@@ -997,7 +997,7 @@ public class ContentWorker implements or
     public static void getContentAncestryValues(Delegator delegator, String contentId, String contentAssocTypeId, String direction, List<GenericValue> contentAncestorList) throws GenericEntityException {
         String contentIdField = null;
         String contentIdOtherField = null;
-        if (direction != null && direction.equalsIgnoreCase("to")) {
+        if (direction != null && "to".equalsIgnoreCase(direction)) {
             contentIdField = "contentId";
             contentIdOtherField = "contentIdTo";
         } else {
@@ -1209,7 +1209,7 @@ public class ContentWorker implements or
         ctx.put("contentAssocTypeId", contentAssocTypeId);
         ctx.put("contentId", assocContentId);
         // This needs to be the opposite
-        if (direction != null && direction.equalsIgnoreCase("From")) {
+        if (direction != null && "From".equalsIgnoreCase(direction)) {
             ctx.put("contentIdFrom", assocContentId);
         } else {
             ctx.put("contentIdTo", assocContentId);

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/UploadContentAndImage.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/UploadContentAndImage.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/UploadContentAndImage.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/content/UploadContentAndImage.java Mon Oct 16 08:19:31 2017
@@ -103,7 +103,7 @@ public class UploadContentAndImage {
                 if (fi.isFormField()) {
                     String fieldStr = fi.getString();
                     passedParams.put(fieldName, fieldStr);
-                } else if (fieldName.equals("imageData")) {
+                } else if ("imageData".equals(fieldName)) {
                     imageFi = fi;
                     imageBytes = imageFi.get();
                 }
@@ -162,7 +162,7 @@ public class UploadContentAndImage {
                     map.put("contentIdTo", ftlContentId);
                     map.put("contentId", contentIdTo);
                     map.put("contentAssocTypeId", "PUBLISH_RELEASE");
-                } else if (contentAssocTypeId.equals("PUBLISH_LINK")) {
+                } else if ("PUBLISH_LINK".equals(contentAssocTypeId)) {
                     map.put("contentAssocTypeId", "PUBLISH_LINK");
                     String publishOperation = (String)passedParams.get("publishOperation");
                     if (UtilValidate.isEmpty(publishOperation)) {
@@ -387,7 +387,7 @@ public class UploadContentAndImage {
                    suffix = "";
                 }
                 String returnMsg = processContentUpload(passedParams, suffix, request);
-                if (returnMsg.equals("error")) {
+                if ("error".equals(returnMsg)) {
                     try {
                         TransactionUtil.rollback();
                     } catch (GenericTransactionException e2) {

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataEvents.java Mon Oct 16 08:19:31 2017
@@ -326,7 +326,7 @@ public class DataEvents {
         String mode = (String)paramMap.get("mode");
         Locale locale = UtilHttp.getLocale(request);
 
-        if (mode != null && mode.equals("UPDATE")) {
+        if (mode != null && "UPDATE".equals(mode)) {
             try {
                 result = dispatcher.runSync("updateDataResource", serviceInMap);
             } catch (GenericServiceException e) {
@@ -352,13 +352,13 @@ public class DataEvents {
         }
 
         String returnStr = "success";
-        if (mode.equals("CREATE")) {
+        if ("CREATE".equals(mode)) {
             // Set up return message to guide selection of follow on view
             request.setAttribute("dataResourceId", result.get("dataResourceId"));
             String dataResourceTypeId = (String)serviceInMap.get("dataResourceTypeId");
             if (dataResourceTypeId != null) {
-                 if (dataResourceTypeId.equals("ELECTRONIC_TEXT")
-                     || dataResourceTypeId.equals("IMAGE_OBJECT")) {
+                 if ("ELECTRONIC_TEXT".equals(dataResourceTypeId)
+                     || "IMAGE_OBJECT".equals(dataResourceTypeId)) {
                     returnStr = dataResourceTypeId;
                  }
             }

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataResourceWorker.java Mon Oct 16 08:19:31 2017
@@ -147,7 +147,7 @@ public class DataResourceWorker  impleme
         // The other test is to only get all the children if the "leaf" node where all the
         // children of the leaf are wanted for expansion.
         if (parentCategoryId == null
-            || parentCategoryId.equals("ROOT")
+            || "ROOT".equals(parentCategoryId)
             || (currentDataCategoryId != null && currentDataCategoryId.equals(parentCategoryId))
             || getAll) {
             categoryNode.put("kids", subCategoryIds);
@@ -182,7 +182,7 @@ public class DataResourceWorker  impleme
         Map<String, Object> map = new HashMap<String, Object>();
         map.put("dataCategoryId", id);
         map.put("categoryName", spc + nm);
-        if (id != null && !id.equals("ROOT") && !id.equals("")) {
+        if (id != null && !"ROOT".equals(id) && !id.equals("")) {
             lst.add(map);
         }
         List<Map<String, Object>> kids = UtilGenerics.checkList(nd.get("kids"));
@@ -246,7 +246,7 @@ public class DataResourceWorker  impleme
                 passedParams.put("drMimeTypeId", mimeType);
                 try {
                     String returnMsg = UploadContentAndImage.processContentUpload(passedParams, "", request);
-                    if (returnMsg.equals("error")) {
+                    if ("error".equals(returnMsg)) {
                         return "error";
                     }
                 } catch (GenericServiceException e) {
@@ -272,7 +272,7 @@ public class DataResourceWorker  impleme
 
         String suffix = imageFileName.substring(pos + 1);
         String suffixLC = suffix.toLowerCase();
-        if (suffixLC.equals("jpg"))
+        if ("jpg".equals(suffixLC))
             mimeType = "image/jpeg";
         else
             mimeType = "image/" + suffixLC;
@@ -398,13 +398,13 @@ public class DataResourceWorker  impleme
         String prefix;
 
         NotificationServices.setBaseUrl(delegator, webSiteId, prefixValues);
-        if (https != null && https.equalsIgnoreCase("true")) {
+        if (https != null && "true".equalsIgnoreCase(https)) {
             prefix = (String) prefixValues.get("baseSecureUrl");
         } else {
             prefix = (String) prefixValues.get("baseUrl");
         }
         if (UtilValidate.isEmpty(prefix)) {
-            if (https != null && https.equalsIgnoreCase("true")) {
+            if (https != null && "true".equalsIgnoreCase(https)) {
                 prefix = UtilProperties.getMessage("content", "baseSecureUrl", locale);
             } else {
                 prefix = UtilProperties.getMessage("content", "baseUrl", locale);
@@ -417,7 +417,7 @@ public class DataResourceWorker  impleme
     public static File getContentFile(String dataResourceTypeId, String objectInfo, String contextRoot)  throws GeneralException, FileNotFoundException{
         File file = null;
 
-        if (dataResourceTypeId.equals("LOCAL_FILE") || dataResourceTypeId.equals("LOCAL_FILE_BIN")) {
+        if ("LOCAL_FILE".equals(dataResourceTypeId) || "LOCAL_FILE_BIN".equals(dataResourceTypeId)) {
             file = FileUtil.getFile(objectInfo);
             if (!file.exists()) {
                 throw new FileNotFoundException("No file found: " + (objectInfo));
@@ -425,7 +425,7 @@ public class DataResourceWorker  impleme
             if (!file.isAbsolute()) {
                 throw new GeneralException("File (" + objectInfo + ") is not absolute");
             }
-        } else if (dataResourceTypeId.equals("OFBIZ_FILE") || dataResourceTypeId.equals("OFBIZ_FILE_BIN")) {
+        } else if ("OFBIZ_FILE".equals(dataResourceTypeId) || "OFBIZ_FILE_BIN".equals(dataResourceTypeId)) {
             String prefix = System.getProperty("ofbiz.home");
 
             String sep = "";
@@ -436,7 +436,7 @@ public class DataResourceWorker  impleme
             if (!file.exists()) {
                 throw new FileNotFoundException("No file found: " + (prefix + sep + objectInfo));
             }
-        } else if (dataResourceTypeId.equals("CONTEXT_FILE") || dataResourceTypeId.equals("CONTEXT_FILE_BIN")) {
+        } else if ("CONTEXT_FILE".equals(dataResourceTypeId) || "CONTEXT_FILE_BIN".equals(dataResourceTypeId)) {
             if (UtilValidate.isEmpty(contextRoot)) {
                 throw new GeneralException("Cannot find CONTEXT_FILE with an empty context root!");
             }
@@ -854,7 +854,7 @@ public class DataResourceWorker  impleme
             writeText(dataResource, text, templateContext, mimeTypeId, locale, out);
 
         // resource type
-        } else if (dataResourceTypeId.equals("URL_RESOURCE")) {
+        } else if ("URL_RESOURCE".equals(dataResourceTypeId)) {
             String text = null;
             URL url = FlexibleLocation.resolveLocation(dataResource.getString("objectInfo"));
 
@@ -955,14 +955,14 @@ public class DataResourceWorker  impleme
     public static void renderFile(String dataResourceTypeId, String objectInfo, String rootDir, Appendable out) throws GeneralException, IOException {
         // TODO: this method assumes the file is a text file, if it is an image we should respond differently, see the comment above for IMAGE_OBJECT type data resource
 
-        if (dataResourceTypeId.equals("LOCAL_FILE") && UtilValidate.isNotEmpty(objectInfo)) {
+        if ("LOCAL_FILE".equals(dataResourceTypeId) && UtilValidate.isNotEmpty(objectInfo)) {
             File file = FileUtil.getFile(objectInfo);
             if (!file.isAbsolute()) {
                 throw new GeneralException("File (" + objectInfo + ") is not absolute");
             }
             FileReader in = new FileReader(file);
             UtilIO.copy(in, true, out);
-        } else if (dataResourceTypeId.equals("OFBIZ_FILE") && UtilValidate.isNotEmpty(objectInfo)) {
+        } else if ("OFBIZ_FILE".equals(dataResourceTypeId) && UtilValidate.isNotEmpty(objectInfo)) {
             String prefix = System.getProperty("ofbiz.home");
             String sep = "";
             if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) {
@@ -971,7 +971,7 @@ public class DataResourceWorker  impleme
             File file = FileUtil.getFile(prefix + sep + objectInfo);
             FileReader in = new FileReader(file);
             UtilIO.copy(in, true, out);
-        } else if (dataResourceTypeId.equals("CONTEXT_FILE") && UtilValidate.isNotEmpty(objectInfo)) {
+        } else if ("CONTEXT_FILE".equals(dataResourceTypeId) && UtilValidate.isNotEmpty(objectInfo)) {
             String prefix = rootDir;
             String sep = "";
             if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) {

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java Mon Oct 16 08:19:31 2017
@@ -85,7 +85,7 @@ public class DataServices {
         context.put("dataResourceId", thisResult.get("dataResourceId"));
 
         String dataResourceTypeId = (String) context.get("dataResourceTypeId");
-        if (dataResourceTypeId != null && dataResourceTypeId.equals("ELECTRONIC_TEXT")) {
+        if (dataResourceTypeId != null && "ELECTRONIC_TEXT".equals(dataResourceTypeId)) {
             thisResult = createElectronicText(dctx, context);
             if (thisResult.get(ModelService.RESPONSE_MESSAGE) != null) {
                 return ServiceUtil.returnError((String) thisResult.get(ModelService.ERROR_MESSAGE));
@@ -216,18 +216,18 @@ public class DataServices {
         if (UtilValidate.isEmpty(objectInfo)) {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableObtainReferenceToFile", UtilMisc.toMap("objectInfo", ""), locale));
         }
-        if (UtilValidate.isEmpty(dataResourceTypeId) || dataResourceTypeId.equals("LOCAL_FILE") || dataResourceTypeId.equals("LOCAL_FILE_BIN")) {
+        if (UtilValidate.isEmpty(dataResourceTypeId) || "LOCAL_FILE".equals(dataResourceTypeId) || "LOCAL_FILE_BIN".equals(dataResourceTypeId)) {
             file = new File(objectInfo);
             if (!file.isAbsolute()) {
                 return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentLocalFileDoesNotPointToAbsoluteLocation", locale));
             }
-        } else if (dataResourceTypeId.equals("OFBIZ_FILE") || dataResourceTypeId.equals("OFBIZ_FILE_BIN")) {
+        } else if ("OFBIZ_FILE".equals(dataResourceTypeId) || "OFBIZ_FILE_BIN".equals(dataResourceTypeId)) {
             prefix = System.getProperty("ofbiz.home");
             if (objectInfo.indexOf("/") != 0 && prefix.lastIndexOf("/") != (prefix.length() - 1)) {
                 sep = "/";
             }
             file = new File(prefix + sep + objectInfo);
-        } else if (dataResourceTypeId.equals("CONTEXT_FILE") || dataResourceTypeId.equals("CONTEXT_FILE_BIN")) {
+        } else if ("CONTEXT_FILE".equals(dataResourceTypeId) || "CONTEXT_FILE_BIN".equals(dataResourceTypeId)) {
             prefix = (String) context.get("rootDir");
             if (UtilValidate.isEmpty(prefix)) {
                 return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentCannotFindContextFileWithEmptyContextRoot", locale));
@@ -280,7 +280,7 @@ public class DataServices {
             return ServiceUtil.returnError((String) thisResult.get(ModelService.ERROR_MESSAGE));
         }
         String dataResourceTypeId = (String) context.get("dataResourceTypeId");
-        if (dataResourceTypeId != null && dataResourceTypeId.equals("ELECTRONIC_TEXT")) {
+        if (dataResourceTypeId != null && "ELECTRONIC_TEXT".equals(dataResourceTypeId)) {
             thisResult = updateElectronicText(dctx, context);
             if (thisResult.get(ModelService.RESPONSE_MESSAGE) != null) {
                 return ServiceUtil.returnError((String) thisResult.get(ModelService.ERROR_MESSAGE));

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/survey/PdfSurveyServices.java Mon Oct 16 08:19:31 2017
@@ -267,7 +267,7 @@ public class PdfSurveyServices {
                 String surveyQuestionId = (String)surveyQuestionAndAppl.get("surveyQuestionId");
                 String surveyQuestionTypeId = (String)surveyQuestionAndAppl.get("surveyQuestionTypeId");
                 GenericValue surveyResponseAnswer = delegator.makeValue("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId, "surveyQuestionId", surveyQuestionId));
-                if (surveyQuestionTypeId ==null || surveyQuestionTypeId.equals("TEXT_SHORT")) {
+                if (surveyQuestionTypeId ==null || "TEXT_SHORT".equals(surveyQuestionTypeId)) {
                     surveyResponseAnswer.set("textResponse", value);
                 }
 

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/CheckPermissionTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/CheckPermissionTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/CheckPermissionTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/CheckPermissionTransform.java Mon Oct 16 08:19:31 2017
@@ -114,7 +114,7 @@ public class CheckPermissionTransform im
                 GenericValue currentContent = null;
                 String contentAssocPredicateId = (String)templateCtx.get("contentAssocPredicateId");
                 String strNullThruDatesOnly = (String)templateCtx.get("nullThruDatesOnly");
-                Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && strNullThruDatesOnly.equalsIgnoreCase("true")) ? Boolean.TRUE : Boolean.FALSE;
+                Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && "true".equalsIgnoreCase(strNullThruDatesOnly)) ? Boolean.TRUE : Boolean.FALSE;
                 GenericValue val = null;
                 try {
                     val = ContentWorker.getCurrentContent(delegator, trail, userLogin, templateCtx, nullThruDatesOnly, contentAssocPredicateId);
@@ -167,7 +167,7 @@ public class CheckPermissionTransform im
 
                 String permissionStatus = (String) results.get("permissionStatus");
 
-                if (UtilValidate.isEmpty(permissionStatus) || !permissionStatus.equals("granted")) {
+                if (UtilValidate.isEmpty(permissionStatus) || !"granted".equals(permissionStatus)) {
                     String errorMessage = "Permission to add response is denied (2)";
                     PermissionRecorder recorder = (PermissionRecorder)results.get("permissionRecorder");
                     if (recorder != null) {
@@ -177,14 +177,14 @@ public class CheckPermissionTransform im
                     templateCtx.put("permissionErrorMsg", errorMessage);
                 }
 
-                if (permissionStatus != null && permissionStatus.equalsIgnoreCase("granted")) {
+                if (permissionStatus != null && "granted".equalsIgnoreCase(permissionStatus)) {
                     FreeMarkerWorker.saveContextValues(templateCtx, saveKeyNames, savedValues);
-                    if (mode == null || !mode.equalsIgnoreCase("not-equals"))
+                    if (mode == null || !"not-equals".equalsIgnoreCase(mode))
                         return TransformControl.EVALUATE_BODY;
                     else
                         return TransformControl.SKIP_BODY;
                 } else {
-                    if (mode == null || !mode.equalsIgnoreCase("not-equals"))
+                    if (mode == null || !"not-equals".equalsIgnoreCase(mode))
                         return TransformControl.SKIP_BODY;
                     else
                         return TransformControl.EVALUATE_BODY;

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentCacheTransform.java Mon Oct 16 08:19:31 2017
@@ -90,7 +90,7 @@ public class EditRenderSubContentCacheTr
         List<Map<String, ? extends Object>> trail = UtilGenerics.checkList(templateCtx.get("globalNodeTrail"));
         String contentAssocPredicateId = (String)templateCtx.get("contentAssocPredicateId");
         String strNullThruDatesOnly = (String)templateCtx.get("nullThruDatesOnly");
-        Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && strNullThruDatesOnly.equalsIgnoreCase("true")) ? Boolean.TRUE :Boolean.FALSE;
+        Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && "true".equalsIgnoreCase(strNullThruDatesOnly)) ? Boolean.TRUE :Boolean.FALSE;
         GenericValue val = null;
         try {
             val = ContentWorker.getCurrentContent(delegator, trail, userLogin, templateCtx, nullThruDatesOnly, contentAssocPredicateId);

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/EditRenderSubContentTransform.java Mon Oct 16 08:19:31 2017
@@ -175,7 +175,7 @@ public class EditRenderSubContentTransfo
             @Override
             public void close() throws IOException {
                 String wrappedFTL = buf.toString();
-                if (editTemplate != null && editTemplate.equalsIgnoreCase("true")) {
+                if (editTemplate != null && "true".equalsIgnoreCase(editTemplate)) {
                     if (UtilValidate.isNotEmpty(wrapTemplateId)) {
                         templateContext.put("wrappedFTL", wrappedFTL);
                         templateContext.put("webSiteId", webSiteId);

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/InjectNodeTrailCsvTransform.java Mon Oct 16 08:19:31 2017
@@ -109,7 +109,7 @@ public class InjectNodeTrailCsvTransform
                 // Maybe only contentId or subContentId are passed in
                 String redo = (String)templateCtx.get("redo");
 
-                if (UtilValidate.isEmpty(trail) || (redo != null && redo.equalsIgnoreCase("true"))) {
+                if (UtilValidate.isEmpty(trail) || (redo != null && "true".equalsIgnoreCase(redo))) {
                     String subContentId = (String)templateCtx.get("subContentId");
                     if (Debug.infoOn()) Debug.logInfo("in InjectNodeTrailCsv(0), subContentId:"+subContentId,module);
                     String contentId = (String)templateCtx.get("contentId");

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/LoopSubContentTransform.java Mon Oct 16 08:19:31 2017
@@ -223,7 +223,7 @@ public class LoopSubContentTransform imp
             public void close() throws IOException {
                 String wrappedFTL = buf.toString();
                 String encloseWrappedText = (String) templateCtx.get("encloseWrappedText");
-                if (UtilValidate.isEmpty(encloseWrappedText) || encloseWrappedText.equalsIgnoreCase("false")) {
+                if (UtilValidate.isEmpty(encloseWrappedText) || "false".equalsIgnoreCase(encloseWrappedText)) {
                     out.write(wrappedFTL);
                     wrappedFTL = ""; // So it won't get written again below.
                 }

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/OfbizContentAltUrlTransforms.java Mon Oct 16 08:19:31 2017
@@ -124,7 +124,7 @@ public class OfbizContentAltUrlTransform
                 url = contentAssocDataResource.getString("drObjectInfo");
                 url = UtilCodec.getDecoder("url").decode(url);
                 String mountPoint = request.getContextPath();
-                if (!(mountPoint.equals("/")) && !(mountPoint.equals(""))) {
+                if (!("/".equals(mountPoint)) && !(mountPoint.equals(""))) {
                     url = mountPoint + url;
                 }
             }

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java Mon Oct 16 08:19:31 2017
@@ -70,7 +70,7 @@ public class RenderSubContentCacheTransf
         List<Map<String, ? extends Object>> trail = UtilGenerics.checkList(templateRoot.get("globalNodeTrail"));
         String contentAssocPredicateId = (String)templateRoot.get("contentAssocPredicateId");
         String strNullThruDatesOnly = (String)templateRoot.get("nullThruDatesOnly");
-        Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && strNullThruDatesOnly.equalsIgnoreCase("true")) ? Boolean.TRUE :Boolean.FALSE;
+        Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && "true".equalsIgnoreCase(strNullThruDatesOnly)) ? Boolean.TRUE :Boolean.FALSE;
         String thisSubContentId =  (String)templateRoot.get("subContentId");
         final boolean directAssocMode = UtilValidate.isNotEmpty(thisSubContentId) ? true : false;
         GenericValue val = null;

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentCacheTransform.java Mon Oct 16 08:19:31 2017
@@ -94,7 +94,7 @@ public class TraverseSubContentCacheTran
         List<Map<String, ? extends Object>> globalNodeTrail = UtilGenerics.checkList(templateRoot.get("globalNodeTrail"));
         String strNullThruDatesOnly = (String)templateRoot.get("nullThruDatesOnly");
         String contentAssocPredicateId = (String)templateRoot.get("contentAssocPredicateId");
-        Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && strNullThruDatesOnly.equalsIgnoreCase("true")) ? Boolean.TRUE :Boolean.FALSE;
+        Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && "true".equalsIgnoreCase(strNullThruDatesOnly)) ? Boolean.TRUE :Boolean.FALSE;
         try {
             // getCurrentContent puts the "current" node on the end of globalNodeTrail.
             // It may have already been there, but getCurrentContent will compare its contentId

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/TraverseSubContentTransform.java Mon Oct 16 08:19:31 2017
@@ -195,7 +195,7 @@ public class TraverseSubContentTransform
             public void close() throws IOException {
                 String wrappedFTL = buf.toString();
                 String encloseWrappedText = (String)templateCtx.get("encloseWrappedText");
-                if (UtilValidate.isEmpty(encloseWrappedText) || encloseWrappedText.equalsIgnoreCase("false")) {
+                if (UtilValidate.isEmpty(encloseWrappedText) || "false".equalsIgnoreCase(encloseWrappedText)) {
                     out.write(wrappedFTL);
                     wrappedFTL = null; // So it won't get written again below.
                 }
@@ -231,7 +231,7 @@ public class TraverseSubContentTransform
                 assocContext.put("contentAssocTypeId", contentAssocTypeId);
                 String thisDirection = (String)templateCtx.get("direction");
                 String thisContentId = (String)templateCtx.get("thisContentId");
-                if (thisDirection != null && thisDirection.equalsIgnoreCase("From")) {
+                if (thisDirection != null && "From".equalsIgnoreCase(thisDirection)) {
                     assocContext.put("contentIdFrom", thisContentId);
                 } else {
                     assocContext.put("contentIdTo", thisContentId);

Modified: ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java?rev=1812256&r1=1812255&r2=1812256&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/WrapSubContentCacheTransform.java Mon Oct 16 08:19:31 2017
@@ -100,7 +100,7 @@ public class WrapSubContentCacheTransfor
         List<Map<String, ? extends Object>> trail = UtilGenerics.checkList(templateCtx.get("globalNodeTrail"));
         String contentAssocPredicateId = (String)templateCtx.get("contentAssocPredicateId");
         String strNullThruDatesOnly = (String)templateCtx.get("nullThruDatesOnly");
-        Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && strNullThruDatesOnly.equalsIgnoreCase("true")) ? Boolean.TRUE :Boolean.FALSE;
+        Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && "true".equalsIgnoreCase(strNullThruDatesOnly)) ? Boolean.TRUE :Boolean.FALSE;
         GenericValue val = null;
         try {
             val = ContentWorker.getCurrentContent(delegator, trail, userLogin, templateCtx, nullThruDatesOnly, contentAssocPredicateId);