You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "fuyou001 (via GitHub)" <gi...@apache.org> on 2026/08/06 02:22:39 UTC

[PR] [ISSUE #10817] Upgrade SpotBugs for JDK 21 compatibility [rocketmq]

fuyou001 opened a new pull request, #10818:
URL: https://github.com/apache/rocketmq/pull/10818

   ### Which Issue(s) This PR Fixes
   
   - Fixes #10817
   
   ### Brief Description
   
   Upgrade `spotbugs-maven-plugin` from 4.2.2 to 4.8.6.8 so that SpotBugs can run on JDK 21 while retaining JDK 8 compatibility.
   
   The old plugin fails on JDK 21 because it invokes the deprecated Security Manager API and bundles an ASM version that cannot analyze Java 21 class files. This change also removes the obsolete `spotbugsXmlOutput` parameter, which is not supported by 4.8.6.8.
   
   The newer SpotBugs version detects several High-priority `DMI_RANDOM_USED_ONLY_ONCE` findings. Replace those one-shot `Random` instances with `ThreadLocalRandom`, or reuse the existing shared `Random` in `RandomUtil`, while preserving the original value ranges and behavior.
   
   ### How Did You Test This Change?
   
   - JDK 21: `mvn -B -ntp -Dstyle.color=never -DskipTests compile`
   - JDK 8: `mvn -B -ntp -Dstyle.color=never -DskipTests clean compile`
   
   Both full 19-module reactor builds completed successfully with Checkstyle and SpotBugs reporting no violations.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #10817] Upgrade SpotBugs for JDK 21 compatibility [rocketmq]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #10818:
URL: https://github.com/apache/rocketmq/pull/10818#issuecomment-5199839462

   ## [Codecov](https://app.codecov.io/gh/apache/rocketmq/pull/10818?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `75.00000%` with `1 line` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 48.24%. Comparing base ([`2daf0e2`](https://app.codecov.io/gh/apache/rocketmq/commit/2daf0e2ca91a1592d18235d43e5d709d1c35d15f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`29197c4`](https://app.codecov.io/gh/apache/rocketmq/commit/29197c4561307f9e30d8d7894e15e812d6cd1793?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/rocketmq/pull/10818?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [.../org/apache/rocketmq/store/kv/CompactionStore.java](https://app.codecov.io/gh/apache/rocketmq/pull/10818?src=pr&el=tree&filepath=store%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Frocketmq%2Fstore%2Fkv%2FCompactionStore.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL2t2L0NvbXBhY3Rpb25TdG9yZS5qYXZh) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/rocketmq/pull/10818?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop   #10818      +/-   ##
   =============================================
   - Coverage      48.32%   48.24%   -0.09%     
   + Complexity     13516    13497      -19     
   =============================================
     Files           1380     1380              
     Lines         101138   101135       -3     
     Branches       13120    13120              
   =============================================
   - Hits           48876    48792      -84     
   - Misses         46298    46359      +61     
   - Partials        5964     5984      +20     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/rocketmq/pull/10818?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ISSUE #10817] Upgrade SpotBugs for JDK 21 compatibility [rocketmq]

Posted by "fuyou001 (via GitHub)" <gi...@apache.org>.
fuyou001 merged PR #10818:
URL: https://github.com/apache/rocketmq/pull/10818


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org