-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-19725. [JDK17] Upgrade SpotBugs Version to Support JDK 17 Compilation. #8028
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,8 +119,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x | |
| <maven-checkstyle-plugin.version>3.1.0</maven-checkstyle-plugin.version> | ||
| <checkstyle.version>8.29</checkstyle.version> | ||
| <dependency-check-maven.version>7.1.1</dependency-check-maven.version> | ||
| <spotbugs.version>4.2.2</spotbugs.version> | ||
| <spotbugs-maven-plugin.version>4.2.0</spotbugs-maven-plugin.version> | ||
| <spotbugs.version>4.8.3</spotbugs.version> | ||
| <spotbugs-maven-plugin.version>4.7.3.6</spotbugs-maven-plugin.version> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, why not 4.9.7.0 (or 4.8.6.7)? |
||
| <jsonschema2pojo-maven-plugin.version>1.1.1</jsonschema2pojo-maven-plugin.version> | ||
| <maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version> | ||
| <cyclonedx.version>2.9.1</cyclonedx.version> | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not 4.9.7 (or 4.8.6)?
https://mvnrepository.com/artifact/com.github.spotbugs/spotbugs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for reviewing! You made a very good point — I’ll update this PR accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spotbugs 4.9 onwards requires JDK 11+, are we ready to drop Java 8 support on trunk?
currently, trunk GitHub Actions site jobs fail due to this upgrade.
@szetszwo @slfan1989
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slfan1989 , we probably should move back to 4.8.x?@pan3793 , Actually, SpotBugs is build tool but not a runtime library. One option is to run SpotBugs code analysis using jdk11 or above. The runtime still can be built with and run with JDK8. Would it work?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you all for the discussion! I believe what @szetszwo mentioned makes sense.
Let me explain the situation:
We have upgraded the JDK version in the
trunktoJDK 17andJDK 21. Regarding the issue ofmvn sitefailing to compile, this is a known issue and is unrelated to theSpotBugsplugin.Here’s a detailed explanation of the two issues:
SpotBugs 4.2.0, as indicated byYetus, does not support scanning for JDK 17 and above. Therefore, we upgraded to a higher version, choosingSpotBugs 4.9.7.From my perspective, upgrading toSpotBugs 4.9.7is reasonable. Although new warning messages have appeared, I do not plan to roll back the version. Issue after upgrading toSpotBugs 4.9.7: Due to the introduction of new rules, new warning messages appeared during compilation. We have formulated a solution:hadoop-common-project/hadoop-annotations/src/main/java17/org/apache/hadoop/classification/tools/*and added support for JDIFF under JDK 17.Currently, these two PRs are being followed up by HuaLong. In offline communication, HuaLong mentioned that he is currently on leave, so it may take some more time to complete.
I hope this makes the situation clearer!