Skip to content
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

Fix compilation error with maven.compiler.release=21 #8520

Merged
merged 1 commit into from
Sep 24, 2023

Conversation

basil
Copy link
Member

@basil basil commented Sep 22, 2023

While compiling with -Dmaven.compiler.release=21 I got the following compilation failure:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project jenkins-core: Compilation failure
/home/basil/src/jenkinsci/jenkins/core/src/main/java/hudson/tasks/Publisher.java:[135,24] error: types Comparator<T> and List<E> are incompatible;
  class DescriptorExtensionListImpl inherits unrelated defaults for reversed() from types Comparator and List
  where T,E are type-variables:
    T extends Object declared in interface Comparator
    E extends Object declared in interface List

This is because of the addition of incompatible reversed() methods between these two interfaces. Thinking about this more closely, it makes little sense for anything to implement both List and Comparator so I split out the comparator into its own class to solve the conflict.

Testing done

mvn clean verify -DskipTests -Dmaven.compiler.release=21 -Dmaven.compiler.testRelease=21 failed before this PR and passed after it.

Proposed changelog entries

N/A

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

@basil basil added the skip-changelog Should not be shown in the changelog label Sep 22, 2023
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Sep 23, 2023
@MarkEWaite MarkEWaite merged commit 3f1c555 into jenkinsci:master Sep 24, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback skip-changelog Should not be shown in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants