Description
Describe the bug
While Polaris build requires Java 21+, the polaris-core module is built with source and target level = 11.
I suppose that this has been decided in order to make it possible to include polaris-core in applications running with Java 11.
However, the code in main sources makes frequent usage of JDK methods that were introduced after Java 11, such as:
Stream.toList()
(Java 16)List.getFirst()
andList.getLast()
(Java 21)
This makes the compiled artifact effectively unusable, if included in an application running with Java 11.
Is this a possible security vulnerability?
- yes -- if yes, stop here and contact security@polaris.io instead
- no
Expected behavior
The polaris-core module should not make use of any JDK API that was introduced after Java 11. Ideally, there should be a build task verifying this.
Alternatively, we should consider lifting the restriction of level 11 in polaris-core.