-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AbstractUnit.asType() will accept any si-units as valid class input #435
Comments
I changed this to feature, because
And in this case the types from other unit systems are just unknown. It also has a TODO for new or custom types. Unfortunately it is not possible to go over all the registered unit systems via their service providers because |
Problem:
We are using the framework within our project and do some tweaks to ensure that the dimension is always specific and correctly set (so we don't need to use wildcards in our quantites).
When we want to create a unit from a String, we use the AbstractUnit method call "asType" to ensure that the unit can be parsed into the correct dimension.
This works well for Units from the
javax.measure:unit-api
(2.2) but not for thesi.uom:si-quantity
(2.2).Reason:
The current implementation looks like this:
and UnitDimension.of(type) returns always null for the SI-Units
How to reproduce:
The text was updated successfully, but these errors were encountered: