ICU-23265 Fixed parseMeasureUnitOption() so that it correctly handles…#3910
Conversation
sffc
left a comment
There was a problem hiding this comment.
Did you consider changing the impl of MeasureUnit::validateAndGet ?
Yes, but not for very long. I was back-porting a fix I'd already made in Apple ICU, and |
Okay, I went back and took another look, and it actually wasn't that bad to move the alias handling code into This wound up being a Java-only fix because there is no Java version of I think this commit should also fix the |
sffc
left a comment
There was a problem hiding this comment.
This is better, thanks. To keep C++ and Java aligned, I think I'd rather see the Java change pulled into a new function MeasureUnit.validateAndGet that looks like the C++ function.
Done. |
43724d5 to
25499e3
Compare
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
| if (result == null) { | ||
| try { | ||
| result = MeasureUnit.forIdentifier(subtype); | ||
| if (!result.getType().equals(type)) { |
There was a problem hiding this comment.
Observation: you don't have if (!result.getType().equals(type)) in the C++ code
There was a problem hiding this comment.
Yes, I do. The check for typeIdx >= 0 on line 2774 is doing that.
There was a problem hiding this comment.
Actually, you're right. I don't have that exact check. I'll add it...
|
In case anybody's wondering, |
… measurement unit alises.
f918639 to
884497d
Compare
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
… measurement unit aliases.
The idea here is to fix it so that
NumberFormat::forSkeleton()doesn't return a syntax error when the skeleton includes a measurement unit that has been renamed, such asconcentr-permillion. The idea is to maintain backward compatibility.Checklist