Rule not detected RSPEC-6322

Hi Sonarqube Team,

The code below seems to contain the bug described in RSPEC-6322, however, the bug was not being detected during the scan. Any thoughts?

import java.util.Collections;
import java.util.List;

class UnsupportedCollectionOperationBug {
    public String showBug() {
        List<String> emptyList = Collections.emptyList();
        emptyList.add("bug"); 
        return emptyList.toString();
    }
}

Sonarqube version 25.5
Lang: Java
SonarScanner version: 5.0.1.3006

Screenshot of code scan results

Hey there.

This rule is only available in SonarQube Server’s Developer Edition and higher. Since you mentioned v25.5, that means you’re using SonarQube’s Community Build, which does not include this rule.

The issue is correctly raised when using an edition including this rule.

When reporting false-negatives, please make sure the rule you’re looking at is activated in your project’s Quality Profile.