Improved: UtilValidate isEmpty and isNotEmpty methods not used correctly
(OFBIZ-8413) Thanks Pawan Verma for your contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1766868 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+2
-2
@@ -1397,7 +1397,7 @@ public class PaymentGatewayServices {
|
||||
|
||||
if (amountToCapture.compareTo(ZERO) > 0) {
|
||||
GenericValue productStore = orh.getProductStore();
|
||||
if (!UtilValidate.isEmpty(productStore)) {
|
||||
if (UtilValidate.isNotEmpty(productStore)) {
|
||||
boolean shipIfCaptureFails = UtilValidate.isEmpty(productStore.get("shipIfCaptureFails")) || "Y".equalsIgnoreCase(productStore.getString("shipIfCaptureFails"));
|
||||
if (! shipIfCaptureFails) {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder,
|
||||
@@ -2301,7 +2301,7 @@ public class PaymentGatewayServices {
|
||||
|
||||
// get the partyIdTo for the payment, which is who is receiving it
|
||||
String partyIdTo = null;
|
||||
if (!UtilValidate.isEmpty(payTo)) {
|
||||
if (UtilValidate.isNotEmpty(payTo)) {
|
||||
// use input pay to party
|
||||
partyIdTo = payTo;
|
||||
} else if (invoice != null) {
|
||||
|
||||
@@ -76,7 +76,7 @@ In order ta make this service active add the following to the service definition
|
||||
try {
|
||||
BufferedReader input = null;
|
||||
try {
|
||||
if (!UtilValidate.isEmpty(file)) {
|
||||
if (UtilValidate.isNotEmpty(file)) {
|
||||
input = new BufferedReader(new FileReader(file));
|
||||
String line = null;
|
||||
int size = 0;
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ public class SimpleContentViewHandler extends AbstractViewHandler {
|
||||
// setup content type
|
||||
String contentType2 = UtilValidate.isNotEmpty(mimeTypeId) ? mimeTypeId + "; charset=" +charset : contentType;
|
||||
String fileName = null;
|
||||
if (!UtilValidate.isEmpty(dataResource.getString("dataResourceName"))) {
|
||||
if (UtilValidate.isNotEmpty(dataResource.getString("dataResourceName"))) {
|
||||
fileName = dataResource.getString("dataResourceName").replace(" ", "_"); // spaces in filenames can be a problem
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -532,19 +532,19 @@ public class BOMNode {
|
||||
serviceContext.put("productId", getSubstitutedNode().getProduct().getString("productId"));
|
||||
serviceContext.put("facilityId", getSubstitutedNode().getProduct().getString("facilityId"));
|
||||
}
|
||||
if (!UtilValidate.isEmpty(facilityId)) {
|
||||
if (UtilValidate.isNotEmpty(facilityId)) {
|
||||
serviceContext.put("facilityId", facilityId);
|
||||
}
|
||||
if (!UtilValidate.isEmpty(workEffortName)) {
|
||||
if (UtilValidate.isNotEmpty(workEffortName)) {
|
||||
serviceContext.put("workEffortName", workEffortName);
|
||||
}
|
||||
if (!UtilValidate.isEmpty(description)) {
|
||||
if (UtilValidate.isNotEmpty(description)) {
|
||||
serviceContext.put("description", description);
|
||||
}
|
||||
if (!UtilValidate.isEmpty(routingId)) {
|
||||
if (UtilValidate.isNotEmpty(routingId)) {
|
||||
serviceContext.put("routingId", routingId);
|
||||
}
|
||||
if (!UtilValidate.isEmpty(shipmentId) && UtilValidate.isEmpty(workEffortName)) {
|
||||
if (UtilValidate.isNotEmpty(shipmentId) && UtilValidate.isEmpty(workEffortName)) {
|
||||
serviceContext.put("workEffortName", "SP_" + shipmentId + "_" + serviceContext.get("productId"));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -475,7 +475,7 @@ public class BOMServices {
|
||||
|
||||
try {
|
||||
List<GenericValue> packages = EntityQuery.use(delegator).from("ShipmentPackage").where("shipmentId", shipmentId).queryList();
|
||||
if (!UtilValidate.isEmpty(packages)) {
|
||||
if (UtilValidate.isNotEmpty(packages)) {
|
||||
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingBomPackageAlreadyFound", locale));
|
||||
}
|
||||
} catch (GenericEntityException gee) {
|
||||
|
||||
+3
-3
@@ -126,7 +126,7 @@ public class ProductionRunServices {
|
||||
"workEffortGoodStdTypeId", "PRUN_PROD_DELIV",
|
||||
"statusId", "WEGS_CREATED")
|
||||
.queryList();
|
||||
if (!UtilValidate.isEmpty(products)) {
|
||||
if (UtilValidate.isNotEmpty(products)) {
|
||||
for (GenericValue product : products) {
|
||||
product.set("statusId", "WEGS_CANCELLED");
|
||||
product.store();
|
||||
@@ -149,7 +149,7 @@ public class ProductionRunServices {
|
||||
"workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED",
|
||||
"statusId", "WEGS_CREATED")
|
||||
.queryList();
|
||||
if (!UtilValidate.isEmpty(components)) {
|
||||
if (UtilValidate.isNotEmpty(components)) {
|
||||
for (GenericValue component : components) {
|
||||
component.set("statusId", "WEGS_CANCELLED");
|
||||
component.store();
|
||||
@@ -491,7 +491,7 @@ public class ProductionRunServices {
|
||||
GenericValue userLogin = (GenericValue) context.get("userLogin");
|
||||
String productionRunId = (String) context.get("productionRunId");
|
||||
|
||||
if (!UtilValidate.isEmpty(productionRunId)) {
|
||||
if (UtilValidate.isNotEmpty(productionRunId)) {
|
||||
ProductionRun productionRun = new ProductionRun(productionRunId, delegator, dispatcher);
|
||||
if (productionRun.exist()) {
|
||||
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ public class InventoryEventPlannedServices {
|
||||
} else {
|
||||
BigDecimal qties = newQuantity.add(mrpEvent.getBigDecimal("quantity"));
|
||||
mrpEvent.put("quantity", qties.doubleValue());
|
||||
if (!UtilValidate.isEmpty(eventName)) {
|
||||
if (UtilValidate.isNotEmpty(eventName)) {
|
||||
String existingEventName = mrpEvent.getString("eventName");
|
||||
mrpEvent.put("eventName", (UtilValidate.isEmpty(existingEventName)? eventName: existingEventName + ", " + eventName));
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class OrderManagerEvents {
|
||||
String paymentMethodId = paymentMethod.getString("paymentMethodId");
|
||||
String paymentMethodAmountStr = request.getParameter(paymentMethodId + "_amount");
|
||||
String paymentMethodReference = request.getParameter(paymentMethodId + "_reference");
|
||||
if (!UtilValidate.isEmpty(paymentMethodAmountStr)) {
|
||||
if (UtilValidate.isNotEmpty(paymentMethodAmountStr)) {
|
||||
BigDecimal paymentMethodAmount = BigDecimal.ZERO;
|
||||
try {
|
||||
paymentMethodAmount = (BigDecimal) ObjectType.simpleTypeConvert(paymentMethodAmountStr, "BigDecimal", null, locale);
|
||||
@@ -224,7 +224,7 @@ public class OrderManagerEvents {
|
||||
String paymentMethodTypeId = paymentMethodType.getString("paymentMethodTypeId");
|
||||
String amountStr = request.getParameter(paymentMethodTypeId + "_amount");
|
||||
String paymentReference = request.getParameter(paymentMethodTypeId + "_reference");
|
||||
if (!UtilValidate.isEmpty(amountStr)) {
|
||||
if (UtilValidate.isNotEmpty(amountStr)) {
|
||||
BigDecimal paymentTypeAmount = BigDecimal.ZERO;
|
||||
try {
|
||||
paymentTypeAmount = (BigDecimal) ObjectType.simpleTypeConvert(amountStr, "BigDecimal", null, locale);
|
||||
|
||||
@@ -149,7 +149,7 @@ public class OrderListState implements Serializable {
|
||||
} else {
|
||||
String viewSizeParam = request.getParameter(VIEW_SIZE_PARAM);
|
||||
String viewIndexParam = request.getParameter(VIEW_INDEX_PARAM);
|
||||
if (!UtilValidate.isEmpty(viewSizeParam) && !UtilValidate.isEmpty(viewIndexParam))
|
||||
if (UtilValidate.isNotEmpty(viewSizeParam) && UtilValidate.isNotEmpty(viewIndexParam))
|
||||
changePaginationState(viewSizeParam, viewIndexParam);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -438,7 +438,7 @@ public class OrderReturnServices {
|
||||
}
|
||||
String returnStatus = returnHeader.getString("statusId");
|
||||
if (!returnStatus.equals("RETURN_CANCELLED")) {
|
||||
if(!UtilValidate.isEmpty(returnItem.getBigDecimal("returnQuantity"))){
|
||||
if(UtilValidate.isNotEmpty(returnItem.getBigDecimal("returnQuantity"))){
|
||||
returnedQty = returnedQty.add(returnItem.getBigDecimal("returnQuantity"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ public class OrderServices {
|
||||
if (valueObj.get("carrierRoleTypeId") == null) {
|
||||
valueObj.set("carrierRoleTypeId", "CARRIER");
|
||||
}
|
||||
if (!UtilValidate.isEmpty(valueObj.getString("supplierPartyId"))) {
|
||||
if (UtilValidate.isNotEmpty(valueObj.getString("supplierPartyId"))) {
|
||||
dropShipGroupIds.add(valueObj.getString("shipGroupSeqId"));
|
||||
}
|
||||
} else if ("OrderAdjustment".equals(valueObj.getEntityName())) {
|
||||
@@ -4302,7 +4302,7 @@ public class OrderServices {
|
||||
if (valueObj.get("carrierRoleTypeId") == null) {
|
||||
valueObj.set("carrierRoleTypeId", "CARRIER");
|
||||
}
|
||||
if (!UtilValidate.isEmpty(valueObj.get("supplierPartyId"))) {
|
||||
if (UtilValidate.isNotEmpty(valueObj.get("supplierPartyId"))) {
|
||||
dropShipGroupIds.add(valueObj.getString("shipGroupSeqId"));
|
||||
}
|
||||
} else if ("OrderAdjustment".equals(valueObj.getEntityName())) {
|
||||
@@ -4957,7 +4957,7 @@ public class OrderServices {
|
||||
if ("SALES_ORDER".equals(orh.getOrderTypeId())) {
|
||||
// get the order's ship groups
|
||||
for (GenericValue shipGroup : orh.getOrderItemShipGroups()) {
|
||||
if (!UtilValidate.isEmpty(shipGroup.getString("supplierPartyId"))) {
|
||||
if (UtilValidate.isNotEmpty(shipGroup.getString("supplierPartyId"))) {
|
||||
// This ship group is a drop shipment: we create a purchase order for it
|
||||
String supplierPartyId = shipGroup.getString("supplierPartyId");
|
||||
// Set supplier preferred currency for drop-ship (PO) order to support multi currency
|
||||
@@ -4975,7 +4975,7 @@ public class OrderServices {
|
||||
cart.setOrderPartyId(supplierPartyId);
|
||||
// Get the items associated to it and create po
|
||||
List<GenericValue> items = orh.getValidOrderItems(shipGroup.getString("shipGroupSeqId"));
|
||||
if (!UtilValidate.isEmpty(items)) {
|
||||
if (UtilValidate.isNotEmpty(items)) {
|
||||
for (GenericValue item : items) {
|
||||
try {
|
||||
int itemIndex = cart.addOrIncreaseItem(item.getString("productId"),
|
||||
@@ -5001,7 +5001,7 @@ public class OrderServices {
|
||||
}
|
||||
|
||||
// If there are indeed items to drop ship, then create the purchase order
|
||||
if (!UtilValidate.isEmpty(cart.items())) {
|
||||
if (UtilValidate.isNotEmpty(cart.items())) {
|
||||
// set checkout options
|
||||
cart.setDefaultCheckoutOptions(dispatcher);
|
||||
// the shipping address is the one of the customer
|
||||
|
||||
+1
-1
@@ -1727,7 +1727,7 @@ public class ShoppingCart implements Iterable<ShoppingCartItem>, Serializable {
|
||||
if (UtilValidate.isNotEmpty(orderId)) {
|
||||
try {
|
||||
List<GenericValue> declinedPaymentMethods = EntityQuery.use(delegator).from("OrderPaymentPreference").where("orderId", orderId, "statusId", "PAYMENT_DECLINED").queryList();
|
||||
if (!UtilValidate.isEmpty(declinedPaymentMethods)) {
|
||||
if (UtilValidate.isNotEmpty(declinedPaymentMethods)) {
|
||||
List<String> paymentMethodIdsToRemove = new ArrayList<String>();
|
||||
for (GenericValue opp : declinedPaymentMethods) {
|
||||
paymentMethodIdsToRemove.add(opp.getString("paymentMethodId"));
|
||||
|
||||
+1
-1
@@ -1664,7 +1664,7 @@ public class ShoppingCartEvents {
|
||||
String originOrderId = request.getParameter("originOrderId");
|
||||
cart.setAttribute("originOrderId", originOrderId);
|
||||
|
||||
if (!UtilValidate.isEmpty(request.getParameter("partyId"))) {
|
||||
if (UtilValidate.isNotEmpty(request.getParameter("partyId"))) {
|
||||
partyId = request.getParameter("partyId");
|
||||
}
|
||||
String userLoginId = request.getParameter("userLoginId");
|
||||
|
||||
+3
-3
@@ -147,7 +147,7 @@ public class ShoppingCartHelper {
|
||||
|
||||
// check desiredDeliveryDate syntax and remove if empty
|
||||
String ddDate = (String) context.get("itemDesiredDeliveryDate");
|
||||
if (!UtilValidate.isEmpty(ddDate)) {
|
||||
if (UtilValidate.isNotEmpty(ddDate)) {
|
||||
try {
|
||||
java.sql.Timestamp.valueOf((String) context.get("itemDesiredDeliveryDate"));
|
||||
} catch (IllegalArgumentException e) {
|
||||
@@ -164,7 +164,7 @@ public class ShoppingCartHelper {
|
||||
}
|
||||
|
||||
// stores the default desired delivery date in the cart if need
|
||||
if (!UtilValidate.isEmpty(context.get("useAsDefaultDesiredDeliveryDate"))) {
|
||||
if (UtilValidate.isNotEmpty(context.get("useAsDefaultDesiredDeliveryDate"))) {
|
||||
cart.setDefaultItemDeliveryDate((String) context.get("itemDesiredDeliveryDate"));
|
||||
} else {
|
||||
// do we really want to clear this if it isn't checked?
|
||||
@@ -172,7 +172,7 @@ public class ShoppingCartHelper {
|
||||
}
|
||||
|
||||
// stores the default comment in session if need
|
||||
if (!UtilValidate.isEmpty(context.get("useAsDefaultComment"))) {
|
||||
if (UtilValidate.isNotEmpty(context.get("useAsDefaultComment"))) {
|
||||
cart.setDefaultItemComment((String) context.get("itemComment"));
|
||||
} else {
|
||||
// do we really want to clear this if it isn't checked?
|
||||
|
||||
+1
-1
@@ -1010,7 +1010,7 @@ public class CommunicationEventServices {
|
||||
attContentType = attContentType.toLowerCase().substring(0, attContentType.indexOf(";"));
|
||||
}
|
||||
|
||||
if (!UtilValidate.isEmpty(attFileName)) {
|
||||
if (UtilValidate.isNotEmpty(attFileName)) {
|
||||
attachmentMap.put("contentName", attFileName);
|
||||
attachmentMap.put("description", subject + "-" + attachmentIdx);
|
||||
} else {
|
||||
|
||||
@@ -156,11 +156,11 @@ public class PartyServices {
|
||||
}
|
||||
Map<String, Object> newPartyMap = UtilMisc.toMap("partyId", partyId, "partyTypeId", "PERSON", "description", description, "createdDate", now, "lastModifiedDate", now, "statusId", statusId);
|
||||
String preferredCurrencyUomId = (String) context.get("preferredCurrencyUomId");
|
||||
if (!UtilValidate.isEmpty(preferredCurrencyUomId)) {
|
||||
if (UtilValidate.isNotEmpty(preferredCurrencyUomId)) {
|
||||
newPartyMap.put("preferredCurrencyUomId", preferredCurrencyUomId);
|
||||
}
|
||||
String externalId = (String) context.get("externalId");
|
||||
if (!UtilValidate.isEmpty(externalId)) {
|
||||
if (UtilValidate.isNotEmpty(externalId)) {
|
||||
newPartyMap.put("externalId", externalId);
|
||||
}
|
||||
if (userLogin != null) {
|
||||
|
||||
+4
-4
@@ -248,14 +248,14 @@ public class ProductEvents {
|
||||
errMsgList.add("From Date not formatted correctly.");
|
||||
}
|
||||
}
|
||||
if (!UtilValidate.isNotEmpty(productId))
|
||||
if (UtilValidate.isEmpty(productId))
|
||||
errMsgList.add(UtilProperties.getMessage(resource,"productevents.product_ID_missing", UtilHttp.getLocale(request)));
|
||||
if (!UtilValidate.isNotEmpty(productIdTo))
|
||||
if (UtilValidate.isEmpty(productIdTo))
|
||||
errMsgList.add(UtilProperties.getMessage(resource,"productevents.product_ID_To_missing", UtilHttp.getLocale(request)));
|
||||
if (!UtilValidate.isNotEmpty(productAssocTypeId))
|
||||
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.isNotEmpty(fromDateStr))
|
||||
if (!updateMode.equals("CREATE") && 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);
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ public class ProductStoreSurveyWrapper extends SurveyWrapper {
|
||||
public Writer render() throws SurveyWrapperException {
|
||||
if (canRespond() && !callResult) {
|
||||
return renderSurvey();
|
||||
} else if (!UtilValidate.isEmpty(resultTemplate)) {
|
||||
} else if (UtilValidate.isNotEmpty(resultTemplate)) {
|
||||
return renderResult();
|
||||
} else {
|
||||
throw new SurveyWrapperException("Error template not implemented yet; cannot update survey; no result template defined!");
|
||||
|
||||
+3
-3
@@ -464,7 +464,7 @@ public final class ProductStoreWorker {
|
||||
|
||||
public static ProductStoreSurveyWrapper getRandomSurveyWrapper(Delegator delegator, String productStoreId, String groupName, String partyId, Map<String, Object> passThruFields) {
|
||||
List<GenericValue> randomSurveys = getSurveys(delegator, productStoreId, groupName, null, "RANDOM_POLL", null);
|
||||
if (!UtilValidate.isEmpty(randomSurveys)) {
|
||||
if (UtilValidate.isNotEmpty(randomSurveys)) {
|
||||
Random rand = new Random();
|
||||
int index = rand.nextInt(randomSurveys.size());
|
||||
GenericValue appl = randomSurveys.get(index);
|
||||
@@ -496,13 +496,13 @@ public final class ProductStoreWorker {
|
||||
storeSurveys = EntityUtil.filterByDate(storeSurveys);
|
||||
|
||||
// limit based on group name
|
||||
if (!UtilValidate.isEmpty(groupName)) {
|
||||
if (UtilValidate.isNotEmpty(groupName)) {
|
||||
storeSurveys = EntityUtil.filterByAnd(storeSurveys, UtilMisc.toMap("groupName", groupName));
|
||||
}
|
||||
|
||||
Debug.logInfo("getSurvey for product " + productId,module);
|
||||
// limit by product
|
||||
if (!UtilValidate.isEmpty(productId) && !UtilValidate.isEmpty(storeSurveys)) {
|
||||
if (UtilValidate.isNotEmpty(productId) && UtilValidate.isNotEmpty(storeSurveys)) {
|
||||
for (GenericValue surveyAppl: storeSurveys) {
|
||||
GenericValue product = null;
|
||||
String virtualProductId = null;
|
||||
|
||||
+1
-1
@@ -935,7 +935,7 @@ public class PackingSession implements java.io.Serializable {
|
||||
Debug.logError(e, module);
|
||||
}
|
||||
|
||||
if (!UtilValidate.isEmpty(serviceResult)) {
|
||||
if (UtilValidate.isNotEmpty(serviceResult)) {
|
||||
shipmentCostEstimate = (BigDecimal) serviceResult.get("shippingEstimateAmount");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ public class PickListServices {
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (!UtilValidate.isEmpty(items)) {
|
||||
if (UtilValidate.isNotEmpty(items)) {
|
||||
for (GenericValue v: items) {
|
||||
String itemStatus = v.getString("itemStatusId");
|
||||
if (itemStatus != null) {
|
||||
|
||||
+4
-4
@@ -162,7 +162,7 @@ public class LoginEvents {
|
||||
userLoginId = userLoginId.toLowerCase();
|
||||
}
|
||||
|
||||
if (!UtilValidate.isNotEmpty(userLoginId)) {
|
||||
if (UtilValidate.isEmpty(userLoginId)) {
|
||||
// the password was incomplete
|
||||
errMsg = UtilProperties.getMessage(resource, "loginevents.username_was_empty_reenter", UtilHttp.getLocale(request));
|
||||
request.setAttribute("_ERROR_MESSAGE_", errMsg);
|
||||
@@ -185,7 +185,7 @@ public class LoginEvents {
|
||||
|
||||
String passwordHint = supposedUserLogin.getString("passwordHint");
|
||||
|
||||
if (!UtilValidate.isNotEmpty(passwordHint)) {
|
||||
if (UtilValidate.isEmpty(passwordHint)) {
|
||||
// the Username was not found
|
||||
errMsg = UtilProperties.getMessage(resource, "loginevents.no_password_hint_specified_try_password_emailed", UtilHttp.getLocale(request));
|
||||
request.setAttribute("_ERROR_MESSAGE_", errMsg);
|
||||
@@ -222,7 +222,7 @@ public class LoginEvents {
|
||||
userLoginId = userLoginId.toLowerCase();
|
||||
}
|
||||
|
||||
if (!UtilValidate.isNotEmpty(userLoginId)) {
|
||||
if (UtilValidate.isEmpty(userLoginId)) {
|
||||
// the password was incomplete
|
||||
errMsg = UtilProperties.getMessage(resource, "loginevents.username_was_empty_reenter", UtilHttp.getLocale(request));
|
||||
request.setAttribute("_ERROR_MESSAGE_", errMsg);
|
||||
@@ -291,7 +291,7 @@ public class LoginEvents {
|
||||
}
|
||||
}
|
||||
|
||||
if (!UtilValidate.isNotEmpty(emails.toString())) {
|
||||
if (UtilValidate.isEmpty(emails.toString())) {
|
||||
// the Username was not found
|
||||
errMsg = UtilProperties.getMessage(resource, "loginevents.no_primary_email_address_set_contact_customer_service", UtilHttp.getLocale(request));
|
||||
request.setAttribute("_ERROR_MESSAGE_", errMsg);
|
||||
|
||||
@@ -618,7 +618,7 @@ public final class UtilHttp {
|
||||
}
|
||||
|
||||
// no user locale? before global default try appDefaultLocale if specified
|
||||
if (localeObject == null && !UtilValidate.isEmpty(appDefaultLocale)) {
|
||||
if (localeObject == null && UtilValidate.isNotEmpty(appDefaultLocale)) {
|
||||
localeObject = appDefaultLocale;
|
||||
}
|
||||
|
||||
@@ -747,7 +747,7 @@ public final class UtilHttp {
|
||||
}
|
||||
|
||||
// no user currency? before global default try appDefaultCurrencyUom if specified
|
||||
if (iso == null && !UtilValidate.isEmpty(appDefaultCurrencyUom)) {
|
||||
if (iso == null && UtilValidate.isNotEmpty(appDefaultCurrencyUom)) {
|
||||
iso = appDefaultCurrencyUom;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -307,12 +307,12 @@ public class CatalinaContainer implements Container {
|
||||
|
||||
|
||||
String alp2 = ContainerConfig.getPropertyValue(engineConfig, "access-log-pattern", null);
|
||||
if (al != null && !UtilValidate.isEmpty(alp2)) {
|
||||
if (al != null && UtilValidate.isNotEmpty(alp2)) {
|
||||
al.setPattern(alp2);
|
||||
}
|
||||
|
||||
String alp3 = ContainerConfig.getPropertyValue(engineConfig, "access-log-prefix", null);
|
||||
if (al != null && !UtilValidate.isEmpty(alp3)) {
|
||||
if (al != null && UtilValidate.isNotEmpty(alp3)) {
|
||||
al.setPrefix(alp3);
|
||||
}
|
||||
|
||||
|
||||
@@ -763,7 +763,7 @@ public class FindServices {
|
||||
Debug.logInfo("Problem getting list Item" + e,module);
|
||||
}
|
||||
|
||||
if (!UtilValidate.isEmpty(item)) {
|
||||
if (UtilValidate.isNotEmpty(item)) {
|
||||
result.put("item",item);
|
||||
}
|
||||
result.remove("listIt");
|
||||
|
||||
@@ -923,7 +923,7 @@ public class LoginServices {
|
||||
|
||||
}
|
||||
|
||||
if (!UtilValidate.isNotEmpty(newPassword) || !UtilValidate.isNotEmpty(newPasswordVerify)) {
|
||||
if (UtilValidate.isEmpty(newPassword) || UtilValidate.isEmpty(newPasswordVerify)) {
|
||||
errMsg = UtilProperties.getMessage(resource,"loginservices.password_or_verify_missing", locale);
|
||||
errorMessageList.add(errMsg);
|
||||
} else if (!newPassword.equals(newPasswordVerify)) {
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ public final class ScriptHelperImpl implements ScriptHelper {
|
||||
int transactionTimeout = -1;
|
||||
if (UtilValidate.isNotEmpty(requireNewTransactionStr)) {
|
||||
String timeoutStr = (String) args.get("transactionTimout");
|
||||
if (!UtilValidate.isEmpty(timeoutStr)) {
|
||||
if (UtilValidate.isNotEmpty(timeoutStr)) {
|
||||
try {
|
||||
transactionTimeout = Integer.parseInt(timeoutStr);
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
@@ -1937,7 +1937,7 @@ public class DatabaseUtil {
|
||||
// first rename the column
|
||||
String tempName = makeTempFieldName(field);
|
||||
String renamedErr = renameColumn(entity, field, tempName);
|
||||
if (!UtilValidate.isEmpty(renamedErr)) {
|
||||
if (UtilValidate.isNotEmpty(renamedErr)) {
|
||||
if (messages != null) messages.add(renamedErr);
|
||||
Debug.logError(renamedErr, module);
|
||||
return;
|
||||
@@ -1945,7 +1945,7 @@ public class DatabaseUtil {
|
||||
|
||||
// next add back in the column
|
||||
String addedErr = addColumn(entity, field);
|
||||
if (!UtilValidate.isEmpty(addedErr)) {
|
||||
if (UtilValidate.isNotEmpty(addedErr)) {
|
||||
if (messages != null) messages.add(addedErr);
|
||||
Debug.logError(addedErr, module);
|
||||
return;
|
||||
@@ -2359,7 +2359,7 @@ public class DatabaseUtil {
|
||||
public void createPrimaryKey(ModelEntity entity, boolean usePkConstraintNames, int constraintNameClipLength, List<String> messages) {
|
||||
if (messages == null) messages = new ArrayList<String>();
|
||||
String err = createPrimaryKey(entity, usePkConstraintNames, constraintNameClipLength);
|
||||
if (!UtilValidate.isEmpty(err)) {
|
||||
if (UtilValidate.isNotEmpty(err)) {
|
||||
messages.add(err);
|
||||
}
|
||||
}
|
||||
@@ -2433,7 +2433,7 @@ public class DatabaseUtil {
|
||||
public void deletePrimaryKey(ModelEntity entity, boolean usePkConstraintNames, int constraintNameClipLength, List<String> messages) {
|
||||
if (messages == null) messages = new ArrayList<String>();
|
||||
String err = deletePrimaryKey(entity, usePkConstraintNames, constraintNameClipLength);
|
||||
if (!UtilValidate.isEmpty(err)) {
|
||||
if (UtilValidate.isNotEmpty(err)) {
|
||||
messages.add(err);
|
||||
}
|
||||
}
|
||||
@@ -2622,7 +2622,7 @@ public class DatabaseUtil {
|
||||
public void deleteDeclaredIndices(ModelEntity entity, List<String> messages) {
|
||||
if (messages == null) messages = new ArrayList<String>();
|
||||
String err = deleteDeclaredIndices(entity);
|
||||
if (!UtilValidate.isEmpty(err)) {
|
||||
if (UtilValidate.isNotEmpty(err)) {
|
||||
messages.add(err);
|
||||
}
|
||||
}
|
||||
@@ -2819,7 +2819,7 @@ public class DatabaseUtil {
|
||||
public void deleteForeignKeyIndices(ModelEntity entity, List<String> messages) {
|
||||
if (messages == null) messages = new ArrayList<String>();
|
||||
String err = deleteForeignKeyIndices(entity, datasourceInfo.getConstraintNameClipLength());
|
||||
if (!UtilValidate.isEmpty(err)) {
|
||||
if (UtilValidate.isNotEmpty(err)) {
|
||||
messages.add(err);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -317,9 +317,9 @@ public class EntitySyncServices {
|
||||
// store data returned, get results (just call storeEntitySyncData locally, get the numbers back and boom shakalaka)
|
||||
|
||||
// anything to store locally?
|
||||
if (startDate != null && (!UtilValidate.isEmpty(result.get("valuesToCreate")) ||
|
||||
!UtilValidate.isEmpty(result.get("valuesToStore")) ||
|
||||
!UtilValidate.isEmpty(result.get("keysToRemove")))) {
|
||||
if (startDate != null && (UtilValidate.isNotEmpty(result.get("valuesToCreate")) ||
|
||||
UtilValidate.isNotEmpty(result.get("valuesToStore")) ||
|
||||
UtilValidate.isNotEmpty(result.get("keysToRemove")))) {
|
||||
|
||||
// yep, we got more data
|
||||
gotMoreData = true;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class NotEmpty extends SimpleMapOperation {
|
||||
Object obj = inMap.get(fieldName);
|
||||
if (obj instanceof java.lang.String) {
|
||||
String fieldValue = (java.lang.String) obj;
|
||||
if (!UtilValidate.isNotEmpty(fieldValue)) {
|
||||
if (UtilValidate.isEmpty(fieldValue)) {
|
||||
addMessage(messages, loader, locale);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -221,7 +221,7 @@ public class ModelServiceReader implements Serializable {
|
||||
// set the semaphore sleep/wait times
|
||||
String semaphoreWaitStr = UtilXml.checkEmpty(serviceElement.getAttribute("semaphore-wait-seconds"));
|
||||
int semaphoreWait = 300;
|
||||
if (!UtilValidate.isEmpty(semaphoreWaitStr)) {
|
||||
if (UtilValidate.isNotEmpty(semaphoreWaitStr)) {
|
||||
try {
|
||||
semaphoreWait = Integer.parseInt(semaphoreWaitStr);
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -233,7 +233,7 @@ public class ModelServiceReader implements Serializable {
|
||||
|
||||
String semaphoreSleepStr = UtilXml.checkEmpty(serviceElement.getAttribute("semaphore-sleep"));
|
||||
int semaphoreSleep = 500;
|
||||
if (!UtilValidate.isEmpty(semaphoreSleepStr)) {
|
||||
if (UtilValidate.isNotEmpty(semaphoreSleepStr)) {
|
||||
try {
|
||||
semaphoreSleep = Integer.parseInt(semaphoreSleepStr);
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -246,7 +246,7 @@ public class ModelServiceReader implements Serializable {
|
||||
// set the max retry field
|
||||
String maxRetryStr = UtilXml.checkEmpty(serviceElement.getAttribute("max-retry"));
|
||||
int maxRetry = -1;
|
||||
if (!UtilValidate.isEmpty(maxRetryStr)) {
|
||||
if (UtilValidate.isNotEmpty(maxRetryStr)) {
|
||||
try {
|
||||
maxRetry = Integer.parseInt(maxRetryStr);
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -259,7 +259,7 @@ public class ModelServiceReader implements Serializable {
|
||||
// get the timeout and convert to int
|
||||
String timeoutStr = UtilXml.checkEmpty(serviceElement.getAttribute("transaction-timeout"), serviceElement.getAttribute("transaction-timout"));
|
||||
int timeout = 0;
|
||||
if (!UtilValidate.isEmpty(timeoutStr)) {
|
||||
if (UtilValidate.isNotEmpty(timeoutStr)) {
|
||||
try {
|
||||
timeout = Integer.parseInt(timeoutStr);
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
+2
-2
@@ -282,7 +282,7 @@ public class PersistedServiceJob extends GenericServiceJob {
|
||||
protected Map<String, Object> getContext() throws InvalidJobException {
|
||||
Map<String, Object> context = null;
|
||||
try {
|
||||
if (!UtilValidate.isEmpty(jobValue.getString("runtimeDataId"))) {
|
||||
if (UtilValidate.isNotEmpty(jobValue.getString("runtimeDataId"))) {
|
||||
GenericValue contextObj = jobValue.getRelatedOne("RuntimeData", false);
|
||||
if (contextObj != null) {
|
||||
context = UtilGenerics.checkMap(XmlSerializer.deserialize(contextObj.getString("runtimeInfo"), delegator), String.class, Object.class);
|
||||
@@ -292,7 +292,7 @@ public class PersistedServiceJob extends GenericServiceJob {
|
||||
context = new HashMap<String, Object>();
|
||||
}
|
||||
// check the runAsUser
|
||||
if (!UtilValidate.isEmpty(jobValue.getString("runAsUser"))) {
|
||||
if (UtilValidate.isNotEmpty(jobValue.getString("runAsUser"))) {
|
||||
context.put("userLogin", ServiceUtil.getUserLogin(dctx, context, jobValue.getString("runAsUser")));
|
||||
}
|
||||
} catch (GenericEntityException e) {
|
||||
|
||||
+2
-2
@@ -240,7 +240,7 @@ public class JavaMailContainer implements Container {
|
||||
// check the port
|
||||
int portProps = 0;
|
||||
String portStr = props.getProperty("mail." + protocol + ".port");
|
||||
if (!UtilValidate.isEmpty(portStr)) {
|
||||
if (UtilValidate.isNotEmpty(portStr)) {
|
||||
try {
|
||||
portProps = Integer.valueOf(portStr);
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -249,7 +249,7 @@ public class JavaMailContainer implements Container {
|
||||
}
|
||||
if (portProps == 0) {
|
||||
portStr = props.getProperty("mail.port");
|
||||
if (!UtilValidate.isEmpty(portStr)) {
|
||||
if (UtilValidate.isNotEmpty(portStr)) {
|
||||
try {
|
||||
portProps = Integer.valueOf(props.getProperty("mail.port"));
|
||||
} catch (NumberFormatException e) {
|
||||
|
||||
+2
-2
@@ -345,13 +345,13 @@ public class ServiceMultiEventHandler implements EventHandler {
|
||||
}
|
||||
|
||||
// get the success messages
|
||||
if (!UtilValidate.isEmpty(result.get(ModelService.SUCCESS_MESSAGE))) {
|
||||
if (UtilValidate.isNotEmpty(result.get(ModelService.SUCCESS_MESSAGE))) {
|
||||
String newSuccessMessage = (String)result.get(ModelService.SUCCESS_MESSAGE);
|
||||
if (!successMessages.contains(newSuccessMessage)) {
|
||||
successMessages.add(newSuccessMessage);
|
||||
}
|
||||
}
|
||||
if (!UtilValidate.isEmpty(result.get(ModelService.SUCCESS_MESSAGE_LIST))) {
|
||||
if (UtilValidate.isNotEmpty(result.get(ModelService.SUCCESS_MESSAGE_LIST))) {
|
||||
List<String> newSuccessMessages = UtilGenerics.<String>checkList(result.get(ModelService.SUCCESS_MESSAGE_LIST));
|
||||
for (int j = 0; j < newSuccessMessages.size(); j++) {
|
||||
String newSuccessMessage = newSuccessMessages.get(j);
|
||||
|
||||
+1
-1
@@ -2339,7 +2339,7 @@ public final class MacroFormRenderer implements FormStringRenderer {
|
||||
} else if (!prepLinkText.endsWith("?")) {
|
||||
prepLinkText += "&";
|
||||
}
|
||||
if (!UtilValidate.isEmpty(queryString) && !queryString.equals("null")) {
|
||||
if (UtilValidate.isNotEmpty(queryString) && !queryString.equals("null")) {
|
||||
prepLinkText += queryString + "&";
|
||||
}
|
||||
prepLinkSizeText = prepLinkText + viewSizeParam + "='+this.value+'" + "&" + viewIndexParam + "=0";
|
||||
|
||||
+1
-1
@@ -760,7 +760,7 @@ public class MacroScreenRenderer implements ScreenStringRenderer {
|
||||
} else if (!prepLinkText.endsWith("?")) {
|
||||
prepLinkText += "&";
|
||||
}
|
||||
if (!UtilValidate.isEmpty(queryString) && !queryString.equals("null")) {
|
||||
if (UtilValidate.isNotEmpty(queryString) && !queryString.equals("null")) {
|
||||
prepLinkText += queryString + "&";
|
||||
}
|
||||
prepLinkText += viewSizeParam + "=" + viewSize + "&" + viewIndexParam + "=";
|
||||
|
||||
Reference in New Issue
Block a user