[
https://issues.apache.org/jira/browse/RATIS-2769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze resolved RATIS-2769.
-------------------------------
Fix Version/s: 3.4.0
Assignee: Shilun Fan
Resolution: Fixed
The pull request is now merged. Thanks, [~slfan1989]!
> Improve null handling and tests flagged by SonarCloud
> -----------------------------------------------------
>
> Key: RATIS-2769
> URL: https://issues.apache.org/jira/browse/RATIS-2769
> Project: Ratis
> Issue Type: Bug
> Components: server, test
> Reporter: Shilun Fan
> Assignee: Shilun Fan
> Priority: Minor
> Fix For: 3.4.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> SonarCloud reports four reliability warnings in the current new-code window,
> causing the reliability quality gate to fail.
> Analysis:
> https://github.com/apache/ratis/runs/119373650680
> Issues
> 1. MessageStreamImpl.streamAsync dereferences the result of
> Message.toByteString without checking for null. A null message or
> null content causes an implicit NullPointerException.
> 2. The arithmetic Get command dereferences reply content without checking
> whether the reply succeeded or contains a value.
> Missing content causes a NullPointerException instead of a meaningful error.
> 3. TestClientProtoUtils directly compares a Message with a String in an
> assertion, triggering the dissimilar-types comparison rule.
> 4. TestRaftServerMetadataPersistence places multiple operations that can
> throw IOException inside one assertThrows lambda, making the
> expected exception source unclear to static analysis.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)