I’m seeing a false positive violation for generic casting in SonarQube Version 8.9.7 (build 52159). We were running a previous build 8.6 and did not see this issue there. I’ve verified that as shown below that the project is being picked up by Sonar as Java 8.
Thank you for reporting the issue. I tried to reproduce the FP and indeed, the Java analyzer wrongly reports it on SQ 8.9.X LTS. The analyzer however does not report it anymore starting from SonarQube 9.2.
The FP has been fixed by the ticket you already mentioned (SONARJAVA-4040), but unfortunately for you, it has only been shipped version 7.4 of the Java Analyuer, itself embedded in SQ 9.2 and deployed on SonarCloud. Such fixes are not backported to LTS.
In order to benefit from the latest fixes and improvements of the Java analyzer, you will have to upgrade to latest release of SonarQube (9.3 so far, 9.4 expected very soon).