-
Notifications
You must be signed in to change notification settings - Fork 18
Exception logged at startup with KILOMETRES_PER_HOUR #139
Comments
Thanks for your appreciation and raising that. There was a parallel pase with the plural deprecated. As there are other systems and standards like Unicode CLDR / ICU4J using the singular in such case, we wanted to be match those rather than the totally inconsistent mess the JDK got. |
Finished with 1.0.4-SNAPSHOT. I hope you may be able to use that version already, otherwise 1.0.4 Milestone should be out soon. Thanks for bringing it to our attention. |
Thank you very much ! that was a lightspeed fix :) |
First, thank you for this awesome library and congratulations for having JSR 363 approved by the JCP .
When accessing for the first time to the default UnitFormat this way :
ServiceProvider.current().getUnitFormatService().getUnitFormat()
This exception gets logged :
Feb 09, 2017 7:29:57 PM tec.uom.se.format.SymbolMap <init> SEVERE: Error java.lang.NoSuchFieldException: KILOMETRES_PER_HOUR at java.lang.Class.getField(Class.java:1703) at tec.uom.se.format.SymbolMap.<init>(SymbolMap.java:113) at tec.uom.se.format.SymbolMap.of(SymbolMap.java:139) at tec.uom.se.format.EBNFUnitFormat.<init>(EBNFUnitFormat.java:214) at tec.uom.se.format.EBNFUnitFormat.<clinit>(EBNFUnitFormat.java:169) at tec.uom.se.internal.format.DefaultUnitFormatService.<init>(DefaultUnitFormatService.java:62) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at tec.uom.se.spi.DefaultServiceProvider.loadServices(DefaultServiceProvider.java:139) at tec.uom.se.spi.DefaultServiceProvider.getServices(DefaultServiceProvider.java:96) at tec.uom.se.spi.DefaultServiceProvider.getService(DefaultServiceProvider.java:100) at tec.uom.se.spi.DefaultServiceProvider.getUnitFormatService(DefaultServiceProvider.java:166)
It seems related to the fact that in
uom-se-1.0.3.jar!/tec/uom/se/internal/format/messages.properties
reference totec.uom.se.unit.Units.KILOMETRES_PER_HOUR=km/h
tries to match withUnits.class:
static final Unit KILOMETRES_PER_HOUR = KILOMETRE_PER_HOUR;
this way defined as an alias for Units.KILOMETRE_PER_HOUR
It doesn't seem to cause problems in daily usage but it may be worth to point this issue.
We are using this maven dependency, which brings the unit-api 1.0 as a transitive dependency :
<dependency> <groupId>tec.uom</groupId> <artifactId>uom-se</artifactId> <version>1.0.3</version> </dependency>
Thank you
The text was updated successfully, but these errors were encountered: