cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmen...@apache.org
Subject svn commit: r584645 - in /cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect: ConverterFactory.java PropertyUtils.java
Date Mon, 15 Oct 2007 00:11:29 GMT
Author: kmenard
Date: Sun Oct 14 17:11:22 2007
New Revision: 584645

URL: http://svn.apache.org/viewvc?rev=584645&view=rev
Log:
Use the canonical forms of floats and doubles.

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/PropertyUtils.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java?rev=584645&r1=584644&r2=584645&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/ConverterFactory.java
Sun Oct 14 17:11:22 2007
@@ -137,7 +137,7 @@
 
             Object convert(Object object, Class type) {
                 if (object == null) {
-                    return type.isPrimitive() ? new Double(0d) : null;
+                    return type.isPrimitive() ? new Double(0.0d) : null;
                 }
 
                 if (object instanceof Double) {
@@ -152,7 +152,7 @@
 
             Object convert(Object object, Class type) {
                 if (object == null) {
-                    return type.isPrimitive() ? new Float(0f) : null;
+                    return type.isPrimitive() ? new Float(0.0f) : null;
                 }
 
                 if (object instanceof Float) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/PropertyUtils.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/PropertyUtils.java?rev=584645&r1=584644&r2=584645&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/PropertyUtils.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/reflect/PropertyUtils.java
Sun Oct 14 17:11:22 2007
@@ -281,10 +281,10 @@
                 return new Character((char) 0);
             }
             else if ("double".equals(className)) {
-                return new Double(0d);
+                return new Double(0.0d);
             }
             else if ("float".equals(className)) {
-                return new Float(0f);
+                return new Float(0.0f);
             }
             else if ("boolean".equals(className)) {
                 return Boolean.FALSE;



Mime
View raw message