DaveAKing / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Inconsistency between Ints and Longs in tryParse #1563

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As requested in
https://mail.google.com/mail/ca/u/0/#label/8-java%2Fguava/141e7f32e0596002
I'm filing this as bug.

Currently, Ints.tryParse accepts non-ASCII digits, while Long.tryParse does 
not. This is both undocumented and inconsistent. The questions are

- Should non-ascii digits be accepted?
- If so, should even mixed numbers like DEVANAGARI_DIGIT_ONE + "" + 
BENGALI_DIGIT_TWO be accepted?

Note also that currently the fastest way to parse an Integer is via 
Longs.tryParse (this doesn't necessarily mean that accepting non-ASCII must 
cause a slowdown).

https://microbenchmarks.appspot.com/runs/f32a811c-aeb5-40ac-ae48-07b60256838f

Original issue reported on code.google.com by Maaarti...@gmail.com on 28 Oct 2013 at 5:41

GoogleCodeExporter commented 9 years ago

Original comment by kevinb@google.com on 20 Nov 2013 at 8:14

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08