Closed jandam closed 5 years ago
JTS currently is at Java 8: https://github.com/locationtech/jts/blob/a8b86cbaafcc4ccd6701116339caf0ad9c13af9c/pom.xml#L42-L44
Yes JTS is at Java 8. But it is used on newer versions by other projects. Using Integer::compare (since java 1.7) and Integer:parseInt (is even older) avoids creating new instances of Integer. Same for other types Double::compare, Double.parseDouble, ...
Using new Integer(
Good point, and seems like a worthwhile fix. PR welcome, or I will fix when I can.
Numeric constructors are deprecated since Java 9. They should be replaced with autoboxing or by appropriate parse method.
For example following line https://github.com/locationtech/jts/blob/a8b86cbaafcc4ccd6701116339caf0ad9c13af9c/modules/core/src/main/java/org/locationtech/jts/geom/PrecisionModel.java#L449 should be replaced with:
return Integer.compare(sigDigits, otherSigDigits));
Same for other types Float/Double/Long...