-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aio-lib-java
build: enforce Java 8
language rules
#204
Comments
9 tasks
pulguptaAdobe
added a commit
to pulguptaAdobe/aio-lib-java
that referenced
this issue
Jan 15, 2024
aio-lib-java
build: enforce SDK java-8 language rules
aio-lib-java
build: enforce SDK java-8 language rulesaio-lib-java
build: enforce SDK java 8
language rules
aio-lib-java
build: enforce SDK java 8
language rulesaio-lib-java
build: enforce Java 8
language rules
francoisledroff
added a commit
that referenced
this issue
Jan 16, 2024
to avoid a blocking bug https://issues.apache.org/jira/browse/MCOMPILER-567
9 tasks
francoisledroff
added a commit
that referenced
this issue
Jan 16, 2024
… 8 and avoid accidental Java 11 api use (#206) Co-authored-by: Pulkit Gupta <92841386+pulguptaAdobe@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behaviour
SDK should not use any Java
11
API to maintain compatibility with Java8
(why Java8
? see GH-104)The sdk (its generated classes as well its the public API) should be compiled following the rules of the programming language of the specified
8
release.The build should detect and generate an error when using APIs that don't exist in previous releases of Java SE.
Actual Behaviour
Earlier we were using JDK 8 to build sdk but with recent changes and introduction of mockito-core-5.4.0.jar, SDK build is now not compatible with JDK 8.
Simply downgrading the mockito-core version will not solve the issue as many tests are dependent on the same.
For this we are now using JDK 11 but this can result in usage of Java 11 API in code which can go unnoticed as the code will compile correctly but will fail at runtime while using the SDK with Java 8.
Reproduce Scenario (including but not limited to)
Add line
List<String> myList = List.of("some", "new", "java", "code");
Do
mvn clean package
Compilation will work correctly
Ideally compilation should fail as we are using Java 11 API List.of which will not work on Java 8
Platform and Version
Java 8
Sample Code that illustrates the problem
List<String> myList = List.of("some", "new", "java", "code");
Logs taken while reproducing problem
The text was updated successfully, but these errors were encountered: