Daniel Kurka has submitted this change and it was merged.

Change subject: fix mismatch in Double/Float.isInfinite between dev / production
......................................................................


fix mismatch in Double/Float.isInfinite between dev / production

Double/Float.isFinite(Double/Float.NaN) behaved differently
in production

fixes ISSUE 8073

Change-Id: I6e7a891ff1339a64f3d9aaa57978fac6b23fdb64
---
M user/super/com/google/gwt/emul/java/lang/Double.java
M user/super/com/google/gwt/emul/java/lang/Float.java
M user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
M user/test/com/google/gwt/emultest/java/lang/FloatTest.java
4 files changed, 6 insertions(+), 2 deletions(-)

Approvals:
  John A. Tamplin: Looks good to me, approved
  Matthew Dempsky: Looks good to me, but someone else must approve
  Leeroy Jenkins: Verified
  Thomas Broyer: Looks good to me, but someone else must approve
  Brian Slesinsky: Looks good to me, but someone else must approve



diff --git a/user/super/com/google/gwt/emul/java/lang/Double.java b/user/super/com/google/gwt/emul/java/lang/Double.java
index 5144653..e32f9d2 100644
--- a/user/super/com/google/gwt/emul/java/lang/Double.java
+++ b/user/super/com/google/gwt/emul/java/lang/Double.java
@@ -192,7 +192,7 @@
   }

   public static native boolean isInfinite(double x) /*-{
-    return !isFinite(x);
+    return !isFinite(x) && !isNaN(x);
   }-*/;

   public static native boolean isNaN(double x) /*-{
diff --git a/user/super/com/google/gwt/emul/java/lang/Float.java b/user/super/com/google/gwt/emul/java/lang/Float.java
index f10cd9e..fe4bc2b 100644
--- a/user/super/com/google/gwt/emul/java/lang/Float.java
+++ b/user/super/com/google/gwt/emul/java/lang/Float.java
@@ -138,7 +138,7 @@
   }

   public static native boolean isInfinite(float x) /*-{
-    return !isFinite(x);
+    return !isFinite(x) && !isNaN(x);
   }-*/;

   public static native boolean isNaN(float x) /*-{
diff --git a/user/test/com/google/gwt/emultest/java/lang/DoubleTest.java b/user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
index c5a6cc7..c00782e 100644
--- a/user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
+++ b/user/test/com/google/gwt/emultest/java/lang/DoubleTest.java
@@ -119,6 +119,8 @@
     // Double.MAX_EXPONENT);
     // jdk1.6 assertEquals(Math.getExponent(Double.MIN_NORMAL),
     // Double.MIN_EXPONENT);
+    // issue 8073 - used to fail in prod mode
+    assertFalse(Double.isInfinite(Double.NaN));
   }

   public void testParse() {
diff --git a/user/test/com/google/gwt/emultest/java/lang/FloatTest.java b/user/test/com/google/gwt/emultest/java/lang/FloatTest.java
index 15c6718..67f5be6 100644
--- a/user/test/com/google/gwt/emultest/java/lang/FloatTest.java
+++ b/user/test/com/google/gwt/emultest/java/lang/FloatTest.java
@@ -64,6 +64,8 @@
     // Math.getExponent(Float.MIN_NORMAL));
     // jdk1.6 assertEquals(Float.MAX_EXPONENT,
     // Math.getExponent(Float.MAX_VALUE));
+    // issue 8073 - used to fail in prod mode
+    assertFalse(Float.isInfinite(Float.NaN));
   }

   public void testParse() {

--
To view, visit https://gwt-review.googlesource.com/2250
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6e7a891ff1339a64f3d9aaa57978fac6b23fdb64
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Daniel Kurka <kurka.dan...@gmail.com>
Gerrit-Reviewer: Brian Slesinsky <skybr...@google.com>
Gerrit-Reviewer: Daniel Kurka <danku...@google.com>
Gerrit-Reviewer: John A. Tamplin <j...@jaet.org>
Gerrit-Reviewer: Leeroy Jenkins <jenk...@gwtproject.org>
Gerrit-Reviewer: Matthew Dempsky <mdemp...@google.com>
Gerrit-Reviewer: Thomas Broyer <t.bro...@gmail.com>

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to