On Wed, 9 Jun 2021 at 17:56, sebb <seb...@gmail.com> wrote: > On Wed, 9 Jun 2021 at 17:26, Alex Herbert <alex.d.herb...@gmail.com> > wrote: > > > > On Wed, 9 Jun 2021 at 17:03, John Patrick <nhoj.patr...@gmail.com> > wrote: > > > > > Have you tried "9" instead of "1.9"? > > > > > > > I've corrected that in the pom, thanks. > > > > I think the issue is that Gilles used JDK 8 to try and build it. You can > > run using the project's main artifacts using JDK 8, but the build now > > requires JDK 9 for the tests and JMH performance tests. > > That seems wrong. If the code targets Java 8, it must be possible to > test it using Java 8. > > It's possibly OK to require JDK 9 for performance tests. >
The test is using JDK 9 for the BigDecimal sqrt method. This is used to compute the exact answer for a Euclidean norm on random input. Since the input is random the answers cannot be hard-coded into the test. So this test is not possible on JDK 8. The alternative is if the exact computation is done using BigDecimal, converted to double, and then a sqrt computed. We could change to that instead if there are strong objections here against java 9. The issue with requiring a higher JDK than the target is similar to using JDK 8 so that JUnit 5 can be used for the test suite to test code that targets a level lower than 1.8. Alex