Skip to content

[Fix] Enforce Java 1.8 API #46

Open
folmate wants to merge 1 commit intoOpenModelica:mainfrom
PELAB-LiU:pr2
Open

[Fix] Enforce Java 1.8 API #46
folmate wants to merge 1 commit intoOpenModelica:mainfrom
PELAB-LiU:pr2

Conversation

@folmate
Copy link
Copy Markdown

@folmate folmate commented Apr 9, 2026

Current version only enforces that the source code syntax and target byte code is compliant with Java 8, but it does not enforce that the used APIs are also compatible.

Example

Optional<String> foo = Optional.of(null);
foo.isEmpty(); // Introduced in Java 11

This code compiles, but results in a runtime failure if the Java JRE is <11.

The patch prevents the compilation of code, where newer API is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant