FALSE NEGATIVE: `java:S1168` misses a parenthesized null return

Affected tool

SonarQube 26.7.0.124771; sonar-java 8.34

Affected checker

SonarQube java:S1168

Minimal reproducer

class SonarqubeS1168ParenthesizedNullArray {
  String[] values() {
    return (null);
  }
}

Reproduction command

sonar-scanner -Dsonar.projectKey=spotbugs-sonarqube-reproducer -Dsonar.sources=sonarqube-s1168-fn-parenthesized-null-array.java -Dsonar.host.url="$SONAR_HOST_URL" -Dsonar.token="$SONAR_TOKEN"

Current behavior

Two independent runs with only java:S1168 enabled produce no finding for the parenthesized return.

Expected behavior

SonarQube should report java:S1168 at line 3. The expression evaluates to the same null array value as return null;, which the checker reports in the matched control program.

Hi, thanks for reporting. I’ve created JIRA ticket to fix this.