Skip to content

[BUG] polaris-core has hard compile-time dependencies on JDK 21 #76

Closed
@adutra

Description

@adutra

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() and List.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?

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions