Open migrator opened 10 years ago
summary: Not Defined (No comment was entered for this change.)
status Not Defined creator: cgdecker@google.com created at: Aug 29, 2014
summary: Not Defined
Did we have any reservations that tryParse("foo", 10) might look like it's providing a default value rather than a radix? I forget.
(We did give some thought to Optional
status Not Defined creator: cpov...@google.com created at: Aug 29, 2014
Please add these overloaded methods:
Ints.tryParse(String s, int radix) Longs.tryParse(String s, int radix)
That way, Ints/Longs.tryParse could be used as drop-in replacements both String versions of Integer/Long.valueOf
Another thing worth thinking about would be to add similar methods that return Optional<Integer / Long>, forcing client code to actually react on the changed semantics of using tryParse rather than valueOf. Of course the question of how to name these methods is a nasty one. tryParse would've been a perfect naming choice for that
relevance: 2