Bug 338338 - Time Units should be related to ICU TimeUnit
Summary: Time Units should be related to ICU TimeUnit
Status: RESOLVED WONTFIX
Alias: None
Product: UOMo
Classification: Technology
Component: Units (show other bugs)
Version: 0.6.0   Edit
Hardware: All All
: P5 minor (vote)
Target Milestone: ---   Edit
Assignee: Werner Keil CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, consistency, cross-project
Depends on:
Blocks:
 
Reported: 2011-02-27 10:02 EST by Werner Keil CLA
Modified: 2021-02-28 13:31 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Werner Keil CLA 2011-02-27 10:02:32 EST
Time units like SI.SECOND and all derived types of Unit<Time> should be related or a sub-class of ICU's
com.ibm.icu.util.TimeUnit. Similar to UOMo Business CurrencyUnit extending ICU Currency, also a subclass of com.ibm.icu.util.MeasureUnit.
Unfortunately unlike Currency TimeUnit contains a private constructor:
    private TimeUnit(String name) {
        this.name = name;
        values[valueCount++] = this; // store in values array
    }

Making this class effectively final without a final modifier. 

Adding further inconsistency within ICU4J and confusion for adopters, there is a second in this case final class com.ibm.icu.impl.duration.TimeUnit, which is NOT a subclass of MeasureUnit and defines almost identical elements like SECOND, MINUTE, HOUR,... 

This is therefore an ICU4J issue or bug which will if possible be raised there, too.
Comment 1 Werner Keil CLA 2013-05-10 14:20:35 EDT
Spoke too Van Riper at Google about the problem some while ago. He promised to talk to Google colleagues who contributed to the ICU code in question, but so far there has been no progress at ICU4J.