Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(35)

Issue 6354088: Add {Doubles,Floats}.tryParse (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by Louis Wasserman
Modified:
11 years, 8 months ago
CC:
Colin Decker
Visibility:
Public.

Patch Set 1 #

Total comments: 10

Patch Set 2 : Respond to comments #

Total comments: 6

Patch Set 3 : Respond to comments #

Patch Set 4 : Add changes to FloatsTest #

Total comments: 8

Patch Set 5 : Respond to comments #

Total comments: 9

Patch Set 6 : Respond to comments #

Total comments: 6

Patch Set 7 : Respond to comments #

Total comments: 8

Patch Set 8 : Respond to comments #

Total comments: 1

Patch Set 9 : Respond to comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+282 lines, -5 lines) Patch
M guava-tests/test/com/google/common/primitives/DoublesTest.java View 1 2 3 4 5 6 7 8 3 chunks +99 lines, -5 lines 0 comments Download
M guava-tests/test/com/google/common/primitives/FloatsTest.java View 1 2 3 4 5 6 7 8 2 chunks +88 lines, -0 lines 0 comments Download
M guava/src/com/google/common/primitives/Doubles.java View 1 2 3 4 5 6 7 3 chunks +59 lines, -0 lines 0 comments Download
M guava/src/com/google/common/primitives/Floats.java View 1 2 3 4 5 6 3 chunks +36 lines, -0 lines 0 comments Download

Messages

Total messages: 31
Louis Wasserman
Kevin, I'd appreciate it if you could skim the docs; Pete should probably check the ...
11 years, 9 months ago (2012-07-09 12:01:38 UTC) #1
Kevin Bourrillion
http://codereview.appspot.com/6354088/diff/1/guava/src/com/google/common/primitives/Doubles.java File guava/src/com/google/common/primitives/Doubles.java (right): http://codereview.appspot.com/6354088/diff/1/guava/src/com/google/common/primitives/Doubles.java#newcode548 guava/src/com/google/common/primitives/Doubles.java:548: "(((0[xX](\\p{XDigit}+)(\\.)?)|(0[xX](\\p{XDigit}+)?(\\.)(\\p{XDigit}+)))" + Some formatting issues here, but bigger issues ...
11 years, 9 months ago (2012-07-09 14:30:57 UTC) #2
peteg
Am I supposed to be taking a look at this, or waiting for Louis to ...
11 years, 9 months ago (2012-07-11 17:06:04 UTC) #3
Louis Wasserman
If you could survey the tests, that'd be great; I'm getting around to Kevin's comments. ...
11 years, 9 months ago (2012-07-11 17:15:40 UTC) #4
Louis Wasserman
http://codereview.appspot.com/6354088/diff/1/guava/src/com/google/common/primitives/Doubles.java File guava/src/com/google/common/primitives/Doubles.java (right): http://codereview.appspot.com/6354088/diff/1/guava/src/com/google/common/primitives/Doubles.java#newcode548 guava/src/com/google/common/primitives/Doubles.java:548: "(((0[xX](\\p{XDigit}+)(\\.)?)|(0[xX](\\p{XDigit}+)?(\\.)(\\p{XDigit}+)))" + On 2012/07/09 14:30:58, kevinb wrote: > Some ...
11 years, 9 months ago (2012-07-12 10:37:52 UTC) #5
peteg
I think we can be a bit more thorough in the testing. Here are some ...
11 years, 9 months ago (2012-07-12 18:11:24 UTC) #6
Louis Wasserman
http://codereview.appspot.com/6354088/diff/6001/guava-tests/test/com/google/common/primitives/DoublesTest.java File guava-tests/test/com/google/common/primitives/DoublesTest.java (right): http://codereview.appspot.com/6354088/diff/6001/guava-tests/test/com/google/common/primitives/DoublesTest.java#newcode407 guava-tests/test/com/google/common/primitives/DoublesTest.java:407: assertEquals(Double.valueOf(-3.8e16), Doubles.tryParse("-3.8e16")); On 2012/07/12 18:11:24, peteg wrote: > Other ...
11 years, 9 months ago (2012-07-12 18:56:05 UTC) #7
peteg
Yep, I like those tests a lot more! Thanks. Just a few minor points (which ...
11 years, 9 months ago (2012-07-13 12:30:02 UTC) #8
Louis Wasserman
http://codereview.appspot.com/6354088/diff/1006/guava-tests/test/com/google/common/primitives/DoublesTest.java File guava-tests/test/com/google/common/primitives/DoublesTest.java (right): http://codereview.appspot.com/6354088/diff/1006/guava-tests/test/com/google/common/primitives/DoublesTest.java#newcode409 guava-tests/test/com/google/common/primitives/DoublesTest.java:409: } On 2012/07/13 12:30:02, peteg wrote: > Personally, I ...
11 years, 9 months ago (2012-07-16 15:58:59 UTC) #9
peteg
I have three nits, which apply to DoublesTest and FloatsTest. Otherwise, the tests and the ...
11 years, 9 months ago (2012-07-16 18:51:44 UTC) #10
Kevin Bourrillion
http://codereview.appspot.com/6354088/diff/12001/guava/src/com/google/common/primitives/Doubles.java File guava/src/com/google/common/primitives/Doubles.java (right): http://codereview.appspot.com/6354088/diff/12001/guava/src/com/google/common/primitives/Doubles.java#newcode548 guava/src/com/google/common/primitives/Doubles.java:548: "[+-]?(NaN|Infinity|(((\\d+(\\.)?(\\d*)([eE][+-]?\\d+)?)|(\\.(\\d+)(" + style nits: indent 4, not 6, and ...
11 years, 9 months ago (2012-07-16 19:13:21 UTC) #11
Louis Wasserman
All nits addressed. After Kevin's LGTM, I'll forward this along to Chris or Colin for ...
11 years, 9 months ago (2012-07-19 10:05:37 UTC) #12
Kevin Bourrillion
LGTM I have no idea if there's an official way to do that in this ...
11 years, 9 months ago (2012-07-19 13:50:23 UTC) #13
peteg
The frontend seems to recognize that four-letter sequence and turn the comment green, at least... ...
11 years, 9 months ago (2012-07-19 13:52:23 UTC) #14
Louis Wasserman
Colin, this has Kevin's and Pete's LGTMs. If this change could be imported from https://code.google.com/r/wassermanlouis-guava/source/detail?r=823d80ebafeea9a90ae21b190ac6ac065d1f8c92&name=try-parse-fp ...
11 years, 9 months ago (2012-07-19 13:55:13 UTC) #15
martinrb
There ought to be a much more extensive test to check for compatibility, that checks ...
11 years, 9 months ago (2012-07-20 20:51:33 UTC) #16
martinrb
http://codereview.appspot.com/6354088/diff/18001/guava/src/com/google/common/primitives/Floats.java File guava/src/com/google/common/primitives/Floats.java (right): http://codereview.appspot.com/6354088/diff/18001/guava/src/com/google/common/primitives/Floats.java#newcode546 guava/src/com/google/common/primitives/Floats.java:546: * @param string the string representation of a {@code ...
11 years, 9 months ago (2012-07-20 21:48:59 UTC) #17
Louis Wasserman
Hopefully this looks a little better. In particular, I added a test for all strings ...
11 years, 9 months ago (2012-07-22 12:22:26 UTC) #18
martinrb
I tried (and failed) to break this, by creating my own test method. This method ...
11 years, 9 months ago (2012-07-23 21:13:38 UTC) #19
martinrb
http://codereview.appspot.com/6354088/diff/25001/guava/src/com/google/common/primitives/Doubles.java File guava/src/com/google/common/primitives/Doubles.java (right): http://codereview.appspot.com/6354088/diff/25001/guava/src/com/google/common/primitives/Doubles.java#newcode564 guava/src/com/google/common/primitives/Doubles.java:564: * <p>Unlike {@link Double#parseDouble(String)}, this method returns I think ...
11 years, 9 months ago (2012-07-23 21:20:29 UTC) #20
martinrb
Since we fallback to Double.parseDouble, false positive bugs in our regexp detection (which only cause ...
11 years, 9 months ago (2012-07-25 20:19:48 UTC) #21
Louis Wasserman
http://codereview.appspot.com/6354088/diff/25001/guava/src/com/google/common/primitives/Doubles.java File guava/src/com/google/common/primitives/Doubles.java (right): http://codereview.appspot.com/6354088/diff/25001/guava/src/com/google/common/primitives/Doubles.java#newcode551 guava/src/com/google/common/primitives/Doubles.java:551: String decimal = "(\\d++(\\.\\d*+)?|\\.\\d++)"; On 2012/07/23 21:13:38, martinrb wrote: ...
11 years, 9 months ago (2012-07-26 10:09:26 UTC) #22
martinrb
Looks good. Thank you for your patience. Not all of the changes to Double* have ...
11 years, 9 months ago (2012-07-26 22:46:47 UTC) #23
peteg
Martin: Including the magic word 'LGTM' in your comment makes it turn green in the ...
11 years, 8 months ago (2012-07-27 08:35:42 UTC) #24
martinrb
On Fri, Jul 27, 2012 at 1:35 AM, <peteg@google.com> wrote: > Martin: Including the magic ...
11 years, 8 months ago (2012-07-27 19:49:14 UTC) #25
Louis Wasserman
I wasn't actually quite sure which of these changes should be mirrored to Floats, since ...
11 years, 8 months ago (2012-07-27 20:15:46 UTC) #26
martinrb
On Fri, Jul 27, 2012 at 1:15 PM, Louis Wasserman <wasserman.louis@gmail.com>wrote: > I wasn't actually ...
11 years, 8 months ago (2012-07-27 20:53:52 UTC) #27
martinrb
On Fri, Jul 27, 2012 at 1:15 PM, Louis Wasserman <wasserman.louis@gmail.com>wrote: > I wasn't actually ...
11 years, 8 months ago (2012-07-27 20:55:47 UTC) #28
Louis Wasserman
Maybe it's only comments which _start_ with LGTM? Louis Wasserman wasserman.louis@gmail.com http://profiles.google.com/wasserman.louis On Fri, Jul ...
11 years, 8 months ago (2012-07-27 20:58:50 UTC) #29
martinrb
On Fri, Jul 27, 2012 at 1:58 PM, Louis Wasserman <wasserman.louis@gmail.com>wrote: > Maybe it's only ...
11 years, 8 months ago (2012-07-27 21:05:38 UTC) #30
Louis Wasserman
11 years, 8 months ago (2012-07-28 17:54:06 UTC) #31
I've mirrored the tests to FloatsTest, but excised the regex-testing parts.

Colin, could you mirror this in from
https://code.google.com/r/wassermanlouis-guava/source/list?name=try-parse-fp ?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b