svn commit: r1858351 - /ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java

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

svn commit: r1858351 - /ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java

jleroux@apache.org
Author: jleroux
Date: Mon Apr 29 09:20:10 2019
New Revision: 1858351

URL: http://svn.apache.org/viewvc?rev=1858351&view=rev
Log:
Reverted: Refactor boolean returns from methods
(OFBIZ-10725)

Revert an error in previous commit (r1858350)

Modified:
    ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java

Modified: ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java?rev=1858351&r1=1858350&r2=1858351&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java (original)
+++ ofbiz/ofbiz-plugins/trunk/pricat/src/main/java/org/apache/ofbiz/pricat/sample/SamplePricatParser.java Mon Apr 29 09:20:10 2019
@@ -346,20 +346,20 @@ public class SamplePricatParser extends
     public boolean isFacilityOk(XSSFRow row, String facilityName, String facilityId) {
         if (!facilities.containsKey(facilityId)) {
             if (UtilValidate.isEmpty(facilityId) && facilities.keySet().size() == 1) {
-
-                return UtilValidate.isEmpty(facilityName);
-
-                String theFacilityId = (String) facilities.keySet().toArray()[0];
-                String name = facilities.get(theFacilityId)[0];
-                if (!name.equals(facilityName)) {
-                    String errorMessage = UtilProperties.getMessage(resource, "FacilityNameNotMatchId", new Object[]{theFacilityId, name, facilityName}, locale);
-                    report.println();
-                    report.print(errorMessage, InterfaceReport.FORMAT_ERROR);
-                    XSSFCell cell = row.getCell(0);
-                    errorMessages.put(new CellReference(cell), errorMessage);
-                    return false;
+                if (UtilValidate.isEmpty(facilityName)) {
+                    return true;
+                } else {
+                    String theFacilityId = (String) facilities.keySet().toArray()[0];
+                    String name = facilities.get(theFacilityId)[0];
+                    if (!name.equals(facilityName)) {
+                        String errorMessage = UtilProperties.getMessage(resource, "FacilityNameNotMatchId", new Object[]{theFacilityId, name, facilityName}, locale);
+                        report.println();
+                        report.print(errorMessage, InterfaceReport.FORMAT_ERROR);
+                        XSSFCell cell = row.getCell(0);
+                        errorMessages.put(new CellReference(cell), errorMessage);
+                        return false;
+                    }
                 }
-
             } else {
                 String errorMessage = UtilProperties.getMessage(resource, "FacilityNotBelongToYou", new Object[]{facilityName, facilityId}, locale);
                 report.println();