Author: jleroux
Date: Sat Nov 28 14:08:16 2009
New Revision: 885093

URL: http://svn.apache.org/viewvc?rev=885093&view=rev
Log:
Some cleaning related to isEmpty 
* remove duplicate ()
* remove casts no longer needed

I'm doing these last tasks around isEmpty and isNotEmpty mostly to be sure that 
nothing has slipped in. Despite I have been very careful, I prefer double check.

+ one typo in ofbizSelenium help (not sure this file is used yet though, seems 
to be missing some parts which are commented out, for now I guess)


Modified:
    
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
    
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
    
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
    
ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
    
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java
    ofbiz/trunk/framework/testtools/documents/OfbizSeleniumSetupHTTPS.xml

Modified: 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=885093&r1=885092&r2=885093&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
 Sat Nov 28 14:08:16 2009
@@ -1534,7 +1534,7 @@
         }
         String userLoginId = request.getParameter("userLoginId");
         if (partyId != null || userLoginId != null) {
-            if (UtilValidate.isEmpty((partyId)) && 
UtilValidate.isNotEmpty(userLoginId)) {
+            if (UtilValidate.isEmpty(partyId) && 
UtilValidate.isNotEmpty(userLoginId)) {
                 GenericValue thisUserLogin = null;
                 try {
                     thisUserLogin = delegator.findByPrimaryKey("UserLogin", 
UtilMisc.toMap("userLoginId", userLoginId));

Modified: 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=885093&r1=885092&r2=885093&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java
 Sat Nov 28 14:08:16 2009
@@ -162,7 +162,7 @@
         }
 
         // stores the default desired delivery date in the cart if need
-        if (!UtilValidate.isEmpty((String) 
context.get("useAsDefaultDesiredDeliveryDate"))) {
+        if 
(!UtilValidate.isEmpty(context.get("useAsDefaultDesiredDeliveryDate"))) {
             cart.setDefaultItemDeliveryDate((String) 
context.get("itemDesiredDeliveryDate"));
         } else {
             // do we really want to clear this if it isn't checked?
@@ -170,7 +170,7 @@
         }
 
         // stores the default comment in session if need
-        if (!UtilValidate.isEmpty((String) 
context.get("useAsDefaultComment"))) {
+        if (!UtilValidate.isEmpty(context.get("useAsDefaultComment"))) {
             cart.setDefaultItemComment((String) context.get("itemComment"));
         } else {
             // do we really want to clear this if it isn't checked?

Modified: 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=885093&r1=885092&r2=885093&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
 Sat Nov 28 14:08:16 2009
@@ -640,8 +640,8 @@
 
                 Map messageContext = UtilMisc.toMap("quantity", 
productPromoAction.get("quantity"), "amount", productPromoAction.get("amount"), 
"productId", productId, "partyId", productPromoAction.get("partyId"));
 
-                if (UtilValidate.isEmpty((String) 
messageContext.get("productId"))) messageContext.put("productId", "any");
-                if (UtilValidate.isEmpty((String) 
messageContext.get("partyId"))) messageContext.put("partyId", "any");
+                if (UtilValidate.isEmpty(messageContext.get("productId"))) 
messageContext.put("productId", "any");
+                if (UtilValidate.isEmpty(messageContext.get("partyId"))) 
messageContext.put("partyId", "any");
                 GenericValue product = 
delegator.findByPrimaryKeyCache("Product", UtilMisc.toMap("productId", 
productId));
                 if (product != null) {
                     messageContext.put("productName", 
ProductContentWrapper.getProductContentAsText(product, "PRODUCT_NAME", locale, 
null));

Modified: 
ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java?rev=885093&r1=885092&r2=885093&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
 (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/product/store/ProductStoreWorker.java
 Sat Nov 28 14:08:16 2009
@@ -333,7 +333,7 @@
                 // check the items excluded from shipping
                 String includeFreeShipping = 
method.getString("includeNoChargeItems");
                 if (includeFreeShipping != null && 
"N".equalsIgnoreCase(includeFreeShipping)) {
-                    if (UtilValidate.isEmpty((itemSizes)) && 
orderTotal.compareTo(BigDecimal.ZERO) == 0) {
+                    if (UtilValidate.isEmpty(itemSizes) && 
orderTotal.compareTo(BigDecimal.ZERO) == 0) {
                         returnShippingMethods.remove(method);
                         //Debug.logInfo("Removed shipping method due to all 
items being exempt from shipping", module);
                         continue;

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java?rev=885093&r1=885092&r2=885093&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilHttp.java Sat Nov 28 
14:08:16 2009
@@ -1203,7 +1203,7 @@
             if (date == null || date.length() < 10) return null;
             if (UtilValidate.isEmpty(hour)) return null;
             if (UtilValidate.isEmpty(minutes)) return null;
-            boolean isTwelveHour = (UtilValidate.isEmpty((ampm)) ? false : 
true);
+            boolean isTwelveHour = UtilValidate.isEmpty(ampm);
 
             // create the timestamp from the data
             try {

Modified: 
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=885093&r1=885092&r2=885093&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java 
(original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Sat 
Nov 28 14:08:16 2009
@@ -2997,7 +2997,7 @@
             if (field.getEncrypt()) {
                 Object obj = entity.get(field.getName());
                 if (obj != null) {
-                    if (obj instanceof String && UtilValidate.isEmpty((String) 
obj)) {
+                    if (obj instanceof String && UtilValidate.isEmpty(obj)) {
                         continue;
                     }
                     entity.dangerousSetNoCheckButFast(field, 
this.encryptFieldValue(entityName, obj));
@@ -3011,7 +3011,7 @@
      */
     public Object encryptFieldValue(String entityName, Object fieldValue) 
throws EntityCryptoException {
         if (fieldValue != null) {
-            if (fieldValue instanceof String && UtilValidate.isEmpty((String) 
fieldValue)) {
+            if (fieldValue instanceof String && 
UtilValidate.isEmpty(fieldValue)) {
                 return fieldValue;
             }
             return this.crypto.encrypt(entityName, fieldValue);

Modified: 
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java?rev=885093&r1=885092&r2=885093&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java
 (original)
+++ 
ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java
 Sat Nov 28 14:08:16 2009
@@ -311,9 +311,9 @@
                     // 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((Collection<?>) result.get("valuesToCreate")) ||
-                            !UtilValidate.isEmpty((Collection<?>) 
result.get("valuesToStore")) ||
-                            !UtilValidate.isEmpty((Collection<?>) 
result.get("keysToRemove")))) {
+                    if (startDate != null && 
(!UtilValidate.isEmpty(result.get("valuesToCreate")) ||
+                            !UtilValidate.isEmpty(result.get("valuesToStore")) 
||
+                            
!UtilValidate.isEmpty(result.get("keysToRemove")))) {
 
                         // yep, we got more data
                         gotMoreData = true;

Modified: ofbiz/trunk/framework/testtools/documents/OfbizSeleniumSetupHTTPS.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/testtools/documents/OfbizSeleniumSetupHTTPS.xml?rev=885093&r1=885092&r2=885093&view=diff
==============================================================================
--- ofbiz/trunk/framework/testtools/documents/OfbizSeleniumSetupHTTPS.xml 
(original)
+++ ofbiz/trunk/framework/testtools/documents/OfbizSeleniumSetupHTTPS.xml Sat 
Nov 28 14:08:16 2009
@@ -122,7 +122,7 @@
                             <para>Uncheck “autoscrolling” option from 
“General” tab</para>
                         </listitem>
                         <listitem>
-                            <para>uncheck “warn me …” and “Ssearch 
Engines”option from “Update” tab </para>
+                            <para>uncheck “warn me …” and “Search 
Engines”option from “Update” tab </para>
                         </listitem>
                     </orderedlist>
                 </para>


Reply via email to