You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2006/12/04 18:41:15 UTC

svn commit: r482260 - in /incubator/ofbiz/trunk: applications/order/src/org/ofbiz/order/order/ framework/base/src/base/org/ofbiz/base/util/ framework/base/src/base/org/ofbiz/base/util/cache/ framework/minilang/src/org/ofbiz/minilang/method/eventops/

Author: jacopoc
Date: Mon Dec  4 09:41:14 2006
New Revision: 482260

URL: http://svn.apache.org/viewvc?view=rev&rev=482260
Log:
Applied patch from Stefan Huehner (OFBIZ-514) to remove some unnecessary casts.

Modified:
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
    incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java
    incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/cache/UtilCache.java
    incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?view=diff&rev=482260&r1=482259&r2=482260
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Mon Dec  4 09:41:14 2006
@@ -1690,7 +1690,7 @@
            for (Iterator groupiter = group.iterator(); groupiter.hasNext(); ) {
                GenericValue returnItem = (GenericValue) groupiter.next();
                if (returnItem.getDouble("returnQuantity") != null) {
-                   returned += ((Double) returnItem.getDouble("returnQuantity")).doubleValue();
+                   returned += (returnItem.getDouble("returnQuantity")).doubleValue();
                }
            }
 

Modified: incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java?view=diff&rev=482260&r1=482259&r2=482260
==============================================================================
--- incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java (original)
+++ incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/StringUtil.java Mon Dec  4 09:41:14 2006
@@ -275,7 +275,7 @@
     public static String cleanHexString(String str) {
         StringBuffer buf = new StringBuffer();
         for (int i = 0; i < str.length(); i++) {
-            if (str.charAt(i) != (int) 32 && str.charAt(i) != ':') {
+            if (str.charAt(i) != 32 && str.charAt(i) != ':') {
                 buf.append(str.charAt(i));
             }
         }

Modified: incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/cache/UtilCache.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/cache/UtilCache.java?view=diff&rev=482260&r1=482259&r2=482260
==============================================================================
--- incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/cache/UtilCache.java (original)
+++ incubator/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/cache/UtilCache.java Mon Dec  4 09:41:14 2006
@@ -274,7 +274,7 @@
         }
 
         int maxMemSize = this.maxInMemory;
-        if (maxMemSize == 0) maxMemSize = (int) maxSize;
+        if (maxMemSize == 0) maxMemSize = maxSize;
         this.cacheLineTable = new CacheLineTable(this.fileStore, this.name, this.useFileSystemStore, maxMemSize);
     }
 
@@ -493,7 +493,7 @@
      * @param maxSize The maximum number of elements in the cache
      */
     public void setMaxSize(int maxSize) {
-        cacheLineTable.setLru((int) maxSize);
+        cacheLineTable.setLru(maxSize);
         this.maxSize = maxSize;
     }
 

Modified: incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java?view=diff&rev=482260&r1=482259&r2=482260
==============================================================================
--- incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java (original)
+++ incubator/ofbiz/trunk/framework/minilang/src/org/ofbiz/minilang/method/eventops/WebappPropertyToField.java Mon Dec  4 09:41:14 2006
@@ -74,15 +74,9 @@
             }
         }
 
-        // if fieldVal is null, or is a String and has zero length, use defaultVal
-        if (fieldVal == null) {
+        // if fieldVal is null, or has zero length, use defaultVal
+        if ((fieldVal == null) || (fieldVal.length() == 0)){
             fieldVal = defaultVal;
-        } else if (fieldVal instanceof String) {
-            String strVal = (String) fieldVal;
-
-            if (strVal.length() == 0) {
-                fieldVal = defaultVal;
-            }
         }
 
         if (!mapAcsr.isEmpty()) {