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

Issue 340310043: ticket:13513 ICU Number Parsing (Java)

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 2 months ago by andy.heninger
Modified:
6 years, 1 month ago
Reviewers:
andy.heninger, sffc
Base URL:
svn+ssh://source.icu-project.org/repos/icu/trunk/
Visibility:
Public.

Description

ticket:13513 ICU Number Parsing (Java)

Patch Set 1 #

Total comments: 18
Unified diffs Side-by-side diffs Delta from patch set Stats (+7523 lines, -3407 lines) Patch
M icu4c/source/test/intltest/numberformattesttuple.h View 3 chunks +3 lines, -0 lines 0 comments Download
M icu4c/source/test/intltest/numberformattesttuple.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M icu4c/source/test/intltest/numfmtst.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M icu4c/source/test/testdata/numberformattestspecification.txt View 21 chunks +91 lines, -60 lines 1 comment Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/TextTrieMap.java View 9 chunks +47 lines, -128 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/Utility.java View 1 chunk +15 lines, -0 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/number/AffixPatternProvider.java View 1 chunk +8 lines, -0 lines 1 comment Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/number/AffixUtils.java View 9 chunks +58 lines, -12 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/CurrencyPluralInfoAffixProvider.java View 1 chunk +64 lines, -0 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalFormatProperties.java View 9 chunks +3 lines, -41 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/number/DecimalQuantity_AbstractBCD.java View 7 chunks +48 lines, -6 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/number/MutablePatternModifier.java View 5 chunks +35 lines, -107 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/number/Parse.java View 1 chunk +0 lines, -2385 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/number/PatternStringParser.java View 1 chunk +1 line, -0 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/impl/number/PatternStringUtils.java View 2 chunks +77 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/PropertiesAffixPatternProvider.java View 1 chunk +145 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/AffixMatcher.java View 1 chunk +548 lines, -0 lines 2 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/AffixPatternMatcher.java View 1 chunk +264 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/AnyMatcher.java View 1 chunk +194 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/CodePointMatcher.java View 1 chunk +100 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/CurrencyMatcher.java View 1 chunk +142 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/CurrencyTrieMatcher.java View 1 chunk +142 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/DecimalMatcher.java View 1 chunk +716 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/IgnorablesMatcher.java View 1 chunk +86 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/InfinityMatcher.java View 1 chunk +96 lines, -0 lines 1 comment Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/MatcherFactory.java View 1 chunk +96 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/MinusSignMatcher.java View 1 chunk +108 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/MultiplierHandler.java View 1 chunk +80 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NanMatcher.java View 1 chunk +124 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParseMatcher.java View 1 chunk +124 lines, -0 lines 2 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParserImpl.java View 1 chunk +900 lines, -0 lines 4 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/PaddingMatcher.java View 1 chunk +72 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/ParsedNumber.java View 1 chunk +332 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/ParsingUtils.java View 1 chunk +110 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/PercentMatcher.java View 1 chunk +112 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/PermilleMatcher.java View 1 chunk +112 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/PlusSignMatcher.java View 1 chunk +106 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/RequireAffixMatcher.java View 1 chunk +50 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/RequireCurrencyMatcher.java View 1 chunk +48 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/RequireDecimalSeparatorMatcher.java View 1 chunk +74 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/RequireExponentMatcher.java View 1 chunk +48 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/RequireNumberMatcher.java View 1 chunk +50 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/ScientificMatcher.java View 1 chunk +212 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/SeriesMatcher.java View 1 chunk +228 lines, -0 lines 0 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/StringSegment.java View 1 chunk +218 lines, -0 lines 1 comment Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/SymbolMatcher.java View 1 chunk +164 lines, -0 lines 1 comment Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/UnicodeSetStaticCache.java View 1 chunk +260 lines, -0 lines 2 comments Download
A icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/ValidationMatcher.java View 1 chunk +46 lines, -0 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/number/Grouper.java View 3 chunks +43 lines, -1 line 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/number/NumberPropertyMapper.java View 6 chunks +5 lines, -196 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java View 9 chunks +74 lines, -33 lines 1 comment Download
M icu4j/main/classes/core/src/com/ibm/icu/text/ScientificNumberFormatter.java View 3 chunks +3 lines, -3 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/text/TimeZoneFormat.java View 2 chunks +6 lines, -6 lines 0 comments Download
M icu4j/main/classes/core/src/com/ibm/icu/util/Currency.java View 2 chunks +4 lines, -10 lines 0 comments Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt View 20 chunks +90 lines, -58 lines 1 comment Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DataDrivenNumberFormatTestData.java View 3 chunks +6 lines, -0 lines 0 comments Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DataDrivenNumberFormatTestUtility.java View 1 chunk +1 line, -1 line 0 comments Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatDataDrivenTest.java View 8 chunks +113 lines, -97 lines 0 comments Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java View 22 chunks +92 lines, -135 lines 0 comments Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/AffixUtilsTest.java View 4 chunks +28 lines, -1 line 0 comments Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/DecimalQuantityTest.java View 3 chunks +38 lines, -0 lines 1 comment Download
A icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/NumberParserTest.java View 1 chunk +220 lines, -0 lines 0 comments Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/PropertiesTest.java View 2 chunks +1 line, -8 lines 0 comments Download
A icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/StringSegmentTest.java View 1 chunk +99 lines, -0 lines 0 comments Download
A icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/UnicodeSetStaticCacheTest.java View 1 chunk +91 lines, -0 lines 0 comments Download
M icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/TextTrieMapTest.java View 7 chunks +48 lines, -119 lines 0 comments Download

Messages

Total messages: 2
sffc
https://codereview.appspot.com/340310043/diff/1/icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt File icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt (right): https://codereview.appspot.com/340310043/diff/1/icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt#newcode1228 icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt:1228: // P fails here because this currency name is ...
6 years, 1 month ago (2018-03-01 23:02:34 UTC) #1
andy.heninger
6 years, 1 month ago (2018-03-19 02:39:33 UTC) #2
aa

https://codereview.appspot.com/340310043/diff/1/icu4c/source/test/testdata/nu...
File icu4c/source/test/testdata/numberformattestspecification.txt (right):

https://codereview.appspot.com/340310043/diff/1/icu4c/source/test/testdata/nu...
icu4c/source/test/testdata/numberformattestspecification.txt:955: // C and P
consume the '9' as a digit and assumes number is negative
P is not described in the doc describing the file format.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File
icu4j/main/classes/core/src/com/ibm/icu/impl/number/AffixPatternProvider.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/AffixPatternProvider.java:5:
public interface AffixPatternProvider {
Add some description, since it appears to be important.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/AffixMatcher.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/AffixMatcher.java:47:
private static boolean isInteresting(
Add a comment saying determines if a matcher needs to be built.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/AffixMatcher.java:91:
ArrayList<AffixMatcher> matchers = new ArrayList<AffixMatcher>(6);
should be 9, not 6

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/InfinityMatcher.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/InfinityMatcher.java:45:
return "<PercentMatcher>";
wrong name

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParseMatcher.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParseMatcher.java:8:
* Given a string, there should NOT be more than one way to consume the string
with the same matcher
maybe the top comment should be What Is a NumberPaarserMatcther, then discuss
exponential time considerations.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParseMatcher.java:45:
* Should return a set representing all possible chars (UTF-16 code units) that
could be the first
Comment out of date

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParserImpl.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParserImpl.java:70:
public static NumberParserImpl createParserFromPattern(
add comment for test only functions, saying so.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParserImpl.java:228:
if (!isStrict
nested !isStrict why?

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParserImpl.java:288:
* @param ignoreCase
doesn't match actual param

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/NumberParserImpl.java:331:
public void setComparator(Comparator<ParsedNumber> comparator) {
Shane asks if this is more confusing than it's worth.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/StringSegment.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/StringSegment.java:76:
public int getCodePoint() {
supplemental handling is wrong, but was fixed already.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/SymbolMatcher.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/SymbolMatcher.java:15:
// TODO: Implement this class using only UnicodeSet and not String?
UnicodeSets can hold strings as well as code points. Not sure that it would make
things any simpler, though.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/UnicodeSetStaticCache.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/UnicodeSetStaticCache.java:31:
// - PERIOD is a superset of SCRICT_PERIOD
Typo SCRICT

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/impl/number/parse/UnicodeSetStaticCache.java:98:
// TODO: Re-generate these sets from the UCD. They probably haven't been updated
in a while.
Could you have a test that fails if it looks like any of these need updating?

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
File icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java (right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/classes/core/src/c...
icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java:277: * read and
write at the same time.
We should describe more fully what is safe and not safe for use of the old API.
It may not be quite as bad as this comment implies.

What the old API was trying to accomplish with synchronized setters is confusing
to me. It's not consistent with ICU4C threading, which is what I thought the old
Java API was trying to do.

https://codereview.appspot.com/340310043/diff/1/icu4j/main/tests/core/src/com...
File
icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/DecimalQuantityTest.java
(right):

https://codereview.appspot.com/340310043/diff/1/icu4j/main/tests/core/src/com...
icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/DecimalQuantityTest.java:525:
quantity.setToBigInteger(new BigInteger("9223372036854775808"));
How about -9223372036854775808?
Sign in to reply to this message.

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