Skip to content

Commit 2199981

Browse files
committed
Backported: Refactor boolean assignments to comply with codestyle rules
1 parent 4b9526c commit 2199981

17 files changed

Lines changed: 22 additions & 23 deletions

File tree

applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/GiftCertificateServices.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,8 @@ public static Map<String, Object> giftCertificatePurchase(DispatchContext dctx,
827827
String orderEmails = orh.getOrderEmailString();
828828
String copyMeField = giftCertSettings.getString("purchSurveyCopyMe");
829829
String copyMeResp = copyMeField != null ? (String) answerMap.get(copyMeField) : null;
830-
boolean copyMe = (UtilValidate.isNotEmpty(copyMeField)
831-
&& UtilValidate.isNotEmpty(copyMeResp) && "true".equalsIgnoreCase(copyMeResp)) ? true : false;
830+
boolean copyMe = UtilValidate.isNotEmpty(copyMeField)
831+
&& UtilValidate.isNotEmpty(copyMeResp) && "true".equalsIgnoreCase(copyMeResp);
832832

833833
int qtyLoop = quantity.intValue();
834834
for (int i = 0; i < qtyLoop; i++) {

applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ private static RitaApi getApi(Properties props) {
454454
} catch (RuntimeException e) {
455455
Debug.logError(e, MODULE);
456456
}
457-
boolean ssl = "Y".equals(props.getProperty("ssl", "N")) ? true : false;
457+
boolean ssl = "Y".equals(props.getProperty("ssl", "N"));
458458

459459
RitaApi api = null;
460460
if (port > 0 && host != null) {

applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,8 @@ public static Map<String, Object> giftCardPurchase(DispatchContext dctx, Map<Str
11111111
String orderEmails = orh.getOrderEmailString();
11121112
String copyMeField = EntityUtilProperties.getPropertyValue(paymentConfig, "payment.giftcert.purchase.survey.copyMe", delegator);
11131113
String copyMeResp = copyMeField != null ? (String) answerMap.get(copyMeField) : null;
1114-
boolean copyMe = (UtilValidate.isNotEmpty(copyMeField)
1115-
&& UtilValidate.isNotEmpty(copyMeResp) && "true".equalsIgnoreCase(copyMeResp)) ? true : false;
1114+
boolean copyMe = UtilValidate.isNotEmpty(copyMeField)
1115+
&& UtilValidate.isNotEmpty(copyMeResp) && "true".equalsIgnoreCase(copyMeResp);
11161116

11171117
int qtyLoop = quantity.intValue();
11181118
for (int i = 0; i < qtyLoop; i++) {

applications/content/src/main/java/org/apache/ofbiz/content/ContentManagementServices.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ public static Map<String, Object> updateOrRemove(DispatchContext dctx, Map<Strin
816816
}
817817
pkFields.put(fieldName, fieldValue);
818818
}
819-
boolean doLink = (action != null && "Y".equalsIgnoreCase(action)) ? true : false;
819+
boolean doLink = "Y".equalsIgnoreCase(action);
820820
if (Debug.infoOn()) {
821821
Debug.logInfo("in updateOrRemove, context:" + context, MODULE);
822822
}

applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderContentAsText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public Writer getWriter(Writer out, @SuppressWarnings("rawtypes") Map args) {
7676
}
7777
final String thisContentId = (String) templateRoot.get("contentId");
7878
final String xmlEscape = (String) templateRoot.get("xmlEscape");
79-
final boolean directAssocMode = UtilValidate.isNotEmpty(thisContentId) ? true : false;
79+
final boolean directAssocMode = UtilValidate.isNotEmpty(thisContentId);
8080
if (Debug.verboseOn()) {
8181
Debug.logVerbose("in Render(0), directAssocMode ." + directAssocMode, MODULE);
8282
}

applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentAsText.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Writer getWriter(Writer out, @SuppressWarnings("rawtypes") Map args) {
7575
if (Debug.infoOn()) {
7676
Debug.logInfo("in Render(0), thisSubContentId ." + thisContentId, MODULE);
7777
}
78-
final boolean directAssocMode = UtilValidate.isNotEmpty(thisContentId) ? true : false;
78+
final boolean directAssocMode = UtilValidate.isNotEmpty(thisContentId);
7979
if (Debug.infoOn()) {
8080
Debug.logInfo("in Render(0), directAssocMode ." + directAssocMode, MODULE);
8181
}

applications/content/src/main/java/org/apache/ofbiz/content/webapp/ftl/RenderSubContentCacheTransform.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public Writer getWriter(Writer out, @SuppressWarnings("rawtypes") Map args) {
7373
String strNullThruDatesOnly = (String) templateRoot.get("nullThruDatesOnly");
7474
Boolean nullThruDatesOnly = (strNullThruDatesOnly != null && "true".equalsIgnoreCase(strNullThruDatesOnly)) ? Boolean.TRUE : Boolean.FALSE;
7575
String thisSubContentId = (String) templateRoot.get("subContentId");
76-
final boolean directAssocMode = UtilValidate.isNotEmpty(thisSubContentId) ? true : false;
76+
final boolean directAssocMode = UtilValidate.isNotEmpty(thisSubContentId);
7777
GenericValue val = null;
7878
try {
7979
val = ContentWorker.getCurrentContent(delegator, trail, userLogin, templateRoot, nullThruDatesOnly, contentAssocPredicateId);

applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public static Map<String, Object> checkRoutingTaskAssoc(DispatchContext ctx, Map
119119
Timestamp thruDate = (Timestamp) context.get("thruDate");
120120
String create = (String) context.get("create");
121121

122-
boolean createProcess = (create != null && "Y".equals(create)) ? true : false;
122+
boolean createProcess = "Y".equals(create);
123123
List<GenericValue> listRoutingTaskAssoc = null;
124124

125125
try {

applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ public static String determineNextFinalizeStep(HttpServletRequest request, HttpS
10501050
requireTerm = requireTermStr == null || "true".equalsIgnoreCase(requireTermStr);
10511051
}
10521052
requireAdditionalParty = requireAdditionalPartyStr == null || "true".equalsIgnoreCase(requireAdditionalPartyStr);
1053-
isSingleUsePayment = singleUsePaymentStr != null && "Y".equalsIgnoreCase(singleUsePaymentStr) ? true : false;
1053+
isSingleUsePayment = "Y".equalsIgnoreCase(singleUsePaymentStr);
10541054
}
10551055

10561056
boolean shippingAddressSet = true;

applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public static String restoreAutoSaveList(HttpServletRequest request, HttpServlet
535535

536536
// check to see if we are okay to load this list
537537
java.sql.Timestamp lastLoad = cart.getLastListRestore();
538-
boolean okayToLoad = autoSaveListId == null ? false : (lastLoad == null ? true : false);
538+
boolean okayToLoad = autoSaveListId != null && lastLoad == null;
539539
if (!okayToLoad && lastLoad != null) {
540540
GenericValue shoppingList = null;
541541
try {

0 commit comments

Comments
 (0)