I have the same class on 2 dependencies on my project. The libraries unit-api-1.0 (which is a dependency of org.geotools) and jscience-4.3.1 both have the class javax.measure.quantity.Length
.
[INFO] +- org.geotools:gt-shapefile:jar:22.3:compile
[INFO] | +- org.geotools:gt-main:jar:22.3:compile
[INFO] | | +- org.geotools:gt-referencing:jar:22.3:compile
[INFO] | | | +- org.ejml:ejml-ddense:jar:0.34:compile
[INFO] | | | | \- org.ejml:ejml-core:jar:0.34:compile
[INFO] | | | +- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] | | | +- org.geotools:gt-metadata:jar:22.3:compile
[INFO] | | | | \- org.geotools:gt-opengis:jar:22.3:compile
[INFO] | | | | \- systems.uom:systems-common-java8:jar:0.7.2:compile
[INFO] | | | | +- tec.uom:uom-se:jar:1.0.8:compile
[INFO] | | | | | +- javax.measure:unit-api:jar:1.0:compile
[INFO] \- org.jscience:jscience:jar:4.3.1:compile
[INFO] \- org.javolution:javolution:jar:5.2.3:compile
When I try to use Length to parameterize Measure, I get the error:
[ERROR] error: type argument Length is not within bounds of type-variable Q
[ERROR] where Q is a type-variable:
[ERROR] Q extends Quantity declared in class Measure
Basically both interfaces Length extend the interface Quantity, as seen here:
https://www.javadoc.io/static/javax.measure/unit-api/1.0/javax/measure/quantity/Length.html http://jscience.org/api/javax/measure/quantity/Length.html
But one of them extends Quantity, while the other extends Quantity. Somehow, they are not compatible with each other and the compiler is using the wrong one and giving me this error.
It there a way to somehow manage this situation?