[Java] Sonar advises to remove a necessary cast thus leads to a compiling error

Hello @NVXARM

First, thank you for taking the time to provide such a detailed description of the issue, it is really appreciated. It seems indeed like a false-positive.

Then, the good news is that we simplified greatly the implementation of this rule (see SONARJAVA-3794), and this issue is no longer reported.

The fix is available in version 7.0 of the Java analyzer.

Best,
Quentin

1 Like