# False Negative for rule RSPEC-6070

**URL:** <https://community.sonarsource.com/t/false-negative-for-rule-rspec-6070/142041>\
**Category:** Report False-positive / False-negative...\
**Tags:** sonarqube, scanner, java\
**Created:** [May 30, 2025, 1:20am UTC](https://community.sonarsource.com/t/false-negative-for-rule-rspec-6070/142041 "2025-05-30T01:20:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chinwe](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chinwe](https://community.sonarsource.com/u/chinwe)\
**Post date:** [May 30, 2025, 1:20am UTC](https://community.sonarsource.com/t/false-negative-for-rule-rspec-6070/142041/1 "2025-05-30T01:20:27Z")

</div>

Hi Team,

I will like to bring this potential issue to your attention. Reference the image below.

The bug rule violated is RSPEC-6070 where lines 8 and 14 should be flagged for use of unreliable escape sequence in those lines.

Sonarqube version: 9.9.0.65466  
SonarScanner version: 5.0.1.3006  
SonarQube Community Edition  
Related language: Java

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/4/9/4950b6ff52c2fcf8da5eb2e549781ac52a044253.png)  
Image 1

Thanks for your time and consideration.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [May 30, 2025, 6:30am UTC](https://community.sonarsource.com/t/false-negative-for-rule-rspec-6070/142041/2 "2025-05-30T06:30:24Z")

</div>

Hey there.

Please take a look at this post on reporting false-positives.

> **[Report False-positive / False-negative...](https://community.sonarsource.com/c/rules-and-languages/fp/7)**
>
> Should a rule be adjusted for False-Positives, False-Negatives, or just a better description? Should analysis scope be broadened for a new framework, or language version? Let us know! \[Resources: How to Report a False-positive / False-negative\]

You’ll need to provide a text-based snippet of code, **and** make sure the issue can be reproduced on the latest version of SonarQube’s Community Build.

Only the latest version of SonarQube Community Build is considered active, so you’ll need to upgrade and see if the false-negative can still be produced!

Your upgrade path is:

> 9.9.0 → 24.12 → 25.5

You may find these resources helpful:

- [Upgrade Guide](https://docs.sonarsource.com/sonarqube-community-build/server-upgrade-and-maintenance/upgrade/upgrade-the-server/roadmap/)
- [Upgrade notes for 9.9 to 10.7](https://docs.sonarsource.com/sonarqube-server/10.7/server-upgrade-and-maintenance/release-notes-and-notices/release-upgrade-notes/) (when SonarQube Community Edition switched to SonarQube Community Bulid)
- [SonarQube Community Build Upgrade Notes](https://docs.sonarsource.com/sonarqube-community-build/server-upgrade-and-maintenance/release-notes-and-notices/release-upgrade-notes/) (all upgrade notes since the switch)

---

<div class="post-metadata">

**Author:** ![chinwe](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chinwe](https://community.sonarsource.com/u/chinwe)\
**Post date:** [June 1, 2025, 2:13am UTC](https://community.sonarsource.com/t/false-negative-for-rule-rspec-6070/142041/3 "2025-06-01T02:13:56Z")

</div>

Thanks for the response.

A retest has been performed using SonarQube version 10.7.0.96327. It remains the case that bug rule violation is not consistently flagged.

```auto
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
class BugExample {
    public void showBug() {
        try {
            Pattern.compile("\\ca"); 
        } catch (PatternSyntaxException e) {
            System.out.println(e.getMessage());
        }
        try {
            Pattern.compile("\\c!"); 
        } catch (PatternSyntaxException e) {
            System.out.println(e.getMessage()); 
        }
    }

}

```

To recreate the issue on your end, scan the code snippet, maybe try a few times and confirm if the violation of this rule, RSPEC-6070 is consistently flagged in the code.

Screenshot showing the result of the scan on the Sonarqube version 10.7 window.

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/3X/7/9/79a6e82e8b1d29b2638a5762dcec3eec934deeee.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [June 3, 2025, 8:42am UTC](https://community.sonarsource.com/t/false-negative-for-rule-rspec-6070/142041/4 "2025-06-03T08:42:56Z")

</div>

Like I said, you need to reproduce this on the latest version. _25.5_.

> [@False Negative for rule RSPEC-3981](https://community.sonarsource.com/t/false-negative-for-rule-rspec-3981/142042/2):
>
> Your upgrade path is:
> 
> > 9.9.0 → 24.12 → 25.5

Well, now it’s:

> 10.7 → 24.12 → 25.5
