svn commit: r672703 - in /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util: HttpRequestFileUpload.java UtilDateTime.java UtilFormatOut.java UtilJ2eeCompat.java UtilParse.java string/FlexibleStringExpander.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r672703 - in /ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util: HttpRequestFileUpload.java UtilDateTime.java UtilFormatOut.java UtilJ2eeCompat.java UtilParse.java string/FlexibleStringExpander.java

doogie-3
Author: doogie
Date: Sun Jun 29 21:39:50 2008
New Revision: 672703

URL: http://svn.apache.org/viewvc?rev=672703&view=rev
Log:
Use more Number.valueOf instead of creating new values all the time.

Modified:
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpRequestFileUpload.java
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilDateTime.java
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilFormatOut.java
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJ2eeCompat.java
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilParse.java
    ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/string/FlexibleStringExpander.java

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpRequestFileUpload.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpRequestFileUpload.java?rev=672703&r1=672702&r2=672703&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpRequestFileUpload.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/HttpRequestFileUpload.java Sun Jun 29 21:39:50 2008
@@ -122,7 +122,7 @@
         int requestLength = 0;
 
         try {
-            requestLength = new Integer(reqLengthString).intValue();
+            requestLength = Integer.valueOf(reqLengthString).intValue();
         } catch (Exception e2) {
             e2.printStackTrace();
             return;

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilDateTime.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilDateTime.java?rev=672703&r1=672702&r2=672703&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilDateTime.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilDateTime.java Sun Jun 29 21:39:50 2008
@@ -226,7 +226,7 @@
     }
 
     public static java.sql.Timestamp getDayEnd(java.sql.Timestamp stamp) {
-        return getDayEnd(stamp, new Long(0));
+        return getDayEnd(stamp, Long.valueOf(0));
     }
 
     public static java.sql.Timestamp getDayEnd(java.sql.Timestamp stamp, Long daysLater) {
@@ -803,7 +803,7 @@
     }
 
     public static Timestamp getDayEnd(Timestamp stamp, TimeZone timeZone, Locale locale) {
-        return getDayEnd(stamp, new Long(0), timeZone, locale);
+        return getDayEnd(stamp, Long.valueOf(0), timeZone, locale);
     }
 
     public static Timestamp getDayEnd(Timestamp stamp, Long daysLater, TimeZone timeZone, Locale locale) {

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilFormatOut.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilFormatOut.java?rev=672703&r1=672702&r2=672703&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilFormatOut.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilFormatOut.java Sun Jun 29 21:39:50 2008
@@ -61,10 +61,10 @@
 
     public static Double formatPriceNumber(double price) {
         try {
-            return new Double(priceDecimalFormat.parse(formatPrice(price)).doubleValue());
+            return Double.valueOf(priceDecimalFormat.parse(formatPrice(price)).doubleValue());
         } catch (ParseException e) {
             Debug.logError(e, module);
-            return new Double(price);
+            return Double.valueOf(price);
         }
     }
 

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJ2eeCompat.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJ2eeCompat.java?rev=672703&r1=672702&r2=672703&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJ2eeCompat.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilJ2eeCompat.java Sun Jun 29 21:39:50 2008
@@ -93,9 +93,9 @@
                 usestream = false;
             }
 
-            doFlushOnRenderValue = new Boolean(doflush);
-            useOutputStreamNotWriterValue = new Boolean(usestream);
-            useNestedJspException = new Boolean(nestjspexception);
+            doFlushOnRenderValue = Boolean.valueOf(doflush);
+            useOutputStreamNotWriterValue = Boolean.valueOf(usestream);
+            useNestedJspException = Boolean.valueOf(nestjspexception);
         }
     }
 }

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilParse.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilParse.java?rev=672703&r1=672702&r2=672703&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilParse.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/UtilParse.java Sun Jun 29 21:39:50 2008
@@ -44,6 +44,6 @@
         if (doubleString.length() < 1) {
             return null;
         }
-        return new Double(doubleString);
+        return Double.valueOf(doubleString);
     }
 }

Modified: ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/string/FlexibleStringExpander.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/string/FlexibleStringExpander.java?rev=672703&r1=672702&r2=672703&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/string/FlexibleStringExpander.java (original)
+++ ofbiz/trunk/framework/base/src/base/org/ofbiz/base/util/string/FlexibleStringExpander.java Sun Jun 29 21:39:50 2008
@@ -388,7 +388,7 @@
             Object envVal = fma.get(context, locale);
             if (envVal != null) {
                 if (localizeCurrency) {
-                    targetBuffer.append(UtilFormatOut.formatCurrency(new Double(envVal.toString()), currencyCode, locale));
+                    targetBuffer.append(UtilFormatOut.formatCurrency(Double.valueOf(envVal.toString()), currencyCode, locale));
                 } else {
                     try {
                         targetBuffer.append(ObjectType.simpleTypeConvert(envVal, "String", null, timeZone, locale, true));