Goktug Gokdogan has posted comments on this change.

Change subject: adding compare for several number types -Byte.compare -Short.compare -Integer.compare -Long.compare -Float.compare (Double already exists) fixes issue 7998
......................................................................


Patch Set 9:

(4 comments)

....................................................
File user/super/com/google/gwt/emul/java/lang/Float.java
Line 37:     if (isNaN(x)) {
Why do you need to do something like that?

Following should work fine:

 // All these checks should be false if x or y isNaN
 if(x < y) return -1;
 if(x > y) return 1;
 if(x == y) return 0;

 // below same isNaN check as before
 if( isNaN(x) )
  ....


....................................................
File user/super/com/google/gwt/emul/java/lang/Short.java
Line 37:     return Integer.compare(x, y);
One should never rely on it for sure, but if somehow they rely on it, it will work or fail consistently in both production and dev mode (i.e. less surprises). In general, it is best to not diverge prod vs dev if there is no good reason to do so (like a big performance hit).


....................................................
File user/test/com/google/gwt/emultest/java/lang/FloatTest.java
Line 81:   }
I guess there is no -0 in js and in that case there is not much to do,

On the other hand, I'm not very familiar how we handle numerical difference in js vs java. Thomas? John?


....................................................
File user/test/com/google/gwt/emultest/java/lang/IntegerTest.java
Line 120:     assertEquals(0, Integer.compare(1, 1));
I think we need to but we can create a bug and defer it to another time.

John & Thomas, any input here?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib33c93ff0fb3f7e4b93994a29d6e2a65898be246
Gerrit-PatchSet: 9
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Daniel Kurka <danku...@google.com>
Gerrit-Reviewer: Daniel Kurka <danku...@google.com>
Gerrit-Reviewer: Goktug Gokdogan <gok...@google.com>
Gerrit-Reviewer: John A. Tamplin <j...@jaet.org>
Gerrit-Reviewer: Leeroy Jenkins <jenk...@gwtproject.org>
Gerrit-Reviewer: Thomas Broyer <t.bro...@gmail.com>
Gerrit-HasComments: Yes

--
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