cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r691246 - in /cxf/trunk: rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java
Date Tue, 02 Sep 2008 13:42:34 GMT
Author: dkulp
Date: Tue Sep  2 06:42:32 2008
New Revision: 691246

URL: http://svn.apache.org/viewvc?rev=691246&view=rev
Log:
[CXF-1780] Fix -INF/INF in corba binding. Patch from Matteo Vescovi applied.

Modified:
    cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java

Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java?rev=691246&r1=691245&r2=691246&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/types/CorbaPrimitiveHandler.java
Tue Sep  2 06:42:32 2008
@@ -154,14 +154,18 @@
             data = ((java.math.BigInteger)value).toString();
             break;
         case TCKind._tk_float:
-            if (((Float)value).isInfinite()) {
+            if (((Float)value).equals(Float.NEGATIVE_INFINITY)) {
+                data = "-INF";
+            } else if (((Float)value).equals(Float.POSITIVE_INFINITY)) {
                 data = "INF";
             } else {
                 data = ((Float)value).toString();
             }
             break;
         case TCKind._tk_double:
-            if (((Double)value).isInfinite()) {
+            if (((Double)value).equals(Double.NEGATIVE_INFINITY)) {
+                data = "-INF";
+            } else if (((Double)value).equals(Double.POSITIVE_INFINITY)) {
                 data = "INF";
             } else {
                 data = ((Double)value).toString();
@@ -294,17 +298,23 @@
             data = java.math.BigInteger.valueOf(any.extract_ulonglong()).toString();
             break;
         case TCKind._tk_float:
-            if (Float.isInfinite(any.extract_float())) {
+            Float f = any.extract_float();
+            if (f.equals(Float.NEGATIVE_INFINITY)) {
+                data = "-INF";
+            } else if (f.equals(Float.POSITIVE_INFINITY)) {
                 data = "INF";
             } else {
-                data = Float.toString(any.extract_float());
+                data = f.toString();
             }
             break;
         case TCKind._tk_double:
-            if (Double.isInfinite(any.extract_double())) {
+            Double d = any.extract_double();
+            if (d.equals(Double.NEGATIVE_INFINITY)) {
+                data = "-INF";
+            } else if (d.equals(Double.POSITIVE_INFINITY)) {
                 data = "INF";
             } else {
-                data = Double.toString(any.extract_double());
+                data = d.toString();
             }
             break;
         case TCKind._tk_string:

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java?rev=691246&r1=691245&r2=691246&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/corba/CORBADocLitClientTypeTest.java
Tue Sep  2 06:42:32 2008
@@ -195,10 +195,13 @@
     }
     
     protected float[][] getTestFloatData() {
-        return new float[][] {{0.0f, 1.0f}, {-1.0f, (float)java.lang.Math.PI}, {-100.0f,
100.0f}};
+        return new float[][] {{0.0f, 1.0f}, {-1.0f, (float)java.lang.Math.PI},
+                              {-100.0f, 100.0f},
+                              {Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY}};
     }
     protected double[][] getTestDoubleData() {
-        return new double[][] {{0.0f, 1.0f}, {-1, java.lang.Math.PI}, {-100.0, 100.0}};
+        return new double[][] {{0.0f, 1.0f}, {-1, java.lang.Math.PI}, {-100.0, 100.0},
+                               {Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY}};
     }
 
 }



Mime
View raw message