Giter Club home page Giter Club logo

uom-se's People

Contributors

andi-huber avatar codacy-badger avatar daniel-dos avatar filipvanlaenen avatar geoffcapper avatar gitter-badger avatar jlleitschuh avatar keilw avatar lfoppiano avatar otaviojava avatar pr0methean avatar pvon avatar teobais avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uom-se's Issues

Remove redundant types like DoubleMeasurement

As Measurement no longer refers to numeric value or operations, these types are redundant and make no sense to the implementation:

  • DoubleMeasurement
  • FloatMeasurement
  • IntegerMeasurement

US Units deleted?

Commit a1cfb64 seems to have deleted tec.uom.se.unit.US.java. Was this intended? Doesn't look to be related to the commit message?

Consider a Measurement type for SE

Unlike OSGi Measurenent, we consider Quantity and Measurement as 2 separate entities.
Also see Martin Fowler's analysis: http://martinfowler.com/apsupp/apchap3.pdf
Measurement there contains Quantity rather than extending it.

So how about:
Measurement extends QuantitySupplier
with additional methods like getInstant() returning a java.time.Instant as "timestamp"

Verify that implementation works across all SE 8 Profiles

While the SE implementation aims at SE/EE, it should still work on SE Embedded in the first place, meaning all 3 Java SE 8 profiles (including the smallest) should work. Otherwise this implementation could be subject to "profiling" and I'm not sure, if we want to add this complexity here;-)

Should run on a CI server with each profile or at least the minimal to ensure it works.

Consolidate message bundle files

The 2 sets of message bundle properties in ../format and ../internal/format serve 2 different UnitFormat implementations. At least the locale-agnostic EBNFUnitFormat should not require more than one properties file. Translations where they don't exist there already should be moved to the one serving LocalUnitFormat. And strings for the default locale should be in sync between the two of them.

Problem with BigDecimal based conversion in SE impl

While this works fine against the RI the following statement (see tec.uom.demo.se.lambda.FunctionalDemo, last lines)
Quantity len = AbstractQuantity.of(10, SI.METRE);
Quantity len2 = len.to(US.FOOT);
System.out.println(len2);
won't work due to
Exception in thread "main" java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
at java.math.BigDecimal.divide(BigDecimal.java:1690)
at java.math.BigDecimal.divide(BigDecimal.java:1723)
at tec.uom.se.function.RationalConverter.convert(RationalConverter.java:117)
at tec.uom.se.IntegerQuantity.decimalValue(IntegerQuantity.java:56)
at tec.uom.se.AbstractQuantity.to(AbstractQuantity.java:162)
at tec.uom.demo.se.lambda.FunctionalDemo.main(FunctionalDemo.java:27)

Seems MathContext is wrongly applied here. Could be someting that changed with recent Java 8 builds, at least in Eclipse UOMo I haven't seen this and comparable classes also use BigDecimal there unlike the RI.

Explore enhanced typing for mixed operations

Aside from using JSR 308 there could be other means to enhance typing of mixed operations (divide/multiply) in Java SE.

Either passing an explicit type, which of course one must maintain for all possible operations, or via Lambdas, let's have a look at it here. Given the memory overhead of defining extra types for every possible operation, it is unlikely this makes sense for ME.

Should there be an outcome that is not a burden to ME, we could look into factoring some parts there later.

Fix LocalUnitFormat.formatInternal()

Some formatting showed errors, especially around KILO(GRAM) vs. KILOGRAM.
The version with prefix ended up with weird results like Gg instead of kg.

Based on earlier implementations this should be addressed and checked by JUnit tests.

Integration with Date and Measuarement of Time that already exist in Java.

Motivation:

One of Quantities that are used in Measure API is Time and is important that API works with the way that has in Java SE 8 or above. The proposal of this enhancement

Goal:

  • Work with java.util.Date
  • Work with new Java Date API (JSR 310)

Not Goal:

  • With java.util.concurrent.TimeUnit or
  • JavaFX Duration

Qualified:

  • tec.uom.se.quantity, possibly
  • tec.uom.se.unit or tec.uom.se.util

SE problem with LongQuantity

A new LongQuantity type derived from RI has some problems again with Java 8. Likely similar to what we saw with other types.

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project uom-se: Compilation failure: Compilation failure:
[ERROR] /C:/Users/Werner/git/unit-impl-se/src/main/java/tec/uom/se/LongQuantity.java:[75,26] incompatible types: inference variable Q has incompatible bounds
[ERROR] equality constraints: T
[ERROR] upper bounds: javax.measure.Quantity<capture#1 of ?>,javax.measure.Quantity
[ERROR] /C:/Users/Werner/git/unit-impl-se/src/main/java/tec/uom/se/LongQuantity.java:[85,26] incompatible types: inference variable Q has incompatible bounds
[ERROR] equality constraints: capture#2 of ?
[ERROR] upper bounds: javax.measure.Quantity<capture#3 of ?>,javax.measure.Quantity

Could we use BeanValidation to help or replace QuantityRange, etc.?

Since Range or QuantityRange moved to implementations like this, an interesting approach by AirLift and its rudimentary unit-subsystem (only Duration and an equivalent to Information, see https://github.com/airlift/airlift/tree/master/units/src/main/java/io/airlift/units) is how they use BeanValidation together with their units.

If not a package within uom-se, due to the external dependency it may best qualify for a sub-module.

Use SimpleUnitFormat as default

Similiar to the RI SimpleUnitFormat should be the (locale-neutral) default in most cases.
Only where a locale-sensitive UnitFormat is required for a particular format it may be explicitly used.

Explore JSR 308 for possible use with the SE 8 impl

Otavio, please have a look at:
http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html#units-checks

You'll see, the JSR 308 Unit Checkers are "embryonal" stage at most compared to the full SI or UCUM support provided by JSR 363 and related APIs, but for that last bit of "MixedUnits" operations you may want to give it a try. Nobody even at Oracle (who was Co Spec Lead of this JSR) currently feels there is a real world use case for JSR 308 or uses it at the moment. So it can be considered "academic" or "experimental" at most. Feel free to try it out e.g. in a branch or fork of this project and see, if it even works beyond primitive types. No examples exist other than for int or double so far ;-/

Invalid class QuantityFunctions

There's a bug in the SE port causing its build to fail.

[ERROR] Bundle tec.uom:uom-se:bundle:0.6-SNAPSHOT : Exception: 18
[ERROR] Bundle tec.uom:uom-se:bundle:0.6-SNAPSHOT : Invalid class file: tec/uom/se/function/QuantityFunctions.class

So far removed (disabled) the class and everything that depends on it. Please have a look,
We can't afford not to support OSGi especially on the SE side.

Find workaround for SE 8 type inference problems or stick to SE 7

Regardless of the JDK 8 version (Update 20) the SE Implementation won't build with SE 8 due to compiler bugs like https://bugs.openjdk.java.net/browse/JDK-8035390

At least 100 issues remain, if they can't be fixed, given the target release in bugs like above is Java 9, we'd have to stick with Java 7 until this is resolved

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[242,15] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types;
required: U
found: javax.measure.Unit<javax.measure.quantity.MagneticPermeability>
reason: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.MagneticPermeability
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[256,51] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types;
required: U
found: javax.measure.Unit<javax.measure.quantity.Length>
reason: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Length
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[258,50] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types;
required: U
found: javax.measure.Unit<javax.measure.quantity.Force>
reason: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Force
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[266,50] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types;
required: U
found: javax.measure.Unit<javax.measure.quantity.Acceleration>
reason: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Acceleration
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[268,59] no suitable method found for multiply(javax.measure.Unit<javax.measure.quantity.Length>)
method org.unitsofmeasurement.impl.AbstractUnit.multiply(double) is not applicable
(argument mismatch; no instance(s) of type variable(s) Q exist so that javax.measure.Unit conforms to double)
method org.unitsofmeasurement.impl.AbstractUnit.multiply(javax.measure.Unit) is not applicable (argument mismatch; inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Length upper bounds: javax.measure.Quantity,javax.measure.Quantity) method org.unitsofmeasurement.impl.AbstractUnit.multiply(org.unitsofmeasurement.impl.AbstractUnit) is not applicable
(argument mismatch; no instance(s) of type variable(s) Q exist so that javax.measure.Unit conforms to org.unitsofmeasurement.impl.AbstractUnit) [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[270,44] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Energy upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[272,56] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.DynamicViscosity upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[276,59] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.KinematicViscosity upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[282,63] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.MagneticFieldStrength upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[284,60] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.MagnetomotiveForce upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[286,49] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Luminance upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[288,51] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Luminance upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[296,59] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.RadiationDoseAbsorbed upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[298,60] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.RadiationDoseEffective upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[315,58] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Speed upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[317,64] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[319,64] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[321,64] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[323,65] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Volume upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[325,65] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Volume upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[327,65] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Volume upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[335,65] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[364,53] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[366,59] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[368,60] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[370,56] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[399,52] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Speed upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[401,51] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[484,51] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Force upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[546,53] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Energy upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[562,50] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Power upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[573,46] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Volume upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[577,43] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Area upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[579,63] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Pressure upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[581,57] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.ElectricConductance upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[583,65] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Pressure upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[585,46] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.Angle upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/UCUM.java:[587,51] method addUnit in class org.unitsofmeasurement.impl.util.UCUM cannot be applied to given types; required: U found: javax.measure.Unit reason: inference variable Q has incompatible bounds equality constraints: javax.measure.quantity.SolidAngle upper bounds: javax.measure.Quantity,javax.measure.Quantity [ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/DoubleQuantity.java:[59,26] incompatible types: inference variable Q has incompatible bounds equality constraints: capture#1 of ? upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/DoubleQuantity.java:[64,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#3 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/DoubleQuantity.java:[69,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#4 of ?
upper bounds: javax.measure.Quantity<capture#5 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/DoubleQuantity.java:[74,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#6 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/DecimalQuantity.java:[56,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#7 of ?
upper bounds: javax.measure.Quantity<capture#8 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/DecimalQuantity.java:[62,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#9 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/DecimalQuantity.java:[67,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#10 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/DecimalQuantity.java:[72,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#11 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/quantity/BaseQuantity.java:[218,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#12 of ?
upper bounds: javax.measure.Quantity<capture#13 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/quantity/BaseQuantity.java:[231,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#14 of ?
upper bounds: javax.measure.Quantity<capture#15 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/quantity/BaseQuantity.java:[239,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: Q
upper bounds: javax.measure.Quantity<capture#16 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/quantity/BaseQuantity.java:[242,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: Q
upper bounds: javax.measure.Quantity<capture#16 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[426,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#17 of ?
upper bounds: javax.measure.Quantity<capture#18 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[432,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#19 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[438,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#20 of ?
upper bounds: javax.measure.Quantity<capture#21 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[454,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#22 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[530,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#23 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[536,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#24 of ?
upper bounds: javax.measure.Quantity<capture#25 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[552,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#26 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[618,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#27 of ?
upper bounds: javax.measure.Quantity<capture#28 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[623,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#29 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[628,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#30 of ?
upper bounds: javax.measure.Quantity<capture#31 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[633,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#32 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[703,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#33 of ?
upper bounds: javax.measure.Quantity<capture#34 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[709,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#35 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[714,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#36 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/AbstractMeasurement.java:[719,34] incompatible types: inference variable Q has incompatible bounds
equality constraints: T
upper bounds: javax.measure.Quantity<capture#37 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/IntegerQuantity.java:[78,26] incompatible types: inference variable Q has incompatible bounds
equality constraints: capture#38 of ?
upper bounds: javax.measure.Quantity<capture#39 of ?>,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[66,18] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Dimensionless,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[81,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.ElectricCurrent,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[93,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.LuminousIntensity,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[102,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Temperature,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[112,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Mass,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[120,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Length,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[128,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.AmountOfSubstance,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[137,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Time,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[148,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.MagnetomotiveForce,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[164,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Angle,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[173,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.SolidAngle,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[179,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Information,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[188,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Frequency,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[197,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Force,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[206,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Pressure,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[216,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Energy,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[225,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Power,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[235,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.ElectricCharge,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[247,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.ElectricPotential,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[258,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.ElectricCapacitance,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[268,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.ElectricResistance,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[277,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.ElectricConductance,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[288,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.MagneticFlux,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[298,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.MagneticFluxDensity,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[309,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.ElectricInductance,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[329,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.LuminousFlux,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[337,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Illuminance,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[347,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Radioactivity,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[358,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.RadiationDoseAbsorbed,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[369,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.RadiationDoseEffective,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[376,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.CatalyticActivity,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[387,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Speed,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[394,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Acceleration,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[ERROR] /User/git/unit-impl-se/src/main/java/org/unitsofmeasurement/impl/util/SI.java:[401,22] incompatible types: inference variable Q has incompatible bounds
equality constraints: javax.measure.quantity.Area,Q
upper bounds: javax.measure.Quantity,javax.measure.Quantity
[INFO] 100 errors

Possible null checks in AbstractConverter

Methods like the one fixed for #66 do not usually check for null.
The API does not specify whether
Number convert(Number value);
accepts null or not. Either we simply return null in such cases or throw an exception (must be in line with RI, too)

Maven site won't work with JDK 1.8

The project currently can't run Maven site:
Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.3:site (default-site) on project unit-ri: Error during page generation: Error rendering Maven report: Unsupported targetJdk value '1.8'. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Others seem to have the same problem, see:
As seen http://mail-archives.apache.org/mod_mbox/maven-users/201405.mbox/%3C1940793.5JMWdG8Apb@herve-desktop%3E

OldQuantityFactory

Proxy classes

We had a discussion about the classes that need to do proxy and about the consequence of these classes on lesser performance.

But still there are two classes:

  • ProxyQuantityFactory
  • OldProxyQuantityFactory

Is there any reason to these classes stay on uom-se ?

Quantities are not serializable

Quantities are currently not serializable (e.g. tec.uom.se.quantity.NumberQuantity; no valid constructor).
Assuming that either AbstractQuantity is missing a no-args constructor or interface Serializable.

Code to test:
public static void main(String[] args) throws IOException, ClassNotFoundException {
byte[] serialized = serialize(Quantities.getQuantity(0, Units.JOULE));
Object obj = deserialize(serialized);
ComparableQuantity quantity = (ComparableQuantity)obj;
}
public static Object deserialize(byte[] serialized) throws IOException, ClassNotFoundException {
ByteArrayInputStream bis = new ByteArrayInputStream(serialized);
ObjectInputStream ois = new ObjectInputStream(bis);
Object obj = ois.readObject();
ois.close();
return obj;
}
public static byte[] serialize(ComparableQuantity<?> quantity) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(quantity);
bos.close();
return bos.toByteArray();
}

ComparableQuantity.multiply(Quantity, Class) does not work as expected

The convenience method multiply(Quantity, Class) in ComparableQuantity does not work as expected.

This operation in NumberComparableQuantityTest.multiplyOperationsExceptionTest:
ComparableQuantity speed = metre.multiply(metre, Speed.class);
fails because the (WRONG!) operation won't throw a ClassCastException.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.