svn commit: r1812262 - in /ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz: product/category/ product/config/ product/feature/ product/image/ product/imagemanagement/ product/inventory/ product/product/ product/supplier/...

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

svn commit: r1812262 - in /ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz: product/category/ product/config/ product/feature/ product/image/ product/imagemanagement/ product/inventory/ product/product/ product/supplier/...

Deepak Dixit-5
Author: deepak
Date: Mon Oct 16 09:16:07 2017
New Revision: 1812262

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

Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/feature/ProductFeatureServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/image/ScaleImage.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/supplier/SupplierProductServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java Mon Oct 16 09:16:07 2017
@@ -446,7 +446,7 @@ public class CategoryServices {
         String entityName = null;
         String primaryKeyName = null;
 
-        if (isCatalog.equals("true")) {
+        if ("true".equals(isCatalog)) {
             entityName = "ProdCatalog";
             primaryKeyName = "prodCatalogId";
         } else {
@@ -461,11 +461,11 @@ public class CategoryServices {
         try {
             GenericValue category = EntityQuery.use(delegator).from(entityName).where(primaryKeyName, productCategoryId).queryOne();
             if (category != null) {
-                if (isCatalog.equals("true") && isCategoryType.equals("false")) {
+                if ("true".equals(isCatalog) && "false".equals(isCategoryType)) {
                     CategoryWorker.getRelatedCategories(request, "ChildCatalogList", CatalogWorker.getCatalogTopCategoryId(request, productCategoryId), true);
                     childOfCats = EntityUtil.filterByDate((List<GenericValue>) request.getAttribute("ChildCatalogList"));
                     
-                } else if(isCatalog.equals("false") && isCategoryType.equals("false")){
+                } else if("false".equals(isCatalog) && "false".equals(isCategoryType)){
                     childOfCats = EntityQuery.use(delegator).from("ProductCategoryRollupAndChild").where("parentProductCategoryId", productCategoryId).filterByDate().queryList();
                 } else {
                     childOfCats = EntityQuery.use(delegator).from("ProdCatalogCategory").where("prodCatalogId", productCategoryId).filterByDate().queryList();

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoConfigUtil.java Mon Oct 16 09:16:07 2017
@@ -334,7 +334,7 @@ public final class SeoConfigUtil {
         } else {
             useUrlRegexp = true;
         }
-        if (result.equals("success")) {
+        if ("success".equals(result)) {
             isInitialed = true;
         }
     }

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/SeoContextFilter.java Mon Oct 16 09:16:07 2017
@@ -182,7 +182,7 @@ public class SeoContextFilter implements
                         redirectPath = httpRequest.getContextPath() + redirectPath;
                     }
                     // httpResponse.sendRedirect(redirectPath);
-                    if (uri.equals("") || uri.equals("/")) {
+                    if ("".equals(uri) || "/".equals(uri)) {
                         // redirect without any url change in browser
                         RequestDispatcher rd = request.getRequestDispatcher(redirectPath);
                         rd.forward(request, response);

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/config/ProductConfigWrapper.java Mon Oct 16 09:16:07 2017
@@ -95,7 +95,7 @@ public class ProductConfigWrapper implem
 
     private void init(Delegator delegator, LocalDispatcher dispatcher, String productId, String productStoreId, String catalogId, String webSiteId, String currencyUomId, Locale locale, GenericValue autoUserLogin) throws Exception {
         product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne();
-        if (product == null || !product.getString("productTypeId").equals("AGGREGATED") && !product.getString("productTypeId").equals("AGGREGATED_SERVICE")) {
+        if (product == null || !"AGGREGATED".equals(product.getString("productTypeId")) && !"AGGREGATED_SERVICE".equals(product.getString("productTypeId"))) {
             throw new ProductConfigWrapperException("Product " + productId + " is not an AGGREGATED product.");
         }
         this.dispatcher = dispatcher;
@@ -425,15 +425,15 @@ public class ProductConfigWrapper implem
         }
 
         public boolean isStandard() {
-            return configItemAssoc.getString("configTypeId").equals("STANDARD");
+            return "STANDARD".equals(configItemAssoc.getString("configTypeId"));
         }
 
         public boolean isSingleChoice() {
-            return configItem.getString("configItemTypeId").equals("SINGLE");
+            return "SINGLE".equals(configItem.getString("configItemTypeId"));
         }
 
         public boolean isMandatory() {
-            return configItemAssoc.getString("isMandatory") != null && configItemAssoc.getString("isMandatory").equals("Y");
+            return configItemAssoc.getString("isMandatory") != null && "Y".equals(configItemAssoc.getString("isMandatory"));
         }
 
         public boolean isFirst() {

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/feature/ProductFeatureServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/feature/ProductFeatureServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/feature/ProductFeatureServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/feature/ProductFeatureServices.java Mon Oct 16 09:16:07 2017
@@ -94,7 +94,7 @@ public class ProductFeatureServices {
             // get all product features in this feature category
             List<GenericValue> allFeatures = EntityQuery.use(delegator).from(entityToSearch).where(fieldToSearch, valueToSearch).orderBy(orderBy).queryList();
 
-            if (entityToSearch.equals("ProductFeatureAndAppl") && productFeatureApplTypeId != null)
+            if ("ProductFeatureAndAppl".equals(entityToSearch) && productFeatureApplTypeId != null)
                 allFeatures = EntityUtil.filterByAnd(allFeatures, UtilMisc.toMap("productFeatureApplTypeId", productFeatureApplTypeId));
 
             List<String> featureTypes = new LinkedList<String>();
@@ -218,7 +218,7 @@ public class ProductFeatureServices {
                 // existing list of features and id code or from scratch.
                 if (combinations.size()==0) {
                     for (GenericValue currentFeature: currentFeatures) {
-                        if (currentFeature.getString("productFeatureApplTypeId").equals("SELECTABLE_FEATURE")) {
+                        if ("SELECTABLE_FEATURE".equals(currentFeature.getString("productFeatureApplTypeId"))) {
                             Map<String, Object> newCombination = new HashMap<String, Object>();
                             List<GenericValue> newFeatures = new LinkedList<GenericValue>();
                             List<String> newFeatureIds = new LinkedList<String>();
@@ -237,7 +237,7 @@ public class ProductFeatureServices {
                 } else {
                     for (Map<String, Object> combination: combinations) {
                         for (GenericValue currentFeature: currentFeatures) {
-                            if (currentFeature.getString("productFeatureApplTypeId").equals("SELECTABLE_FEATURE")) {
+                            if ("SELECTABLE_FEATURE".equals(currentFeature.getString("productFeatureApplTypeId"))) {
                                 Map<String, Object> newCombination = new HashMap<String, Object>();
                                 // .clone() is important, or you'll keep adding to the same List for all the variants
                                 // have to cast twice: once from get() and once from clone()

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/image/ScaleImage.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/image/ScaleImage.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/image/ScaleImage.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/image/ScaleImage.java Mon Oct 16 09:16:07 2017
@@ -94,7 +94,7 @@ public class ScaleImage {
         String fileName = "component://product/config/ImageProperties.xml";
         String imgPropertyFullPath = FlexibleLocation.resolveLocation(fileName).getFile();
         resultXMLMap.putAll(ImageTransform.getXMLValue(imgPropertyFullPath, locale));
-        if (resultXMLMap.containsKey("responseMessage") && resultXMLMap.get("responseMessage").equals("success")) {
+        if (resultXMLMap.containsKey("responseMessage") && "success".equals(resultXMLMap.get("responseMessage"))) {
             imgPropertyMap.putAll(UtilGenerics.<Map<String, Map<String, String>>>cast(resultXMLMap.get("xml")));
         } else {
             String errMsg = UtilProperties.getMessage(resource, "ScaleImage.unable_to_parse", locale) + " : ImageProperties.xml";
@@ -125,7 +125,7 @@ public class ScaleImage {
             filenameExpander = FlexibleStringExpander.getInstance(filenameFormat);
             id = (String) context.get("productId");
             fileLocation = filenameExpander.expandString(UtilMisc.toMap("location", "products", "id", id, "type", "original"));
-        } else if (viewType.toLowerCase().contains("additional") && viewNumber != null && !viewNumber.equals("0")) {
+        } else if (viewType.toLowerCase().contains("additional") && viewNumber != null && !"0".equals(viewNumber)) {
             String filenameFormat = EntityUtilProperties.getPropertyValue("catalog", "image.filename.additionalviewsize.format", (Delegator) context.get("delegator"));
             filenameExpander = FlexibleStringExpander.getInstance(filenameFormat);
             id = (String) context.get("productId");
@@ -146,7 +146,7 @@ public class ScaleImage {
         /* get original BUFFERED IMAGE */
         resultBufImgMap.putAll(ImageTransform.getBufferedImage(imageServerPath + "/" + fileLocation + "." + imgExtension, locale));
 
-        if (resultBufImgMap.containsKey("responseMessage") && resultBufImgMap.get("responseMessage").equals("success")) {
+        if (resultBufImgMap.containsKey("responseMessage") && "success".equals(resultBufImgMap.get("responseMessage"))) {
             bufImg = (BufferedImage) resultBufImgMap.get("bufferedImage");
 
             // get Dimensions
@@ -167,7 +167,7 @@ public class ScaleImage {
                 resultScaleImgMap.putAll(ImageTransform.scaleImage(bufImg, imgHeight, imgWidth, imgPropertyMap, sizeType, locale));
 
                 /* Write the new image file */
-                if (resultScaleImgMap.containsKey("responseMessage") && resultScaleImgMap.get("responseMessage").equals("success")) {
+                if (resultScaleImgMap.containsKey("responseMessage") && "success".equals(resultScaleImgMap.get("responseMessage"))) {
                     bufNewImg = (BufferedImage) resultScaleImgMap.get("bufferedImage");
 
                     // Build full path for the new scaled image
@@ -275,7 +275,7 @@ public class ScaleImage {
         String fileName = "component://product/config/ImageProperties.xml";
         String imgPropertyFullPath = FlexibleLocation.resolveLocation(fileName).getFile();
         resultXMLMap.putAll(ImageTransform.getXMLValue(imgPropertyFullPath, locale));
-        if (resultXMLMap.containsKey("responseMessage") && resultXMLMap.get("responseMessage").equals("success")) {
+        if (resultXMLMap.containsKey("responseMessage") && "success".equals(resultXMLMap.get("responseMessage"))) {
             imgPropertyMap.putAll(UtilGenerics.<Map<String, Map<String, String>>>cast(resultXMLMap.get("xml")));
         } else {
             String errMsg = UtilProperties.getMessage(resource, "ScaleImage.unable_to_parse", locale) + " : ImageProperties.xml";
@@ -304,7 +304,7 @@ public class ScaleImage {
         if (viewType.toLowerCase().contains("main")) {
             type = "original";
             id = imgName;
-        } else if (viewType.toLowerCase().contains("additional") && viewNumber != null && !viewNumber.equals("0")) {
+        } else if (viewType.toLowerCase().contains("additional") && viewNumber != null && !"0".equals(viewNumber)) {
             type = "additional";
             id = imgName + "_View_" + viewNumber;
         } else {
@@ -325,7 +325,7 @@ public class ScaleImage {
             resultBufImgMap.putAll(ImageTransform.getBufferedImage(imageServerPath + "/" + filePathPrefix + filenameToUse, locale));
         }
         
-        if (resultBufImgMap.containsKey("responseMessage") && resultBufImgMap.get("responseMessage").equals("success")) {
+        if (resultBufImgMap.containsKey("responseMessage") && "success".equals(resultBufImgMap.get("responseMessage"))) {
             bufImg = (BufferedImage) resultBufImgMap.get("bufferedImage");
 
             // get Dimensions
@@ -349,7 +349,7 @@ public class ScaleImage {
             for (String sizeType : sizeTypeList) {
                 resultScaleImgMap.putAll(ImageTransform.scaleImage(bufImg, imgHeight, imgWidth, imgPropertyMap, sizeType, locale));
 
-                if (resultScaleImgMap.containsKey("responseMessage") && resultScaleImgMap.get("responseMessage").equals("success")) {
+                if (resultScaleImgMap.containsKey("responseMessage") && "success".equals(resultScaleImgMap.get("responseMessage"))) {
                     bufNewImg = (BufferedImage) resultScaleImgMap.get("bufferedImage");
 
                     // write the New Scaled Image

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java Mon Oct 16 09:16:07 2017
@@ -127,9 +127,9 @@ public class ImageManagementServices {
             }
             
             String fileContentType = (String) context.get("_uploadedFile_contentType");
-            if (fileContentType.equals("image/pjpeg")) {
+            if ("image/pjpeg".equals(fileContentType)) {
                 fileContentType = "image/jpeg";
-            } else if (fileContentType.equals("image/x-png")) {
+            } else if ("image/x-png".equals(fileContentType)) {
                 fileContentType = "image/png";
             }
             
@@ -265,7 +265,7 @@ public class ImageManagementServices {
             }
             
             String autoApproveImage = EntityUtilProperties.getPropertyValue("catalog", "image.management.autoApproveImage", delegator);
-            if (autoApproveImage.equals("Y")) {
+            if ("Y".equals(autoApproveImage)) {
                 Map<String, Object> autoApproveCtx = new HashMap<String, Object>();
                 autoApproveCtx.put("contentId", contentId);
                 autoApproveCtx.put("userLogin", userLogin);
@@ -325,7 +325,7 @@ public class ImageManagementServices {
         String fileName = "component://product/config/ImageProperties.xml";
         String imgPropertyFullPath = FlexibleLocation.resolveLocation(fileName).getFile();
         resultXMLMap.putAll(ImageTransform.getXMLValue(imgPropertyFullPath, locale));
-        if (resultXMLMap.containsKey("responseMessage") && resultXMLMap.get("responseMessage").equals("success")) {
+        if (resultXMLMap.containsKey("responseMessage") && "success".equals(resultXMLMap.get("responseMessage"))) {
             imgPropertyMap.putAll(UtilGenerics.<Map<String, Map<String, String>>>cast(resultXMLMap.get("xml")));
         } else {
             String errMsg = UtilProperties.getMessage(resourceError, "ScaleImage.unable_to_parse", locale) + " : ImageProperties.xml";
@@ -346,7 +346,7 @@ public class ImageManagementServices {
         /* get original BUFFERED IMAGE */
         resultBufImgMap.putAll(ImageTransform.getBufferedImage(imageServerPath + "/" + productId + "/" + filenameToUse, locale));
         
-        if (resultBufImgMap.containsKey("responseMessage") && resultBufImgMap.get("responseMessage").equals("success")) {
+        if (resultBufImgMap.containsKey("responseMessage") && "success".equals(resultBufImgMap.get("responseMessage"))) {
             bufImg = (BufferedImage) resultBufImgMap.get("bufferedImage");
             
             // get Dimensions
@@ -363,7 +363,7 @@ public class ImageManagementServices {
             for (String sizeType : sizeTypeList) {
                 resultScaleImgMap.putAll(ImageTransform.scaleImage(bufImg, imgHeight, imgWidth, imgPropertyMap, sizeType, locale));
                 
-                if (resultScaleImgMap.containsKey("responseMessage") && resultScaleImgMap.get("responseMessage").equals("success")) {
+                if (resultScaleImgMap.containsKey("responseMessage") && "success".equals(resultScaleImgMap.get("responseMessage"))) {
                     bufNewImg = (BufferedImage) resultScaleImgMap.get("bufferedImage");
                     
                     // write the New Scaled Image
@@ -508,9 +508,9 @@ public class ImageManagementServices {
         result.put("contentIdThumb", contentIdThumb);        
         String filenameToUseThumb = imageName.substring(0 , imageName.indexOf(".")) + nameOfThumb;
         String fileContentType = (String) context.get("_uploadedFile_contentType");
-        if (fileContentType.equals("image/pjpeg")) {
+        if ("image/pjpeg".equals(fileContentType)) {
             fileContentType = "image/jpeg";
-        } else if (fileContentType.equals("image/x-png")) {
+        } else if ("image/x-png".equals(fileContentType)) {
             fileContentType = "image/png";
         }
         

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/inventory/InventoryServices.java Mon Oct 16 09:16:07 2017
@@ -88,7 +88,7 @@ public class InventoryServices {
             Map<String, Object> results = ServiceUtil.returnSuccess();
 
             String inventoryType = inventoryItem.getString("inventoryItemTypeId");
-            if (inventoryType.equals("NON_SERIAL_INV_ITEM")) {
+            if ("NON_SERIAL_INV_ITEM".equals(inventoryType)) {
                 BigDecimal atp = inventoryItem.getBigDecimal("availableToPromiseTotal");
                 BigDecimal qoh = inventoryItem.getBigDecimal("quantityOnHandTotal");
 
@@ -160,7 +160,7 @@ public class InventoryServices {
                 } else {
                     results.put("inventoryItemId", inventoryItem.get("inventoryItemId"));
                 }
-            } else if (inventoryType.equals("SERIALIZED_INV_ITEM")) {
+            } else if ("SERIALIZED_INV_ITEM".equals(inventoryType)) {
                 if (!"INV_AVAILABLE".equals(inventoryItem.getString("statusId"))) {
                     return ServiceUtil.returnError(UtilProperties.getMessage(resource,
                             "ProductSerializedInventoryNotAvailable", locale));
@@ -169,7 +169,7 @@ public class InventoryServices {
 
             // setup values so that no one will grab the inventory during the move
             // if newItem is not null, it is the item to be moved, otherwise the original inventoryItem is the one to be moved
-            if (inventoryType.equals("NON_SERIAL_INV_ITEM")) {
+            if ("NON_SERIAL_INV_ITEM".equals(inventoryType)) {
                 // set the transfered inventory item's atp to 0 and the qoh to the xferQty; at this point atp and qoh will always be the same, so we can safely zero the atp for now
                 GenericValue inventoryItemToClear = newItem == null ? inventoryItem : newItem;
 
@@ -191,7 +191,7 @@ public class InventoryServices {
                                 UtilMisc.toMap("errorString", e1.getMessage()), locale));
                     }
                 }
-            } else if (inventoryType.equals("SERIALIZED_INV_ITEM")) {
+            } else if ("SERIALIZED_INV_ITEM".equals(inventoryType)) {
                 // set the status to avoid re-moving or something
               if (newItem != null) {
                     newItem.refresh();
@@ -251,7 +251,7 @@ public class InventoryServices {
             }
         }
 
-        if (inventoryType.equals("NON_SERIAL_INV_ITEM")) {
+        if ("NON_SERIAL_INV_ITEM".equals(inventoryType)) {
             // add an adjusting InventoryItemDetail so set ATP back to QOH: ATP = ATP + (QOH - ATP), diff = QOH - ATP
             BigDecimal atp = inventoryItem.get("availableToPromiseTotal") == null ? BigDecimal.ZERO : inventoryItem.getBigDecimal("availableToPromiseTotal");
             BigDecimal qoh = inventoryItem.get("quantityOnHandTotal") == null ? BigDecimal.ZERO : inventoryItem.getBigDecimal("quantityOnHandTotal");
@@ -286,7 +286,7 @@ public class InventoryServices {
                                                     "userLogin", userLogin);
 
         // for serialized items, automatically make them available
-        if (inventoryType.equals("SERIALIZED_INV_ITEM")) {
+        if ("SERIALIZED_INV_ITEM".equals(inventoryType)) {
             updateInventoryItemMap.put("statusId", "INV_AVAILABLE");
         }
 
@@ -359,7 +359,7 @@ public class InventoryServices {
         String inventoryType = inventoryItem.getString("inventoryItemTypeId");
 
         // re-set the fields on the item
-        if (inventoryType.equals("NON_SERIAL_INV_ITEM")) {
+        if ("NON_SERIAL_INV_ITEM".equals(inventoryType)) {
             // add an adjusting InventoryItemDetail so set ATP back to QOH: ATP = ATP + (QOH - ATP), diff = QOH - ATP
             BigDecimal atp = inventoryItem.get("availableToPromiseTotal") == null ? BigDecimal.ZERO : inventoryItem.getBigDecimal("availableToPromiseTotal");
             BigDecimal qoh = inventoryItem.get("quantityOnHandTotal") == null ? BigDecimal.ZERO : inventoryItem.getBigDecimal("quantityOnHandTotal");
@@ -378,7 +378,7 @@ public class InventoryServices {
                         "ProductInventoryItemDetailCreateProblem",
                         UtilMisc.toMap("errorString", e1.getMessage()), locale));
             }
-        } else if (inventoryType.equals("SERIALIZED_INV_ITEM")) {
+        } else if ("SERIALIZED_INV_ITEM".equals(inventoryType)) {
             inventoryItem.set("statusId", "INV_AVAILABLE");
             // store the entity
             try {
@@ -903,11 +903,11 @@ public class InventoryServices {
         }
         //change this for product price
         for (GenericValue onePrice: productPrices) {
-            if (onePrice.getString("productPriceTypeId").equals("DEFAULT_PRICE")) { //defaultPrice
+            if ("DEFAULT_PRICE".equals(onePrice.getString("productPriceTypeId"))) { //defaultPrice
                 result.put("defaultPrice", onePrice.getBigDecimal("price"));
-            } else if (onePrice.getString("productPriceTypeId").equals("WHOLESALE_PRICE")) {//
+            } else if ("WHOLESALE_PRICE".equals(onePrice.getString("productPriceTypeId"))) {//
                 result.put("wholeSalePrice", onePrice.getBigDecimal("price"));
-            } else if (onePrice.getString("productPriceTypeId").equals("LIST_PRICE")) {//listPrice
+            } else if ("LIST_PRICE".equals(onePrice.getString("productPriceTypeId"))) {//listPrice
                 result.put("listPrice", onePrice.getBigDecimal("price"));
             } else {
                 result.put("defaultPrice", onePrice.getBigDecimal("price"));

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductEvents.java Mon Oct 16 09:16:07 2017
@@ -248,7 +248,7 @@ public class ProductEvents {
         if (UtilValidate.isEmpty(productAssocTypeId))
             errMsgList.add(UtilProperties.getMessage(resource,"productevents.association_type_ID_missing", UtilHttp.getLocale(request)));
         // from date is only required if update mode is not CREATE
-        if (!updateMode.equals("CREATE") && UtilValidate.isEmpty(fromDateStr))
+        if (!"CREATE".equals(updateMode) && UtilValidate.isEmpty(fromDateStr))
             errMsgList.add(UtilProperties.getMessage(resource,"productevents.from_date_missing", UtilHttp.getLocale(request)));
         if (errMsgList.size() > 0) {
             request.setAttribute("_ERROR_MESSAGE_LIST_", errMsgList);
@@ -267,7 +267,7 @@ public class ProductEvents {
 
         GenericValue tempProductAssoc = delegator.makeValue("ProductAssoc", UtilMisc.toMap("productId", productId, "productIdTo", productIdTo, "productAssocTypeId", productAssocTypeId, "fromDate", fromDate));
 
-        if (updateMode.equals("DELETE")) {
+        if ("DELETE".equals(updateMode)) {
             GenericValue productAssoc = null;
 
             try {
@@ -333,7 +333,7 @@ public class ProductEvents {
         tempProductAssoc.set("quantity", quantity);
         tempProductAssoc.set("sequenceNum", sequenceNum);
 
-        if (updateMode.equals("CREATE")) {
+        if ("CREATE".equals(updateMode)) {
             // if no from date specified, set to now
             if (fromDate == null) {
                 fromDate = new Timestamp(new java.util.Date().getTime());
@@ -362,7 +362,7 @@ public class ProductEvents {
                 Debug.logWarning("[ProductEvents.updateProductAssoc] Could not create product association (write error); message: " + e.getMessage(), module);
                 return "error";
             }
-        } else if (updateMode.equals("UPDATE")) {
+        } else if ("UPDATE".equals(updateMode)) {
             try {
                 tempProductAssoc.store();
             } catch (GenericEntityException e) {
@@ -869,7 +869,7 @@ public class ProductEvents {
         if (productFeatureIdArray != null && productFeatureIdArray.length > 0) {
             try {
                 for (String productFeatureId: productFeatureIdArray) {
-                    if (!productFeatureId.equals("~~any~~")) {
+                    if (!"~~any~~".equals(productFeatureId)) {
                         List<GenericValue> featureAppls = EntityQuery.use(delegator).from("ProductFeatureAppl").where("productId", productId, "productFeatureId", productFeatureId, "productFeatureApplTypeId", productFeatureApplTypeId).queryList();
                         if (featureAppls.size() == 0) {
                             // no existing application for this

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java Mon Oct 16 09:16:07 2017
@@ -819,7 +819,7 @@ public class ProductSearchSession {
         if (UtilValidate.isEmpty(sortAscending)) sortAscending = (String) parameters.get("S_A");
         boolean ascending = !"N".equals(sortAscending);
         if (sortOrder != null) {
-            if (sortOrder.equals("SortKeywordRelevancy") || sortOrder.equals("SKR")) {
+            if ("SortKeywordRelevancy".equals(sortOrder) || "SKR".equals(sortOrder)) {
                 searchSetSortOrder(new ProductSearch.SortKeywordRelevancy(), session);
             } else if (sortOrder.startsWith("SortProductField:")) {
                 String fieldName = sortOrder.substring("SortProductField:".length());

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java Mon Oct 16 09:16:07 2017
@@ -247,7 +247,7 @@ public class ProductServices {
                                 "ProductFeatureTreeCannotCallIsStoreInventoryRequired", locale), null, null, invReqResult);
                     } else if ("Y".equals(invReqResult.get("availableOrNotRequired"))) {
                         items.add(productIdTo);
-                        if (productTo.getString("isVirtual") != null && productTo.getString("isVirtual").equals("Y")) {
+                        if (productTo.getString("isVirtual") != null && "Y".equals(productTo.getString("isVirtual"))) {
                             virtualVariant.add(productIdTo);
                         }
                     } else {
@@ -255,7 +255,7 @@ public class ProductServices {
                     }
                 } else {
                     items.add(productIdTo);
-                    if (productTo.getString("isVirtual") != null && productTo.getString("isVirtual").equals("Y")) {
+                    if (productTo.getString("isVirtual") != null && "Y".equals(productTo.getString("isVirtual"))) {
                         virtualVariant.add(productIdTo);
                     }
                 }
@@ -381,7 +381,7 @@ public class ProductServices {
             GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).cache().queryOne();
             GenericValue mainProduct = product;
 
-            if (product.get("isVariant") != null && product.getString("isVariant").equalsIgnoreCase("Y")) {
+            if (product.get("isVariant") != null && "Y".equalsIgnoreCase(product.getString("isVariant"))) {
                 List<GenericValue> c = product.getRelated("AssocProductAssoc", UtilMisc.toMap("productAssocTypeId", "PRODUCT_VARIANT"), null, true);
                 c = EntityUtil.filterByDate(c);
                 if (c.size() > 0) {

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/supplier/SupplierProductServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/supplier/SupplierProductServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/supplier/SupplierProductServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/product/supplier/SupplierProductServices.java Mon Oct 16 09:16:07 2017
@@ -74,7 +74,7 @@ public class SupplierProductServices {
             List<GenericValue> supplierProducts = product.getRelated("SupplierProduct", null, null, true);
 
             // if there were no related SupplierProduct entities and the item is a variant, then get the SupplierProducts of the virtual parent product
-            if (supplierProducts.size() == 0 && product.getString("isVariant") != null && product.getString("isVariant").equals("Y")) {
+            if (supplierProducts.size() == 0 && product.getString("isVariant") != null && "Y".equals(product.getString("isVariant"))) {
                 String virtualProductId = ProductWorker.getVariantVirtualId(product);
                 GenericValue virtualProduct = EntityQuery.use(delegator).from("Product").where("productId", virtualProductId).cache().queryOne();
                 if (virtualProduct != null) {

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java Mon Oct 16 09:16:07 2017
@@ -943,7 +943,7 @@ public class ShipmentServices {
         try {
             Map<String, Object> input = UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", shipmentRouteSegmentId, "userLogin", userLogin);
             // for DHL, we just need to confirm the shipment to get the label.  Other carriers may have more elaborate requirements.
-            if (carrierPartyId.equals("DHL")) {
+            if ("DHL".equals(carrierPartyId)) {
                 dispatcher.runAsync("dhlShipmentConfirm", input);
             } else {
                 Debug.logError(carrierPartyId + " is not supported at this time.  Sorry.", module);

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/dhl/DhlServices.java Mon Oct 16 09:16:07 2017
@@ -162,7 +162,7 @@ public class DhlServices {
         String shippingContactMechId = (String) context.get("shippingContactMechId");
         BigDecimal shippableWeight = (BigDecimal) context.get("shippableWeight");
 
-        if (shipmentMethodTypeId.equals("NO_SHIPPING")) {
+        if ("NO_SHIPPING".equals(shipmentMethodTypeId)) {
             Map<String, Object> result = ServiceUtil.returnSuccess();
             result.put("shippingEstimateAmount", null);
             return result;
@@ -229,7 +229,7 @@ public class DhlServices {
             Debug.logWarning("DHL Estimate: Weight is less than 1 lb, submitting DHL minimum of 1 lb for estimate.", module);
             shippableWeight = BigDecimal.ONE;
         }
-        if ((dhlShipmentDetailCode.equals("G") && shippableWeight.compareTo(new BigDecimal("999")) > 0) || (shippableWeight.compareTo(new BigDecimal("150")) > 0)) {
+        if (("G".equals(dhlShipmentDetailCode) && shippableWeight.compareTo(new BigDecimal("999")) > 0) || (shippableWeight.compareTo(new BigDecimal("150")) > 0)) {
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
                     "FacilityShipmentDhlShippableWeightExceed", locale));
         }
@@ -711,7 +711,7 @@ public class DhlServices {
             if (labelImagePreference == null) {
                 Debug.logInfo("shipment.dhl.label.image.format not specified, assuming PNG", module);
                 labelImagePreference="PNG";
-            } else if (!(labelImagePreference.equals("PNG") || labelImagePreference.equals("GIF"))) {
+            } else if (!("PNG".equals(labelImagePreference) || "GIF".equals(labelImagePreference))) {
                 Debug.logError("Illegal shipment.dhl.label.image.format: " + labelImagePreference, module);
                 return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
                         "FacilityShipmentDhlUnknownLabelImageFormat",

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java Mon Oct 16 09:16:07 2017
@@ -243,7 +243,7 @@ public class FedexServices {
             String countryCode = countryGeo.getString("geoCode");
             String stateOrProvinceCode = null;
             // Only add the StateOrProvinceCode element if the address is in USA or Canada
-            if (countryCode.equals("CA") || countryCode.equals("US")) {
+            if ("CA".equals(countryCode) || "US".equals(countryCode)) {
                 GenericValue stateProvinceGeo = EntityQuery.use(delegator).from("Geo").where("geoId", postalAddress.getString("stateProvinceGeoId")).cache().queryOne();
                 stateOrProvinceCode = stateProvinceGeo.getString("geoCode");
             }
@@ -267,7 +267,7 @@ public class FedexServices {
             }
             phoneNumber = phoneNumberValue.getString("areaCode") + phoneNumberValue.getString("contactNumber");
             // Fedex doesn't want the North American country code
-            if (UtilValidate.isNotEmpty(phoneNumberValue.getString("countryCode")) && !(countryCode.equals("CA") || countryCode.equals("US"))) {
+            if (UtilValidate.isNotEmpty(phoneNumberValue.getString("countryCode")) && !("CA".equals(countryCode) || "US".equals(countryCode))) {
                 phoneNumber = phoneNumberValue.getString("countryCode") + phoneNumber;
             }
             phoneNumber = phoneNumber.replaceAll("[^+\\d]", "");
@@ -285,7 +285,7 @@ public class FedexServices {
             if (! UtilValidate.isEmpty(faxNumberValue)) {
                 faxNumber = faxNumberValue.getString("areaCode") + faxNumberValue.getString("contactNumber");
                 // Fedex doesn't want the North American country code
-                if (UtilValidate.isNotEmpty(faxNumberValue.getString("countryCode")) && !(countryCode.equals("CA") || countryCode.equals("US"))) {
+                if (UtilValidate.isNotEmpty(faxNumberValue.getString("countryCode")) && !("CA".equals(countryCode) || "US".equals(countryCode))) {
                     faxNumber = faxNumberValue.getString("countryCode") + faxNumber;
                 }
                 faxNumber = faxNumber.replaceAll("[^+\\d]", "");
@@ -515,7 +515,7 @@ public class FedexServices {
             String service = carrierShipmentMethod.getString("carrierServiceCode");
 
             // CarrierCode is FDXG only for FEDEXGROUND and GROUNDHOMEDELIVERY services.
-            boolean isGroundService = service.equals("FEDEXGROUND") || service.equals("GROUNDHOMEDELIVERY");
+            boolean isGroundService = "FEDEXGROUND".equals(service) || "GROUNDHOMEDELIVERY".equals(service);
             String carrierCode = isGroundService ? "FDXG" : "FDXE";
 
             // Determine the currency by trying the shipmentRouteSegment, then the Shipment, then the framework's default currency, and finally default to USD
@@ -553,7 +553,7 @@ public class FedexServices {
             String originAddressStateOrProvinceCode = null;
 
             // Only add the StateOrProvinceCode element if the address is in USA or Canada
-            if (originAddressCountryCode.equals("CA") || originAddressCountryCode.equals("US")) {
+            if ("CA".equals(originAddressCountryCode) || "US".equals(originAddressCountryCode)) {
                 if (UtilValidate.isEmpty(originPostalAddress.getString("stateProvinceGeoId"))) {
                     return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
                             "FacilityShipmentRouteSegmentOriginStateProvinceGeoIdRequired",
@@ -574,7 +574,7 @@ public class FedexServices {
             String originContactPhoneNumber = originTelecomNumber.getString("areaCode") + originTelecomNumber.getString("contactNumber");
 
             // Fedex doesn't want the North American country code
-            if (UtilValidate.isNotEmpty(originTelecomNumber.getString("countryCode")) && !(originAddressCountryCode.equals("CA") || originAddressCountryCode.equals("US"))) {
+            if (UtilValidate.isNotEmpty(originTelecomNumber.getString("countryCode")) && !("CA".equals(originAddressCountryCode) || "US".equals(originAddressCountryCode))) {
                 originContactPhoneNumber = originTelecomNumber.getString("countryCode") + originContactPhoneNumber;
             }
             originContactPhoneNumber = originContactPhoneNumber.replaceAll("[^+\\d]", "");
@@ -628,7 +628,7 @@ public class FedexServices {
             String destinationAddressStateOrProvinceCode = null;
 
             // Only add the StateOrProvinceCode element if the address is in USA or Canada
-            if (destinationAddressCountryCode.equals("CA") || destinationAddressCountryCode.equals("US")) {
+            if ("CA".equals(destinationAddressCountryCode) || "US".equals(destinationAddressCountryCode)) {
                 if (UtilValidate.isEmpty(destinationPostalAddress.getString("stateProvinceGeoId"))) {
                     return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
                             "FacilityShipmentRouteSegmentDestStateProvinceGeoIdNotFound",
@@ -649,7 +649,7 @@ public class FedexServices {
             String destinationContactPhoneNumber = destinationTelecomNumber.getString("areaCode") + destinationTelecomNumber.getString("contactNumber");
 
             // Fedex doesn't want the North American country code
-            if (UtilValidate.isNotEmpty(destinationTelecomNumber.getString("countryCode")) && !(destinationAddressCountryCode.equals("CA") || destinationAddressCountryCode.equals("US"))) {
+            if (UtilValidate.isNotEmpty(destinationTelecomNumber.getString("countryCode")) && !("CA".equals(destinationAddressCountryCode) || "US".equals(destinationAddressCountryCode))) {
                 destinationContactPhoneNumber = destinationTelecomNumber.getString("countryCode") + destinationContactPhoneNumber;
             }
             destinationContactPhoneNumber = destinationContactPhoneNumber.replaceAll("[^+\\d]", "");
@@ -677,7 +677,7 @@ public class FedexServices {
                 // Determine the home-delivery instructions
                 homeDeliveryType = shipmentRouteSegment.getString("homeDeliveryType");
                 if (UtilValidate.isNotEmpty(homeDeliveryType)) {
-                    if (! (homeDeliveryType.equals("DATECERTAIN") || homeDeliveryType.equals("EVENING") || homeDeliveryType.equals("APPOINTMENT"))) {
+                    if (! ("DATECERTAIN".equals(homeDeliveryType) || "EVENING".equals(homeDeliveryType) || "APPOINTMENT".equals(homeDeliveryType))) {
                         return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
                                 "FacilityShipmentFedexHomeDeliveryTypeInvalid",
                                 UtilMisc.toMap("shipmentId", shipmentId, "shipmentRouteSegmentId", shipmentRouteSegmentId), locale));
@@ -715,7 +715,7 @@ public class FedexServices {
             shipRequestContext.put("ShipTime", UtilDateTime.nowTimestamp());
             shipRequestContext.put("DropoffType", dropoffType);
             shipRequestContext.put("Service", service);
-            shipRequestContext.put("WeightUnits", weightUomId.equals("WT_kg") ? "KGS" : "LBS");
+            shipRequestContext.put("WeightUnits", "WT_kg".equals(weightUomId) ? "KGS" : "LBS");
             shipRequestContext.put("CurrencyCode", currencyCode);
             shipRequestContext.put("PayorType", "SENDER");
             shipRequestContext.put(originContactKey, originContactName);
@@ -916,7 +916,7 @@ public class FedexServices {
                     dimensionsLength != null && dimensionsLength.setScale(0, RoundingMode.HALF_UP).compareTo(BigDecimal.ZERO) > 0 &&
                     dimensionsWidth != null && dimensionsWidth.setScale(0, RoundingMode.HALF_UP).compareTo(BigDecimal.ZERO) > 0   &&
                     dimensionsHeight != null && dimensionsHeight.setScale(0, RoundingMode.HALF_UP).compareTo(BigDecimal.ZERO) > 0) {
-                        shipRequestContext.put("DimensionsUnits", dimensionsUomId.equals("LEN_in") ? "IN" : "CM");
+                        shipRequestContext.put("DimensionsUnits", "LEN_in".equals(dimensionsUomId) ? "IN" : "CM");
                         shipRequestContext.put("DimensionsLength", dimensionsLength.setScale(0, RoundingMode.HALF_UP).toString());
                         shipRequestContext.put("DimensionsWidth", dimensionsWidth.setScale(0, RoundingMode.HALF_UP).toString());
                         shipRequestContext.put("DimensionsHeight", dimensionsHeight.setScale(0, RoundingMode.HALF_UP).toString());

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java?rev=1812262&r1=1812261&r2=1812262&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java Mon Oct 16 09:16:07 2017
@@ -1733,7 +1733,7 @@ public class UpsServices {
             Iterator<String> i = packageMap.keySet().iterator();
             String productId = i.next();
             Map<String, Object> productInfo = ShipmentWorker.getProductItemInfo(shippableItemInfo, productId);
-            if (productInfo.get("inShippingBox") != null &&  ((String) productInfo.get("inShippingBox")).equalsIgnoreCase("Y")
+            if (productInfo.get("inShippingBox") != null && "Y".equalsIgnoreCase((String) productInfo.get("inShippingBox"))
                     && productInfo.get("shippingDepth") !=null && productInfo.get("shippingWidth") !=null && productInfo.get("shippingHeight") !=null) {
                 Element dimensionsElement = UtilXml.addChildElement(packageElement, "Dimensions", requestDoc);
                 UtilXml.addChildElementValue(dimensionsElement, "Length", productInfo.get("shippingDepth").toString(), requestDoc);
@@ -2050,7 +2050,7 @@ public class UpsServices {
             UtilXml.addChildElementValue(shiptoAddrElement, "CountryCode", shippingCountryCode, rateRequestDoc);
         }
 
-        if (isResidentialAddress != null && isResidentialAddress.equals("Y")) {
+        if (isResidentialAddress != null && "Y".equals(isResidentialAddress)) {
             UtilXml.addChildElement(shiptoAddrElement, "ResidentialAddress", rateRequestDoc);
         }
         // requested service (code) - not used when in Shop mode