Author: diveshdutta
Date: Sat Nov 5 11:27:46 2016
New Revision: 1768192
URL: http://svn.apache.org/viewvc?rev=1768192&view=rev
Log:
Improvement: Generic value is null or not should be checked using native
checks. Utility method isEmpty or isNotEmpty is not needed to check if generic
value is null or not because generic values can never be empty. They can be
null or not nulls. So made changes accordingly all over the places.
(OFBIZ-8471)
Thanks: Ratnesh Upadhyay for reporting the improvement and providing the patch.
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/GlEvents.java
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/period/PeriodServices.java
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
ofbiz/trunk/applications/humanres/src/main/java/org/apache/ofbiz/humanres/HumanResEvents.java
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
ofbiz/trunk/applications/marketing/src/main/java/org/apache/ofbiz/sfa/vcard/VCard.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyRelationshipServices.java
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyTypeHelper.java
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlFilter.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlServlet.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreEvents.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/usps/UspsServices.java
ofbiz/trunk/applications/securityext/src/main/java/org/apache/ofbiz/securityext/login/LoginEvents.java
ofbiz/trunk/framework/entity/src/main/java/org/apache/ofbiz/entity/util/EntityUtilProperties.java
ofbiz/trunk/framework/service/src/main/java/org/apache/ofbiz/service/mail/JavaMailContainer.java
ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/portal/PortalPageWorker.java
ofbiz/trunk/specialpurpose/cmssite/src/main/java/org/apache/ofbiz/cmssite/multisite/WebSiteFilter.java
ofbiz/trunk/specialpurpose/ebay/src/main/java/org/apache/ofbiz/ebay/EbayHelper.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayEvents.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStore.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreAutoPreferences.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreHelper.java
ofbiz/trunk/specialpurpose/ebaystore/src/main/java/org/apache/ofbiz/ebaystore/EbayStoreOrder.java
ofbiz/trunk/specialpurpose/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java
ofbiz/trunk/specialpurpose/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java
ofbiz/trunk/specialpurpose/passport/src/main/java/org/apache/ofbiz/passport/user/LinkedInAuthenticator.java
ofbiz/trunk/specialpurpose/scrum/src/main/java/org/apache/ofbiz/scrum/ScrumServices.java
ofbiz/trunk/specialpurpose/webpos/src/main/java/org/apache/ofbiz/webpos/WebPosEvents.java
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/GlEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/GlEvents.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/GlEvents.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/GlEvents.java
Sat Nov 5 11:27:46 2016
@@ -66,7 +66,7 @@ public static String createReconcileAcco
glAccountId = (String) ctx.get("glAccountId" + suffix);
try {
GenericValue acctgTransEntry =
EntityQuery.use(delegator).from("AcctgTransEntry").where("acctgTransId",
acctgTransId, "acctgTransEntrySeqId", acctgTransEntrySeqId).queryOne();
- if (UtilValidate.isNotEmpty(acctgTransEntry)) {
+ if (acctgTransEntry != null) {
//calculate amount for each AcctgTransEntry according to
glAccountId based on debit and credit
debitCreditFlag = acctgTransEntry.getString("debitCreditFlag");
if ("D".equalsIgnoreCase(debitCreditFlag)) {
@@ -104,7 +104,7 @@ public static String createReconcileAcco
acctgTransEntrySeqId = (String) ctx.get("acctgTransEntrySeqId" +
suffix);
try {
GenericValue acctgTransEntry =
EntityQuery.use(delegator).from("AcctgTransEntry").where("acctgTransId",
acctgTransId, "acctgTransEntrySeqId", acctgTransEntrySeqId).queryOne();
- if (UtilValidate.isNotEmpty(acctgTransEntry)) {
+ if (acctgTransEntry != null ) {
reconciledAmount = acctgTransEntry.getString("amount");
acctgTransId = acctgTransEntry.getString("acctgTransId");
acctgTransEntrySeqId =
acctgTransEntry.getString("acctgTransEntrySeqId");
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceWorker.java
Sat Nov 5 11:27:46 2016
@@ -593,7 +593,7 @@ public final class InvoiceWorker {
BigDecimal taxGrandTotal = ZERO;
List<Map<String, Object>> taxByTaxAuthGeoAndPartyList = new
LinkedList<Map<String,Object>>();
List<GenericValue> invoiceItems = null;
- if (UtilValidate.isNotEmpty(invoice)) {
+ if (invoice != null) {
try {
invoiceItems = invoice.getRelated("InvoiceItem", null, null,
false);
} catch (GenericEntityException e) {
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/period/PeriodServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/period/PeriodServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/period/PeriodServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/period/PeriodServices.java
Sat Nov 5 11:27:46 2016
@@ -85,7 +85,7 @@ public class PeriodServices {
findParams.put("periodTypeId", periodTypeId);
}
GenericValue timePeriod =
EntityQuery.use(delegator).from("CustomTimePeriod").where(findParams).orderBy("fromDate
ASC").queryFirst();
- if (UtilValidate.isNotEmpty(timePeriod) &&
UtilValidate.isNotEmpty(timePeriod.get("fromDate"))) {
+ if (timePeriod != null &&
UtilValidate.isNotEmpty(timePeriod.get("fromDate"))) {
lastClosedDate = timePeriod.getTimestamp("fromDate");
} else {
return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
"AccountingPeriodCannotGet", locale));
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
Sat Nov 5 11:27:46 2016
@@ -551,7 +551,7 @@ public class AIMPaymentServices {
String orderId =
UtilFormatOut.checkNull((String)params.get("orderId"));
if (UtilValidate.isEmpty(orderId)) {
GenericValue orderPaymentPreference = (GenericValue)
params.get("orderPaymentPreference");
- if (UtilValidate.isNotEmpty(orderPaymentPreference)) {
+ if (orderPaymentPreference != null) {
orderId = (String) orderPaymentPreference.get("orderId");
}
}
@@ -792,7 +792,7 @@ public class AIMPaymentServices {
if (UtilValidate.isNotEmpty(paymentGatewayConfigId)) {
try {
GenericValue payflowPro =
EntityQuery.use(delegator).from("PaymentGatewayAuthorizeNet").where("paymentGatewayConfigId",
paymentGatewayConfigId).queryOne();
- if (UtilValidate.isNotEmpty(payflowPro)) {
+ if (payflowPro != null) {
Object payflowProField =
payflowPro.get(paymentGatewayConfigParameterName);
if (payflowProField != null) {
returnValue = payflowProField.toString().trim();
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java
Sat Nov 5 11:27:46 2016
@@ -672,7 +672,7 @@ public class IcsPaymentServices {
if (UtilValidate.isNotEmpty(paymentGatewayConfigId)) {
try {
GenericValue cyberSource =
EntityQuery.use(delegator).from("PaymentGatewayCyberSource").where("paymentGatewayConfigId",
paymentGatewayConfigId).queryOne();
- if (UtilValidate.isNotEmpty(cyberSource)) {
+ if (cyberSource != null) {
Object cyberSourceField =
cyberSource.get(paymentGatewayConfigParameterName);
if (cyberSourceField != null) {
returnValue = cyberSourceField.toString().trim();
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/ideal/IdealEvents.java
Sat Nov 5 11:27:46 2016
@@ -404,7 +404,7 @@ public class IdealEvents {
if (UtilValidate.isNotEmpty(paymentGatewayConfigId)) {
try {
GenericValue ideal =
EntityQuery.use(delegator).from("PaymentGatewayiDEAL").where("paymentGatewayConfigId",
paymentGatewayConfigId).queryOne();
- if (UtilValidate.isNotEmpty(ideal)) {
+ if (ideal != null) {
Object idealField =
ideal.get(paymentGatewayConfigParameterName);
if (idealField != null) {
returnValue = idealField.toString().trim();
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
Sat Nov 5 11:27:46 2016
@@ -290,9 +290,9 @@ public class OrbitalPaymentServices {
if (UtilValidate.isNotEmpty(paymentGatewayConfigId)) {
try {
GenericValue paymentGatewayOrbital =
EntityQuery.use(delegator).from("PaymentGatewayOrbital").where("paymentGatewayConfigId",
paymentGatewayConfigId).queryOne();
- if (UtilValidate.isNotEmpty(paymentGatewayOrbital)) {
+ if (paymentGatewayOrbital != null) {
Object paymentGatewayOrbitalField =
paymentGatewayOrbital.get(paymentGatewayConfigParameterName);
- if (UtilValidate.isNotEmpty(paymentGatewayOrbitalField)) {
+ if (paymentGatewayOrbitalField != null) {
return returnValue =
paymentGatewayOrbitalField.toString().trim();
}
}
Modified:
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java
(original)
+++
ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java
Sat Nov 5 11:27:46 2016
@@ -57,7 +57,7 @@ public class SagePayServices
if (UtilValidate.isNotEmpty(paymentGatewayConfigId)) {
try {
GenericValue sagePay =
EntityQuery.use(delegator).from("PaymentGatewaySagePay").where("paymentGatewayConfigId",
paymentGatewayConfigId).queryOne();
- if (UtilValidate.isNotEmpty(sagePay)) {
+ if (sagePay != null) {
Map<String, Object> tmp = sagePay.getAllFields();
Set<String> keys = tmp.keySet();
for (String key : keys) {
Modified:
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
(original)
+++
ofbiz/trunk/applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
Sat Nov 5 11:27:46 2016
@@ -316,7 +316,7 @@ public class CmsEvents {
String siteName = null;
try {
GenericValue content =
EntityQuery.use(delegator).from("Content").where("contentId",
contentId).cache().queryOne();
- if (content != null && UtilValidate.isNotEmpty(content)) {
+ if (content != null &&
UtilValidate.isNotEmpty(content.getString("contentName"))) {
contentName = content.getString("contentName");
} else {
request.setAttribute("_ERROR_MESSAGE_", "Content: " +
contentName + " [" + contentId + "] is not a publish point for the current
website: [" + webSiteId + "]");
Modified:
ofbiz/trunk/applications/humanres/src/main/java/org/apache/ofbiz/humanres/HumanResEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/src/main/java/org/apache/ofbiz/humanres/HumanResEvents.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/humanres/src/main/java/org/apache/ofbiz/humanres/HumanResEvents.java
(original)
+++
ofbiz/trunk/applications/humanres/src/main/java/org/apache/ofbiz/humanres/HumanResEvents.java
Sat Nov 5 11:27:46 2016
@@ -66,7 +66,7 @@ public class HumanResEvents {
try {
GenericValue partyGroup =
EntityQuery.use(delegator).from("PartyGroup").where("partyId",
partyId).queryOne();
- if (UtilValidate.isNotEmpty(partyGroup)) {
+ if (partyGroup != null) {
paramMap.put("partyGroup", partyGroup);
/* get the child departments of company or party */
categoryList.addAll(getChildComps(paramMap));
Modified:
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
(original)
+++
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Sat Nov 5 11:27:46 2016
@@ -1126,16 +1126,16 @@ public class ProductionRunServices {
// Now get the cost information associated to the fixed asset and
compute the costs
GenericValue fixedAsset = workEffort.getRelatedOne("FixedAsset",
false);
- if (UtilValidate.isEmpty(fixedAsset) &&
UtilValidate.isNotEmpty(routingTask)) {
+ if (fixedAsset != null && routingTask != null) {
fixedAsset = routingTask.getRelatedOne("FixedAsset", false);
}
- if (UtilValidate.isNotEmpty(fixedAsset)) {
+ if (fixedAsset != null) {
List<GenericValue> setupCosts =
fixedAsset.getRelated("FixedAssetStdCost",
UtilMisc.toMap("fixedAssetStdCostTypeId",
"SETUP_COST"), null, false);
GenericValue setupCost =
EntityUtil.getFirst(EntityUtil.filterByDate(setupCosts));
List<GenericValue> usageCosts =
fixedAsset.getRelated("FixedAssetStdCost",
UtilMisc.toMap("fixedAssetStdCostTypeId", "USAGE_COST"), null, false);
GenericValue usageCost =
EntityUtil.getFirst(EntityUtil.filterByDate(usageCosts));
- if (UtilValidate.isNotEmpty(setupCost) ||
UtilValidate.isNotEmpty(usageCost)) {
+ if (setupCost != null || usageCost != null) {
String currencyUomId = (setupCost != null?
setupCost.getString("amountUomId"): usageCost.getString("amountUomId"));
BigDecimal setupCostAmount = ZERO;
if (setupCost != null) {
Modified:
ofbiz/trunk/applications/marketing/src/main/java/org/apache/ofbiz/sfa/vcard/VCard.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/main/java/org/apache/ofbiz/sfa/vcard/VCard.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/marketing/src/main/java/org/apache/ofbiz/sfa/vcard/VCard.java
(original)
+++
ofbiz/trunk/applications/marketing/src/main/java/org/apache/ofbiz/sfa/vcard/VCard.java
Sat Nov 5 11:27:46 2016
@@ -254,11 +254,11 @@ public class VCard {
address.setLocality(postalAddress.getString("city"));
address.setPostalCode(postalAddress.getString("postalCode"));
GenericValue state =
postalAddress.getRelatedOne("StateProvinceGeo", false);
- if (UtilValidate.isNotEmpty(state)) {
+ if (state != null) {
address.setRegion(state.getString("geoName"));
}
GenericValue countryGeo =
postalAddress.getRelatedOne("CountryGeo", false);
- if (UtilValidate.isNotEmpty(countryGeo)) {
+ if (countryGeo != null) {
String country = postalAddress.getRelatedOne("CountryGeo",
false).getString("geoName");
address.setCountry(country);
address.getTypes().add(AddressType.WORK);;
@@ -268,7 +268,7 @@ public class VCard {
}
GenericValue telecomNumber =
PartyWorker.findPartyLatestTelecomNumber(partyId, delegator);
- if (UtilValidate.isNotEmpty(telecomNumber)) {
+ if (telecomNumber != null) {
Telephone tel = new
Telephone(telecomNumber.getString("areaCode") +
telecomNumber.getString("contactNumber"));
tel.getTypes().add(TelephoneType.WORK);
vcard.addTelephoneNumber(tel);
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java
Sat Nov 5 11:27:46 2016
@@ -2998,7 +2998,7 @@ public class OrderReadHelper {
public BigDecimal getItemReceivedQuantity(GenericValue orderItem) {
BigDecimal totalReceived = BigDecimal.ZERO;
try {
- if (UtilValidate.isNotEmpty(orderItem)) {
+ if (orderItem != null) {
EntityCondition cond =
EntityCondition.makeCondition(UtilMisc.toList(
EntityCondition.makeCondition("orderId",
orderItem.getString("orderId")),
EntityCondition.makeCondition("quantityAccepted",
EntityOperator.GREATER_THAN, BigDecimal.ZERO),
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
Sat Nov 5 11:27:46 2016
@@ -162,7 +162,7 @@ public class OrderReturnServices {
Debug.logError(e, module);
throw new GeneralRuntimeException(e.getMessage());
}
- if (UtilValidate.isNotEmpty(issue)) {
+ if (issue != null) {
Debug.logInfo("Found item issuance reference", module);
// just use the first one for now; maybe later we can find
a better way to determine which was the
// actual item being returned; maybe by serial number
@@ -736,7 +736,7 @@ public class OrderReturnServices {
if (UtilValidate.isNotEmpty(returnItems)) {
returnItem = EntityUtil.getFirst(returnItems);
}
- if (UtilValidate.isNotEmpty(returnItem)) {
+ if (returnItem != null) {
try {
orderHeader = returnItem.getRelatedOne("OrderHeader",
false);
} catch (GenericEntityException e) {
@@ -822,7 +822,7 @@ public class OrderReturnServices {
} catch (GenericEntityException e) {
return ServiceUtil.returnError(e.getMessage());
}
- if (UtilValidate.isNotEmpty(finAccount)) {
+ if (finAccount != null) {
finAccountId =
finAccount.getString("finAccountId");
}
@@ -1201,7 +1201,7 @@ public class OrderReturnServices {
GenericValue orderItemAssoc =
EntityQuery.use(delegator).from("OrderItemAssoc")
.where("toOrderId",
orderId, "orderItemAssocTypeId", "REPLACEMENT")
.queryFirst();
- if (UtilValidate.isNotEmpty(orderItemAssoc)) {
+ if (orderItemAssoc != null) {
String originalOrderId =
orderItemAssoc.getString("orderId");
orderHeader =
EntityQuery.use(delegator).from("OrderHeader").where("orderId",
originalOrderId).queryOne();
orderPayPrefs =
orderHeader.getRelated("OrderPaymentPreference", null,
UtilMisc.toList("-maxAmount"), false);
@@ -1231,7 +1231,7 @@ public class OrderReturnServices {
}
orgAcctgPref = (GenericValue)
acctgPreferencesResult.get("partyAccountingPreference");
- if (UtilValidate.isNotEmpty(orgAcctgPref)) {
+ if (orgAcctgPref != null) {
try {
orgAcctgPref.getRelatedOne("PaymentMethod", false);
} catch (GenericEntityException e) {
@@ -1420,7 +1420,7 @@ public class OrderReturnServices {
// Fill out the data for the new ReturnItemResponse
Map<String, Object> response = new HashMap<String,
Object>();
- if
(UtilValidate.isNotEmpty(refundOrderPaymentPreference)) {
+ if (refundOrderPaymentPreference != null) {
response.put("orderPaymentPreferenceId",
refundOrderPaymentPreference.getString("orderPaymentPreferenceId"));
} else {
response.put("orderPaymentPreferenceId",
orderPaymentPreference.getString("orderPaymentPreferenceId"));
@@ -1781,16 +1781,16 @@ public class OrderReturnServices {
GenericValue refurbItem = null;
if
("CUSTOMER_RETURN".equals(returnHeaderTypeId)) {
try {
- if (UtilValidate.isNotEmpty(product)) {
+ if (product != null) {
GenericValue refurbItemAssoc =
EntityUtil.getFirst(EntityUtil.filterByDate(product.getRelated("MainProductAssoc",
UtilMisc.toMap("productAssocTypeId", "PRODUCT_REFURB"),
UtilMisc.toList("sequenceNum"), false)));
- if
(UtilValidate.isNotEmpty(refurbItemAssoc)) {
+ if (refurbItemAssoc != null) {
refurbItem =
refurbItemAssoc.getRelatedOne("AssocProduct", false);
}
}
} catch (GenericEntityException e) {
Debug.logError(e, module);
}
- if (UtilValidate.isNotEmpty(refurbItem)) {
+ if (refurbItem != null) {
boolean inventoryAvailable = false;
try {
Map<String, Object> invReqResult =
dispatcher.runSync("isStoreInventoryAvailable",
UtilMisc.toMap("productStoreId", orderHeader.get("productStoreId"),
@@ -1864,7 +1864,7 @@ public class OrderReturnServices {
if ("RTN_REPAIR_REPLACE".equals(returnTypeId))
{
List<GenericValue> repairItems = null;
try {
- if (UtilValidate.isNotEmpty(product)) {
+ if (product != null) {
repairItems =
EntityUtil.filterByDate(product.getRelated("MainProductAssoc",
UtilMisc.toMap("productAssocTypeId", "PRODUCT_REPAIR_SRV"),
UtilMisc.toList("sequenceNum"), false));
}
} catch (GenericEntityException e) {
@@ -1880,7 +1880,7 @@ public class OrderReturnServices {
Debug.logError(e, module);
continue;
}
- if
(UtilValidate.isNotEmpty(repairItemProduct)) {
+ if (repairItemProduct != null) {
BigDecimal repairUnitQuantity
= repairItem.getBigDecimal("quantity");
if
(UtilValidate.isEmpty(repairUnitQuantity)) {
repairUnitQuantity =
BigDecimal.ONE;
@@ -1937,7 +1937,7 @@ public class OrderReturnServices {
newItem.set("statusId",
"ITEM_CREATED");
orderItems.add(newItem);
additionalItemTotal =
additionalItemTotal.add(repairQuantity.multiply(repairUnitPrice));
- if
(UtilValidate.isNotEmpty(orderItemShipGroupAssoc)) {
+ if (orderItemShipGroupAssoc !=
null) {
GenericValue
newOrderItemShipGroupAssoc = delegator.makeValue("OrderItemShipGroupAssoc",
UtilMisc.toMap("orderItemSeqId", newItem.getString("orderItemSeqId"),
"shipGroupSeqId", orderItemShipGroupAssoc.getString("shipGroupSeqId"),
"quantity", repairQuantity));
orderItemShipGroupInfo.add(newOrderItemShipGroupAssoc);
}
@@ -1982,7 +1982,7 @@ public class OrderReturnServices {
} catch (GenericEntityException e) {
Debug.logError(e, module);
}
- if (UtilValidate.isNotEmpty(paymentMethod)) {
+ if (paymentMethod != null) {
String paymentMethodId =
paymentMethod.getString("paymentMethodId");
String paymentMethodTypeId =
paymentMethod.getString("paymentMethodTypeId");
GenericValue opp =
delegator.makeValue("OrderPaymentPreference");
@@ -2381,7 +2381,7 @@ public class OrderReturnServices {
returnItem =
EntityQuery.use(delegator).from("ReturnItem")
.where("returnId", returnId, "orderId",
orderAdjustment.getString("orderId"), "orderItemSeqId",
orderAdjustment.getString("orderItemSeqId"))
.queryFirst();
- if (UtilValidate.isNotEmpty(returnItem)) {
+ if (returnItem != null) {
orderItem = returnItem.getRelatedOne("OrderItem",
false);
}
}
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
Sat Nov 5 11:27:46 2016
@@ -123,7 +123,7 @@ public class OrderServices {
if (UtilValidate.isEmpty(orderParty)) {
orderParty = orh.getPlacingParty();
}
- if (UtilValidate.isNotEmpty(orderParty)) {
+ if (orderParty != null) {
partyId = orderParty.getString("partyId");
}
boolean hasPermission = hasPermission(orderTypeId, partyId, userLogin,
action, security);
@@ -4348,7 +4348,7 @@ public class OrderServices {
Debug.logError(e, module);
throw new GeneralException(e.getMessage());
}
- if (UtilValidate.isNotEmpty(oldOrderItem)) {
+ if (oldOrderItem != null) {
// Existing order item found. Check for modifications and
store if any
String oldItemDescription =
oldOrderItem.getString("itemDescription") != null ?
oldOrderItem.getString("itemDescription") : "";
@@ -5796,14 +5796,14 @@ public class OrderServices {
String orderId= (String) context.get("orderId");
GenericValue orderHeader =
EntityQuery.use(delegator).from("OrderHeader").where("orderId",
orderId).queryOne();
String shipGroupSeqId= (String) context.get("shipGroupSeqId");
- if (UtilValidate.isNotEmpty(orderHeader) &&
UtilValidate.isNotEmpty(shipGroupSeqId)) {
+ if (orderHeader != null &&
UtilValidate.isNotEmpty(shipGroupSeqId)) {
orderItemShipGroup =
EntityQuery.use(delegator).from("OrderItemShipGroup").where("orderId", orderId,
"shipGroupSeqId", shipGroupSeqId).queryOne();
if (UtilValidate.isEmpty(orderItemShipGroup)) {
return
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
"OrderItemShipGroupDoesNotExist", locale));
}
}
}
- if (UtilValidate.isNotEmpty(orderItemShipGroup)) {
+ if (orderItemShipGroup != null) {
orderItemShipGroup.remove();
result.put(ModelService.RESPONSE_MESSAGE,
ModelService.RESPOND_SUCCESS);
}
@@ -5848,7 +5848,7 @@ public class OrderServices {
if (UtilValidate.isNotEmpty(oisgas)) {
GenericValue oisga = EntityUtil.getFirst(oisgas);
GenericValue oisg =
oisga.getRelatedOne("OrderItemShipGroup", false);
- if (UtilValidate.isNotEmpty(oisg)) {
+ if (oisg != null) {
addOrderItemShipGroupMap.put("shipmentMethodTypeId",
oisg.get("shipmentMethodTypeId"));
addOrderItemShipGroupMap.put("carrierPartyId",
oisg.get("carrierPartyId"));
addOrderItemShipGroupMap.put("carrierRoleTypeId",
oisg.get("carrierRoleTypeId"));
@@ -5879,7 +5879,7 @@ public class OrderServices {
}
//test if this association already exist if yes display error
GenericValue oisgAssoc =
EntityQuery.use(delegator).from("OrderItemShipGroupAssoc").where("orderId",
orderId, "orderItemSeqId", orderItem.get("orderItemSeqId"), "shipGroupSeqId",
shipGroupSeqId).queryOne();
- if (UtilValidate.isNotEmpty(oisgAssoc)) {
+ if (oisgAssoc != null) {
String errMsg = mainErrorMessage +
UtilProperties.getMessage(resource_error,
"OrderErrorOrderItemAlreadyRelatedToShipGroup", locale);
return ServiceUtil.returnError(errMsg);
}
@@ -6020,7 +6020,7 @@ public class OrderServices {
oisga.store();
// reserve the inventory
GenericValue orderHeader =
EntityQuery.use(delegator).from("OrderHeader").where("orderId",
orderId).queryOne();
- if (UtilValidate.isNotEmpty(orderHeader)) {
+ if (orderHeader != null) {
Map<String, Object> cancelResp =
dispatcher.runSync("cancelOrderInventoryReservation",
UtilMisc.toMap("userLogin", userLogin, "orderId", orderId, "orderItemSeqId",
orderItemSeqId, "shipGroupSeqId", shipGroupSeqId ));
if (ServiceUtil.isError(cancelResp)) {
throw new
GeneralException(ServiceUtil.getErrorMessage(cancelResp));
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
Sat Nov 5 11:27:46 2016
@@ -340,7 +340,7 @@ public class RequirementServices {
GenericValue orderRequirementCommitment =
EntityQuery.use(delegator).from("OrderRequirementCommitment")
.where(UtilMisc.toMap("orderId", orderId,
"orderItemSeqId", orderItem.getString("orderItemSeqId")))
.queryFirst();
- if (UtilValidate.isNotEmpty(orderRequirementCommitment)) {
+ if (orderRequirementCommitment != null) {
String requirementId =
orderRequirementCommitment.getString("requirementId");
/* Change status of requirement to ordered */
Map<String, Object> inputMap = UtilMisc.<String,
Object>toMap("userLogin", userLogin, "requirementId", requirementId,
"statusId", "REQ_ORDERED", "quantity", orderItem.getBigDecimal("quantity"));
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
Sat Nov 5 11:27:46 2016
@@ -1151,7 +1151,7 @@ public class CheckOutEvents {
.where("orderId",
originalOrderId, "isPromo", sci.getIsPromo() ? "Y" : "N",
"productId",
sci.getProductId(), "orderItemTypeId", sci.getItemType())
.queryFirst();
- if (UtilValidate.isNotEmpty(orderItem)) {
+ if (orderItem != null) {
sci.setAssociatedOrderId(orderItem.getString("orderId"));
sci.setAssociatedOrderItemSeqId(orderItem.getString("orderItemSeqId"));
sci.setOrderItemAssocTypeId("REPLACEMENT");
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
Sat Nov 5 11:27:46 2016
@@ -2252,7 +2252,7 @@ public class ShoppingCart implements Ite
if (UtilValidate.isNotEmpty(shipItems)) {
for (ShoppingCartItem cartItem : shipItems) {
GenericValue product = cartItem.getProduct();
- if (UtilValidate.isNotEmpty(product)) {
+ if (product != null) {
if (!ProductWorker.isShippableToAddress(product,
shippingAddress)) {
throw new IllegalArgumentException("The
shipping address is not compatible with ProductGeos rules.");
}
@@ -4675,7 +4675,7 @@ public class ShoppingCart implements Ite
}
if (shippingAddress != null) {
GenericValue product = item.getProduct();
- if (UtilValidate.isNotEmpty(product)) {
+ if (product != null) {
return ProductWorker.isShippableToAddress(product,
shippingAddress);
}
}
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
Sat Nov 5 11:27:46 2016
@@ -218,7 +218,7 @@ public class ShoppingCartHelper {
} catch (GenericEntityException gee) {
Debug.logError(gee, module);
}
- if (UtilValidate.isNotEmpty(productFeatureAndAppl)) {
+ if (productFeatureAndAppl != null) {
productFeatureAndAppl.set("productFeatureApplTypeId",
"STANDARD_FEATURE");
}
additionalFeaturesMap.put(selectedFeatureType,
productFeatureAndAppl);
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
Sat Nov 5 11:27:46 2016
@@ -1177,7 +1177,7 @@ public class ShoppingCartItem implements
this.setBasePrice(configWrapper.getTotalPrice());
// Check if price display with taxes
GenericValue productStore =
ProductStoreWorker.getProductStore(cart.getProductStoreId(), delegator);
- if (UtilValidate.isNotEmpty(productStore) &&
"Y".equals(productStore.get("showPricesWithVatTax"))) {
+ if (productStore != null &&
"Y".equals(productStore.get("showPricesWithVatTax"))) {
BigDecimal totalPrice =
configWrapper.getTotalPrice();
// Get Taxes
Map<String, Object> totalPriceWithTaxMap =
dispatcher.runSync("calcTaxForDisplay", UtilMisc.toMap("basePrice", totalPrice,
"productId", this.productId, "productStoreId", cart.getProductStoreId()));
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
Sat Nov 5 11:27:46 2016
@@ -448,7 +448,7 @@ public class ShoppingCartServices {
.where("productAssocTypeId", "PRODUCT_CONF", "productIdTo",
product.getString("productId"))
.filterByDate()
.queryFirst();
- if (UtilValidate.isNotEmpty(productAssoc)) {
+ if (productAssoc != null) {
productId =
productAssoc.getString("productId");
configId = product.getString("configId");
}
@@ -1170,7 +1170,7 @@ public class ShoppingCartServices {
cart.positionItemToGroup(item, item.getQuantity(), 0,
index, true);
}
}
- if (UtilValidate.isNotEmpty(vendorProduct)) {
+ if (vendorProduct != null) {
String vendorPartyId =
vendorProduct.getString("vendorPartyId");
if (vendorMap.containsKey(vendorPartyId)) {
index = ((Integer)
vendorMap.get(vendorPartyId)).intValue();
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
Sat Nov 5 11:27:46 2016
@@ -689,7 +689,7 @@ public final class ProductPromoWorker {
if
("PPIP_PARTY_CLASS".equalsIgnoreCase(productPromoCond.getString("inputParamEnumId")))
{
GenericValue partyClassificationGroup =
EntityQuery.use(delegator).from("PartyClassificationGroup").where("partyClassificationGroupId",
condValue).cache(true).queryOne();
- if (UtilValidate.isNotEmpty(partyClassificationGroup) &&
UtilValidate.isNotEmpty(partyClassificationGroup.getString("description"))) {
+ if (partyClassificationGroup != null &&
UtilValidate.isNotEmpty(partyClassificationGroup.getString("description"))) {
condValue =
partyClassificationGroup.getString("description");
}
@@ -1106,7 +1106,7 @@ public final class ProductPromoWorker {
} else if ("PPIP_GEO_ID".equals(inputParamEnumId)) {
compareBase = Integer.valueOf(1);
GenericValue shippingAddress = cart.getShippingAddress();
- if (UtilValidate.isNotEmpty(condValue) &&
UtilValidate.isNotEmpty(shippingAddress)) {
+ if (UtilValidate.isNotEmpty(condValue) && shippingAddress != null)
{
if(condValue.equals(shippingAddress.getString("countryGeoId"))
|| condValue.equals(shippingAddress.getString("countyGeoId"))
||
condValue.equals(shippingAddress.getString("postalCodeGeoId")) ||
condValue.equals(shippingAddress.getString("stateProvinceGeoId"))) {
compareBase = Integer.valueOf(0);
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEstimateWrapper.java
Sat Nov 5 11:27:46 2016
@@ -80,7 +80,7 @@ public class ShippingEstimateWrapper {
try {
for (ShoppingCartItem item :
cart.getShipGroupItems(shipGroup).keySet()) {
GenericValue allowanceProductPrice =
EntityQuery.use(delegator).from("ProductPrice").where("productPriceTypeId",
"SHIPPING_ALLOWANCE", "productId",
item.getProductId()).filterByDate().queryFirst();
- if (UtilValidate.isNotEmpty(allowanceProductPrice) &&
UtilValidate.isNotEmpty(allowanceProductPrice.get("price"))) {
+ if (allowanceProductPrice != null &&
UtilValidate.isNotEmpty(allowanceProductPrice.get("price"))) {
totalAllowance =
totalAllowance.add(allowanceProductPrice.getBigDecimal("price")).multiply(item.getQuantity());
}
}
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
Sat Nov 5 11:27:46 2016
@@ -124,7 +124,7 @@ public class ShippingEvents {
String contactMechId = shipAddr.getString("contactMechId");
String partyId = null;
GenericValue partyObject = orh.getPlacingParty();
- if (UtilValidate.isNotEmpty(partyObject)) {
+ if (partyObject != null) {
partyId = partyObject.getString("partyId");
}
return getShipGroupEstimate(dispatcher, delegator,
orh.getOrderTypeId(), shipmentMethodTypeId, carrierPartyId, carrierRoleTypeId,
@@ -298,7 +298,7 @@ public class ShippingEvents {
GenericValue customMethod = null;
try {
customMethod =
EntityQuery.use(delegator).from("CustomMethod").where("customMethodId",
shipmentCustomMethodId).queryOne();
- if (UtilValidate.isNotEmpty(customMethod)) {
+ if (customMethod != null) {
serviceName = customMethod.getString("customMethodName");
}
} catch (GenericEntityException e) {
Modified:
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java
(original)
+++
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java
Sat Nov 5 11:27:46 2016
@@ -632,7 +632,7 @@ public class ShoppingListEvents {
Cookie[] cookies = request.getCookies();
// check userLogin
- if (UtilValidate.isNotEmpty(userLogin)) {
+ if (userLogin != null) {
String partyId = userLogin.getString("partyId");
if (UtilValidate.isEmpty(partyId)) {
return "success";
Modified:
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java
(original)
+++
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/communication/CommunicationEventServices.java
Sat Nov 5 11:27:46 2016
@@ -170,7 +170,7 @@ public class CommunicationEventServices
continue;
}
GenericValue contactMech =
commRole.getRelatedOne("ContactMech", false);
- if (UtilValidate.isNotEmpty(contactMech) &&
UtilValidate.isNotEmpty(contactMech.getString("infoString"))) {
+ if (contactMech != null &&
UtilValidate.isNotEmpty(contactMech.getString("infoString"))) {
if
("ADDRESSEE".equals(commRole.getString("roleTypeId"))) {
sendTo += "," +
contactMech.getString("infoString");
} else if
("CC".equals(commRole.getString("roleTypeId"))) {
@@ -377,7 +377,7 @@ public class CommunicationEventServices
GenericValue contactListPartyStatus =
EntityQuery.use(delegator).from("ContactListPartyStatus")
.where("contactListId", contactListId, "partyId",
contactListPartyAndContactMech.getString("partyId"), "fromDate",
contactListPartyAndContactMech.getTimestamp("fromDate"), "statusId",
"CLPT_ACCEPTED")
.queryFirst();
- if (UtilValidate.isNotEmpty(contactListPartyStatus)) {
+ if (contactListPartyStatus != null) {
// prepare body parameters
Map<String, Object> bodyParameters = new
HashMap<String, Object>();
bodyParameters.put("contactListId", contactListId);
@@ -390,12 +390,12 @@ public class CommunicationEventServices
NotificationServices.setBaseUrl(delegator,
contactList.getString("verifyEmailWebSiteId"), bodyParameters);
GenericValue webSite =
EntityQuery.use(delegator).from("WebSite").where("webSiteId",
contactList.getString("verifyEmailWebSiteId")).queryOne();
- if (UtilValidate.isNotEmpty(webSite)) {
+ if (webSite != null) {
GenericValue productStore =
webSite.getRelatedOne("ProductStore", false);
- if (UtilValidate.isNotEmpty(productStore)) {
+ if (productStore != null) {
List<GenericValue> productStoreEmailSettings =
productStore.getRelated("ProductStoreEmailSetting", UtilMisc.toMap("emailType",
"CONT_EMAIL_TEMPLATE"), null, false);
GenericValue productStoreEmailSetting =
EntityUtil.getFirst(productStoreEmailSettings);
- if
(UtilValidate.isNotEmpty(productStoreEmailSetting)) {
+ if (productStoreEmailSetting != null) {
// send e-mail using screen template
sendMailParams.put("bodyScreenUri",
productStoreEmailSetting.getString("bodyScreenLocation"));
sendMailParams.put("bodyParameters",
bodyParameters);
Modified:
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyRelationshipServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyRelationshipServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyRelationshipServices.java
(original)
+++
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyRelationshipServices.java
Sat Nov 5 11:27:46 2016
@@ -145,7 +145,7 @@ public class PartyRelationshipServices {
.where(sideChecked, partyId, "roleTypeIdFrom",
roleTypeIdFrom, "roleTypeIdTo", roleTypeIdTo, "partyRelationshipTypeId",
partyRelationshipTypeId)
.filterByDate()
.queryFirst();
- if (UtilValidate.isNotEmpty(oldPartyRelationShip)) {
+ if (oldPartyRelationShip != null) {
oldPartyRelationShip.setFields(UtilMisc.toMap("thruDate",
UtilDateTime.nowTimestamp())); // Current becomes inactive
oldPartyRelationShip.store();
}
Modified:
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyTypeHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyTypeHelper.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyTypeHelper.java
(original)
+++
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyTypeHelper.java
Sat Nov 5 11:27:46 2016
@@ -48,7 +48,7 @@ public final class PartyTypeHelper {
GenericValue checkedTypeOfParty = null;
try {
party = EntityQuery.use(delegator).from("Party").where("partyId",
partyId).queryOne();
- if (UtilValidate.isNotEmpty(party)) {
+ if (party != null) {
partyType = party.getRelatedOne("PartyType", true);
checkedTypeOfParty =
EntityQuery.use(delegator).from("PartyType").where("partyTypeId",
checkedPartyType).cache().queryOne();
} else {
Modified:
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java
(original)
+++
ofbiz/trunk/applications/party/src/main/java/org/apache/ofbiz/party/party/PartyWorker.java
Sat Nov 5 11:27:46 2016
@@ -508,7 +508,7 @@ public class PartyWorker {
party = EntityQuery.use(delegator).from("Party").where("partyId",
idToFind).cache().queryOne();
}
- if (UtilValidate.isNotEmpty(party)) {
+ if (party != null) {
if (UtilValidate.isNotEmpty(partiesFound)) partiesFound.add(party);
else partiesFound = UtilMisc.toList(party);
}
@@ -523,7 +523,7 @@ public class PartyWorker {
public static String findPartyId(Delegator delegator, String idToFind,
String partyIdentificationTypeId) throws GenericEntityException {
GenericValue party = findParty(delegator, idToFind,
partyIdentificationTypeId);
- if (UtilValidate.isNotEmpty(party)) {
+ if (party != null) {
return party.getString("partyId");
} else {
return null;
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlFilter.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlFilter.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlFilter.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlFilter.java
Sat Nov 5 11:27:46 2016
@@ -98,7 +98,7 @@ public class CatalogUrlFilter implements
if
(UtilValidate.isNotEmpty(ContentAssocDataResourceViewTos)) {
for (GenericValue
ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
GenericValue ElectronicText =
ContentAssocDataResourceViewTo.getRelatedOne("ElectronicText", true);
- if
(UtilValidate.isNotEmpty(ElectronicText)) {
+ if (ElectronicText != null) {
String textData = (String)
ElectronicText.get("textData");
textData =
UrlServletHelper.invalidCharacter(textData);
if (alternativeUrl.matches(textData +
".+$")) {
@@ -153,7 +153,7 @@ public class CatalogUrlFilter implements
if
(UtilValidate.isNotEmpty(ContentAssocDataResourceViewTos)) {
for (GenericValue
ContentAssocDataResourceViewTo : ContentAssocDataResourceViewTos) {
GenericValue ElectronicText =
ContentAssocDataResourceViewTo.getRelatedOne("ElectronicText", true);
- if
(UtilValidate.isNotEmpty(ElectronicText)) {
+ if (ElectronicText != null) {
String textData = (String)
ElectronicText.get("textData");
if (UtilValidate.isNotEmpty(textData))
{
textData =
UrlServletHelper.invalidCharacter(textData);
@@ -175,7 +175,7 @@ public class CatalogUrlFilter implements
List<GenericValue> contentDataResourceViews =
EntityQuery.use(delegator).from("ContentDataResourceView").where("contentId",
contentId, "drDataResourceTypeId", "ELECTRONIC_TEXT").cache(true).queryList();
for (GenericValue contentDataResourceView :
contentDataResourceViews) {
GenericValue ElectronicText =
contentDataResourceView.getRelatedOne("ElectronicText", true);
- if
(UtilValidate.isNotEmpty(ElectronicText)) {
+ if (ElectronicText != null) {
String textData = (String)
ElectronicText.get("textData");
if (UtilValidate.isNotEmpty(textData))
{
textData =
UrlServletHelper.invalidCharacter(textData);
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlServlet.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlServlet.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlServlet.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CatalogUrlServlet.java
Sat Nov 5 11:27:46 2016
@@ -93,7 +93,7 @@ public class CatalogUrlServlet extends H
productId = lastPathElement.substring(2);
} else {
GenericValue productCategory =
EntityQuery.use(delegator).from("ProductCategory").where("productCategoryId",
lastPathElement).cache(true).queryOne();
- if (UtilValidate.isNotEmpty(productCategory)) {
+ if (productCategory != null) {
categoryId = lastPathElement;
} else {
productId = lastPathElement;
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/category/CategoryServices.java
Sat Nov 5 11:27:46 2016
@@ -466,7 +466,7 @@ public class CategoryServices {
try {
GenericValue category =
EntityQuery.use(delegator).from(entityName).where(primaryKeyName,
productCategoryId).queryOne();
- if (UtilValidate.isNotEmpty(category)) {
+ if (category != null) {
if (isCatalog.equals("true") &&
isCategoryType.equals("false")) {
CategoryWorker.getRelatedCategories(request,
"ChildCatalogList", CatalogWorker.getCatalogTopCategoryId(request,
productCategoryId), true);
childOfCats = EntityUtil.filterByDate((List<GenericValue>)
request.getAttribute("ChildCatalogList"));
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/price/PriceServices.java
Sat Nov 5 11:27:46 2016
@@ -142,7 +142,7 @@ public class PriceServices {
String currencyDefaultUomId = (String) context.get("currencyUomId");
String currencyUomIdTo = (String) context.get("currencyUomIdTo");
if (UtilValidate.isEmpty(currencyDefaultUomId)) {
- if (UtilValidate.isNotEmpty(productStore) &&
UtilValidate.isNotEmpty(productStore.getString("defaultCurrencyUomId"))) {
+ if (productStore != null &&
UtilValidate.isNotEmpty(productStore.getString("defaultCurrencyUomId"))) {
currencyDefaultUomId =
productStore.getString("defaultCurrencyUomId");
} else {
currencyDefaultUomId =
EntityUtilProperties.getPropertyValue("general", "currency.uom.id.default",
"USD", delegator);
@@ -344,7 +344,7 @@ public class PriceServices {
} catch (GenericEntityException gee) {
Debug.logError(gee, "An error occurred while getting the
customPriceCalcService", module);
}
- if (UtilValidate.isNotEmpty(customMethod) &&
UtilValidate.isNotEmpty(customMethod.getString("customMethodName"))) {
+ if (customMethod != null &&
UtilValidate.isNotEmpty(customMethod.getString("customMethodName"))) {
Map<String, Object> inMap = UtilMisc.toMap("userLogin",
context.get("userLogin"), "product", product);
inMap.put("initialPrice",
defaultPriceValue.getBigDecimal("price"));
inMap.put("currencyUomId", currencyDefaultUomId);
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductContentWrapper.java
Sat Nov 5 11:27:46 2016
@@ -163,7 +163,7 @@ public class ProductContentWrapper imple
List<GenericValue> productContentList =
EntityQuery.use(delegator).from("ProductContent").where("productId", productId,
"productContentTypeId",
productContentTypeId).orderBy("-fromDate").cache(cache).filterByDate().queryList();
if (UtilValidate.isEmpty(productContentList) &&
("Y".equals(product.getString("isVariant")))) {
GenericValue parent = ProductWorker.getParentProduct(productId,
delegator);
- if (UtilValidate.isNotEmpty(parent)) {
+ if (parent != null) {
productContentList =
EntityQuery.use(delegator).from("ProductContent").where("productId",
parent.get("productId"), "productContentTypeId",
productContentTypeId).orderBy("-fromDate").cache(cache).filterByDate().queryList();
}
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductPromoContentWrapper.java
Sat Nov 5 11:27:46 2016
@@ -149,11 +149,11 @@ public class ProductPromoContentWrapper
}
public static void getProductPromoContentAsText(String productPromoId,
GenericValue productPromo, String productPromoContentTypeId, Locale locale,
String mimeTypeId, String partyId, String roleTypeId, Delegator delegator,
LocalDispatcher dispatcher, Writer outWriter, boolean cache) throws
GeneralException, IOException {
- if (UtilValidate.isEmpty(productPromoId) &&
UtilValidate.isNotEmpty(productPromo)) {
+ if (UtilValidate.isEmpty(productPromoId) && productPromo != null) {
productPromoId = productPromo.getString("productPromoId");
}
- if (UtilValidate.isEmpty(delegator) &&
UtilValidate.isNotEmpty(productPromo)) {
+ if (UtilValidate.isEmpty(delegator) && productPromo != null) {
delegator = productPromo.getDelegator();
}
@@ -175,7 +175,7 @@ public class ProductPromoContentWrapper
productPromoContent =
EntityUtil.getFirst(EntityUtil.filterByDate(productPromoContentList));
}
- if (UtilValidate.isNotEmpty(productPromoContent)) {
+ if (productPromoContent != null) {
// when rendering the product promo content, always include the
ProductPromo and ProductPromoContent records that this comes from
Map<String, Object> inContext = new HashMap<String, Object>();
inContext.put("productPromo", productPromo);
@@ -190,7 +190,7 @@ public class ProductPromoContentWrapper
if (UtilValidate.isEmpty(productPromo)) {
productPromo =
EntityQuery.use(delegator).from("ProductPromo").where("productPromoId",
productPromoId).cache().queryOne();
}
- if (UtilValidate.isNotEmpty(productPromo)) {
+ if (productPromo != null) {
String candidateValue =
productPromo.getString(candidateFieldName);
if (UtilValidate.isNotEmpty(candidateValue)) {
outWriter.write(candidateValue);
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
Sat Nov 5 11:27:46 2016
@@ -1323,7 +1323,7 @@ public class ProductServices {
return ServiceUtil.returnError(e.getMessage());
}
- if (UtilValidate.isNotEmpty(content)) {
+ if (content != null) {
GenericValue dataResource = null;
try {
dataResource =
content.getRelatedOne("DataResource", false);
@@ -1332,7 +1332,7 @@ public class ProductServices {
return ServiceUtil.returnError(e.getMessage());
}
- if (UtilValidate.isNotEmpty(dataResource)) {
+ if (dataResource != null) {
dataResourceCtx.put("dataResourceId",
dataResource.getString("dataResourceId"));
try {
dispatcher.runSync("updateDataResource",
dataResourceCtx);
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductWorker.java
Sat Nov 5 11:27:46 2016
@@ -89,7 +89,7 @@ public final class ProductWorker {
return isAllowedToAddress(product, postalAddress, "PG_SHIP_");
}
private static boolean isAllowedToAddress(GenericValue product,
GenericValue postalAddress, String productGeoPrefix) {
- if (UtilValidate.isNotEmpty(product) &&
UtilValidate.isNotEmpty(postalAddress)) {
+ if (product != null && postalAddress != null) {
Delegator delegator = product.getDelegator();
List<GenericValue> productGeos = null;
try {
@@ -134,7 +134,7 @@ public final class ProductWorker {
public static boolean isSerialized (Delegator delegator, String productId)
{
try {
GenericValue product =
EntityQuery.use(delegator).from("Product").where("productId",
productId).cache().queryOne();
- if (UtilValidate.isNotEmpty(product)) {
+ if (product != null) {
return
"SERIALIZED_INV_ITEM".equals(product.getString("inventoryItemTypeId"));
}
} catch (GenericEntityException e) {
@@ -161,9 +161,9 @@ public final class ProductWorker {
public static String getInstanceAggregatedId(Delegator delegator, String
instanceProductId) throws GenericEntityException {
GenericValue instanceProduct =
EntityQuery.use(delegator).from("Product").where("productId",
instanceProductId).queryOne();
- if (UtilValidate.isNotEmpty(instanceProduct) &&
EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId",
instanceProduct.getString("productTypeId"), "parentTypeId", "AGGREGATED")) {
+ if (instanceProduct != null && EntityTypeUtil.hasParentType(delegator,
"ProductType", "productTypeId", instanceProduct.getString("productTypeId"),
"parentTypeId", "AGGREGATED")) {
GenericValue productAssoc =
EntityUtil.getFirst(EntityUtil.filterByDate(instanceProduct.getRelated("AssocProductAssoc",
UtilMisc.toMap("productAssocTypeId", "PRODUCT_CONF"), null, false)));
- if (UtilValidate.isNotEmpty(productAssoc)) {
+ if (productAssoc != null) {
return productAssoc.getString("productId");
}
}
@@ -186,7 +186,7 @@ public final class ProductWorker {
public static List<GenericValue> getAggregatedAssocs(Delegator delegator,
String aggregatedProductId) throws GenericEntityException {
GenericValue aggregatedProduct =
EntityQuery.use(delegator).from("Product").where("productId",
aggregatedProductId).queryOne();
- if (UtilValidate.isNotEmpty(aggregatedProduct) &&
("AGGREGATED".equals(aggregatedProduct.getString("productTypeId")) ||
"AGGREGATED_SERVICE".equals(aggregatedProduct.getString("productTypeId")))) {
+ if (aggregatedProduct != null &&
("AGGREGATED".equals(aggregatedProduct.getString("productTypeId")) ||
"AGGREGATED_SERVICE".equals(aggregatedProduct.getString("productTypeId")))) {
List<GenericValue> productAssocs =
EntityUtil.filterByDate(aggregatedProduct.getRelated("MainProductAssoc",
UtilMisc.toMap("productAssocTypeId", "PRODUCT_CONF"), null, false));
return productAssocs;
}
@@ -894,7 +894,7 @@ public final class ProductWorker {
product =
EntityQuery.use(delegator).from("Product").where("productId",
idToFind).cache().queryOne();
}
- if (UtilValidate.isNotEmpty(product)) {
+ if (product != null) {
if (UtilValidate.isNotEmpty(productsFound))
productsFound.add(product);
else productsFound = UtilMisc.toList(product);
}
@@ -909,7 +909,7 @@ public final class ProductWorker {
public static String findProductId(Delegator delegator, String idToFind,
String goodIdentificationTypeId) throws GenericEntityException {
GenericValue product = findProduct(delegator, idToFind,
goodIdentificationTypeId);
- if (UtilValidate.isNotEmpty(product)) {
+ if (product != null) {
return product.getString("productId");
} else {
return null;
@@ -1097,7 +1097,7 @@ nextProd:
.filterByDate().queryList();
if (UtilValidate.isNotEmpty(productFeaturePrices)) {
GenericValue productFeaturePrice =
productFeaturePrices.get(0);
- if (UtilValidate.isNotEmpty(productFeaturePrice)) {
+ if (productFeaturePrice != null) {
productPrice.put("price",
productPrice.getBigDecimal("price").add(productFeaturePrice.getBigDecimal("price")));
}
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreEvents.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreEvents.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/store/ProductStoreEvents.java
Sat Nov 5 11:27:46 2016
@@ -50,7 +50,7 @@ public class ProductStoreEvents {
try {
GenericValue productStoreGroup =
EntityQuery.use(delegator).from("ProductStoreGroup").where("productStoreGroupId",
parentGroupId).cache(true).queryOne();
- if (UtilValidate.isNotEmpty(productStoreGroup)) {
+ if (productStoreGroup != null) {
children =
EntityQuery.use(delegator).from("ProductStoreGroupRollupAndChild").where("parentGroupId",
parentGroupId).cache(true).filterByDate().queryList();
if (UtilValidate.isNotEmpty(children)) {
for (GenericValue child : children ) {
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
Sat Nov 5 11:27:46 2016
@@ -1222,7 +1222,7 @@ public class ShipmentServices {
.where("productStoreId",productStoreId,
"shipmentMethodTypeId", shipmentMethodTypeId,
"partyId", carrierPartyId, "roleTypeId",
carrierRoleTypeId)
.queryFirst();
- if (UtilValidate.isNotEmpty(productStoreShipmentMeth)) {
+ if (productStoreShipmentMeth != null) {
shipmentGatewayConfig.put("shipmentGatewayConfigId",
productStoreShipmentMeth.getString("shipmentGatewayConfigId"));
shipmentGatewayConfig.put("configProps",
productStoreShipmentMeth.getString("configProps"));
} else {
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/fedex/FedexServices.java
Sat Nov 5 11:27:46 2016
@@ -1065,7 +1065,7 @@ public class FedexServices {
if (UtilValidate.isNotEmpty(shipmentGatewayConfigId)) {
try {
GenericValue fedex =
EntityQuery.use(delegator).from("ShipmentGatewayFedex").where("shipmentGatewayConfigId",
shipmentGatewayConfigId).queryOne();
- if (UtilValidate.isNotEmpty(fedex)) {
+ if (fedex != null) {
Object fedexField =
fedex.get(shipmentGatewayConfigParameterName);
if (fedexField != null) {
returnValue = fedexField.toString().trim();
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/ups/UpsServices.java
Sat Nov 5 11:27:46 2016
@@ -515,13 +515,13 @@ public class UpsServices {
UtilXml.addChildElementValue(dimensionsElement, "Length",
UtilValidate.isNotEmpty(boxLength) ? ""+boxLength.intValue() : "",
shipmentConfirmRequestDoc);
UtilXml.addChildElementValue(dimensionsElement, "Width",
UtilValidate.isNotEmpty(boxWidth) ? ""+boxWidth.intValue() : "",
shipmentConfirmRequestDoc);
UtilXml.addChildElementValue(dimensionsElement, "Height",
UtilValidate.isNotEmpty(boxHeight) ? ""+boxHeight.intValue() : "",
shipmentConfirmRequestDoc);
- } else if (UtilValidate.isNotEmpty(shipmentPackage) &&
UtilValidate.isNotEmpty(shipmentPackage.getBigDecimal("boxLength"))
+ } else if (shipmentPackage != null &&
UtilValidate.isNotEmpty(shipmentPackage.getBigDecimal("boxLength"))
&&
UtilValidate.isNotEmpty(shipmentPackage.getBigDecimal("boxWidth"))
&&
UtilValidate.isNotEmpty(shipmentPackage.getBigDecimal("boxHeight"))) {
Element dimensionsElement =
UtilXml.addChildElement(packageElement, "Dimensions",
shipmentConfirmRequestDoc);
Element unitOfMeasurementElement =
UtilXml.addChildElement(dimensionsElement, "UnitOfMeasurement",
shipmentConfirmRequestDoc);
GenericValue dimensionUom =
shipmentPackage.getRelatedOne("DimensionUom", false);
- if (UtilValidate.isNotEmpty(dimensionUom)) {
+ if (dimensionUom != null) {
UtilXml.addChildElementValue(unitOfMeasurementElement,
"Code", dimensionUom.getString("abbreviation").toUpperCase(),
shipmentConfirmRequestDoc);
} else {
UtilXml.addChildElementValue(unitOfMeasurementElement,
"Code", "IN", shipmentConfirmRequestDoc);
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/usps/UspsServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=1768192&r1=1768191&r2=1768192&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/usps/UspsServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/thirdparty/usps/UspsServices.java
Sat Nov 5 11:27:46 2016
@@ -1766,7 +1766,7 @@ public class UspsServices {
if (UtilValidate.isNotEmpty(shipmentGatewayConfigId)) {
try {
GenericValue usps =
EntityQuery.use(delegator).from("ShipmentGatewayUsps").where("shipmentGatewayConfigId",
shipmentGatewayConfigId).queryOne();
- if (UtilValidate.isNotEmpty(usps)) {
+ if (usps != null) {
Object uspsField =
usps.get(shipmentGatewayConfigParameterName);
if (uspsField != null) {
returnValue = uspsField.toString().trim();