Fix "reference to Record is ambiguous" build error on JDK 16 and above #502
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The commit in this pull request fixes compiler errors like the following one when this project is being built using JDK 16 or above:
More details are explained in the commit message.
Although this project's
pom.xml
still declares Java 1.6 as the compilation source/target, which means that it cannot be built using JDK 12+ yet, this change would still make this project more future-proof under all circumstances. It eliminates one issue you folks would encounter when you decide to support JDK 17 for the latest LTS release of Java. Even if you wish to stay on older Java versions for an extended period, this commit is backward-compatible with older JDK versions and does not introduce any regression both theoretically and practically according to my testing.For what it is worth, the aforementioned compiler errors were discovered when we packaged this project for a GNU/Linux distribution (Leo3418/junit-5-ebuild-repo#4). We, as distribution maintainers, often use a more up-to-date version of JDK to build packages for various Java projects:
Therefore, we, as maintainers of those distributions, would appreciate your attention to support for the newer JDK versions.