Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Parsers on CharSequence #5

merged 5 commits into from Jul 12, 2011


None yet
2 participants

barend commented Jul 11, 2011

This patch widens the input of the various parse() methods from String to CharSequence.

barend added some commits Jul 11, 2011

A stop-gap measure towards passing unit tests on non-English machines.
The unit test suite returns some 216 test failures if the default locale
is not an English locale. This commit simply forces it to English when
running the test suite.
Makes the parse() method for basic types accept CharSequence.
This is a widening of the range of acceptable inputs from String to
CharSequence. This allows javax.time objects to be parsed from inputs
such as StringBuilder or a nio CharBuffer without first allocating a
Defensive copy of invalid input in CalendricalParseExcepion.
A CharSequence (or a String) is potentially a very large object of which
only a subsequence was being parsed. Some CharSequence implementations
are mutable. An exception has a potentially unpredictable life time.
Rather than keeping a hard reference to the character sequence where the
parser error occured, make a defensive copy on construction.

barend commented Jul 12, 2011


@jodastephen jodastephen merged commit 9344a42 into ThreeTen:master Jul 12, 2011

renjith4 pushed a commit to renjith4/threeten that referenced this pull request Feb 4, 2012

Merge pull request #5 from jpgough/master
TestLocalTime now annotated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment