Skip to content

Conversation

@adoroszlai
Copy link
Contributor

@adoroszlai adoroszlai commented Jan 31, 2024

What changes were proposed in this pull request?

Background: Spotbugs 4 finds more problems than Spotbugs 3, which we currently use. Upgrade to Spotbugs 4 is required for migration to Java 11+. This PR fixes a warning which is new to Spotbugs 4.

Refactor TestBlockOutputStreamCorrectness to avoid the need for new Random.

Also parameterize the test, to exercise both single-byte and array write path.

https://issues.apache.org/jira/browse/HDDS-10173

How was this patch tested?

Tested with Spotbugs 4:

$ ./hadoop-ozone/dev-support/checks/findbugs.sh -Dspotbugs.version=4.8.3.0 -am -pl :hdds-client
...
$ grep -c TestBlockOutputStreamCorrectness target/findbugs/summary.txt
0

CI:
https://github.com/adoroszlai/ozone/actions/runs/7716000984/job/21032183070#step:5:999

@adoroszlai adoroszlai self-assigned this Jan 31, 2024
@adoroszlai adoroszlai changed the title HDDS-10173. Random object created and used only once in TestBlockOutputStreamCorrectness HDDS-10173. findbugs: Random object used only once in TestBlockOutputStreamCorrectness Feb 1, 2024
Copy link
Contributor

@nandakumar131 nandakumar131 left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

@nandakumar131 nandakumar131 merged commit 49df646 into apache:master Feb 1, 2024
@nandakumar131
Copy link
Contributor

Thanks @adoroszlai for the fix.

@adoroszlai adoroszlai deleted the HDDS-10173 branch February 1, 2024 15:30
@adoroszlai
Copy link
Contributor Author

Thanks @nandakumar131 for reviewing and merging this.

smengcl pushed a commit to smengcl/hadoop-ozone that referenced this pull request Feb 7, 2024
smengcl added a commit to smengcl/hadoop-ozone that referenced this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants