Skip to content

Test with Java 21 and modernization #27

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

gounthar
Copy link

@gounthar gounthar commented Oct 4, 2023

Test with Java 21

Java 21 was released Sep 19, 2023. We want to announce full support for Java 21 in early October and would like the most used plugins to be compiled and tested with Java 21.

The acceptance test harness and plugin bill of materials tests are already passing with Java 21. This is a further step to improve plugin readiness for use with Java 21 and for development with Java 21.

The change intentionally tests only two Java configurations, Java 17 and Java 21 because we believe that the risk of a regression that only affects Java 11 is shallow. We generate Java 11 byte code with the Java 17 and the Java 21 builds, so we're already testing Java 11 byte code.

Testing done

Confirmed tests pass with Java 21 after upgrading to a recent parent POM and to Jenkins version 2.387.3 as the minimum version.

[ERROR] High: Found reliance on default encoding in io.jenkins.plugins.pipeline.restful.api.HttpFlowDefinition.create(FlowExecutionOwner, TaskListener, List): java.io.ByteArrayOutputStream.toString() [io.jenkins.plugins.pipeline.restful.api.HttpFlowDefinition] At HttpFlowDefinition.java:[line 35] DM_DEFAULT_ENCODING
[ERROR] High: Found reliance on default encoding in io.jenkins.plugins.pipeline.restful.api.InstanceAPI.doGenerateToken(StaplerResponse, String): java.io.ByteArrayOutputStream.toString() [io.jenkins.plugins.pipeline.restful.api.InstanceAPI] At InstanceAPI.java:[line 161] DM_DEFAULT_ENCODING
[ERROR] High: Found reliance on default encoding in io.jenkins.plugins.pipeline.restful.api.InstanceAPI.doGenerateToken(StaplerResponse, String): String.getBytes() [io.jenkins.plugins.pipeline.restful.api.InstanceAPI] At InstanceAPI.java:[line 167] DM_DEFAULT_ENCODING
[ERROR] Medium: Redundant nullcheck of config, which is known to be non-null in io.jenkins.plugins.pipeline.restful.api.InstanceAPI.doSetLocation(String, String) [io.jenkins.plugins.pipeline.restful.api.InstanceAPI] Redundant null check at InstanceAPI.java:[line 182] RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
[ERROR] Medium: Should io.jenkins.plugins.pipeline.restful.api.PipelineRestfulAPI$IdentifyCause be a _static_ inner class? [io.jenkins.plugins.pipeline.restful.api.PipelineRestfulAPI$IdentifyCause] At PipelineRestfulAPI.java:[lines 305-328] SIC_INNER_SHOULD_BE_STATIC
[ERROR] Medium: Should io.jenkins.plugins.pipeline.restful.api.PipelineRestfulAPI$IdentityBuild be a _static_ inner class? [io.jenkins.plugins.pipeline.restful.api.PipelineRestfulAPI$IdentityBuild] At PipelineRestfulAPI.java:[lines 200-220] SIC_INNER_SHOULD_BE_STATIC
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