Bug 338338

Summary: Time Units should be related to ICU TimeUnit
Product: [Technology] UOMo Reporter: Werner Keil <werner.keil>
Component: UnitsAssignee: Werner Keil <werner.keil>
Status: RESOLVED WONTFIX QA Contact:
Severity: minor    
Priority: P5 Keywords: api, consistency, cross-project
Version: 0.6.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.