# java:S2166 rule not working

**URL:** <https://community.sonarsource.com/t/java-s2166-rule-not-working/22943>\
**Category:** Report False-positive / False-negative...\
**Tags:** sonarqube-ide, java\
**Created:** [April 12, 2020, 5:03pm UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943 "2020-04-12T17:03:13Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoadingBG](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/loadingbg/32/10857_2.png) [@LoadingBG](https://community.sonarsource.com/u/LoadingBG)\
**Post date:** [April 12, 2020, 5:03pm UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/1 "2020-04-12T17:03:13Z")

</div>

I have this code:

```auto
@SuppressWarnings("serial")
class TooManyRootsException extends RuntimeException {
    /**
     * Creates an exception with the given message.
     *
     * @param message The message to be shown.
     */
    public TooManyRootsException(String message) {
        super(message);
    }
}

```

Sonarlint gives me a false positive for rule java:S2166 “Classes named like “Exception” should extend “Exception” or a subclass”. If I remove the “Exception” part of the name, Sonarlint does not give the a positive. Why is that?

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [April 14, 2020, 6:57am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/2 "2020-04-14T06:57:40Z")

</div>

Hi,

I’m not able to reproduce in SonarLint Eclipse with just this code snippet.

Can you tell us what is your IDE, what is your SonarLint version, and if you are using connected mode, what is the version of the Java analyzer installed on the SonarQube server?

---

<div class="post-metadata">

**Author:** ![LoadingBG](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/loadingbg/32/10857_2.png) [@LoadingBG](https://community.sonarsource.com/u/LoadingBG)\
**Post date:** [April 14, 2020, 9:59am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/3 "2020-04-14T09:59:57Z")

</div>

IDE: Eclipse  
Version: 5.0  
Not sure what the rest means, I installed it from the Eclipse Marketplace.  
Hope that helps.

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [April 14, 2020, 12:09pm UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/4 "2020-04-14T12:09:32Z")

</div>

> [@LoadingBG](#):
>
> Not sure what the rest means

If you don’t know what is connected mode, then you are certainly not using it 🙂.

Could you please follow those steps:

- open the SonarLint console (in Eclipse console view)
- enable verbose + analysis logs
- clear the console
- close and reopen the offending file (TooManyRootsException.java)
- copy paste the logs produced in the console by the analysis

It might be useful to read the [FAQ](https://community.sonarsource.com/t/frequently-asked-questions/7204) first, but if one step is not clear, let me know.

---

<div class="post-metadata">

**Author:** ![LoadingBG](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/loadingbg/32/10857_2.png) [@LoadingBG](https://community.sonarsource.com/u/LoadingBG)\
**Post date:** [April 14, 2020, 4:51pm UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/5 "2020-04-14T16:51:31Z")

</div>

```nohighlight
Trigger: EDITOR_OPEN
Clear markers on 0 excluded files
SonarLint processing file /DiscordBot/src/main/java/bot/discord/minimlparsing/TooManyRootsException.java...
Standalone mode (project not bound)
Starting analysis with configuration:
[
  baseDir: C:\Users\troya\OneDrive\Desktop\java programs\DiscordBot
  extraProperties: {sonar.java.target=13, sonar.java.libraries=C:\Program Files\Java\jdk-13.0.2\lib\jrt-fs.jar,C:\Users\troya\.m2\repository\net\dv8tion\JDA\4.1.1_122\JDA-4.1.1_122.jar,C:\Users\troya\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar,C:\Users\troya\.m2\repository\org\jetbrains\annotations\16.0.1\annotations-16.0.1.jar,C:\Users\troya\.m2\repository\com\neovisionaries\nv-websocket-client\2.9\nv-websocket-client-2.9.jar,C:\Users\troya\.m2\repository\com\squareup\okhttp3\okhttp\3.13.0\okhttp-3.13.0.jar,C:\Users\troya\.m2\repository\com\squareup\okio\okio\1.17.2\okio-1.17.2.jar,C:\Users\troya\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar,C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.10.1\jackson-databind-2.10.1.jar,C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.1\jackson-annotations-2.10.1.jar,C:\Users\troya\.m2\repository\com\sedmelluq\lavaplayer\1.3.34\lavaplayer-1.3.34.jar,C:\Users\troya\.m2\repository\com\sedmelluq\lava-common\1.1.0\lava-common-1.1.0.jar,C:\Users\troya\.m2\repository\com\sedmelluq\lavaplayer-natives\1.3.13\lavaplayer-natives-1.3.13.jar,C:\Users\troya\.m2\repository\org\apache\httpcomponents\httpclient\4.5.10\httpclient-4.5.10.jar,C:\Users\troya\.m2\repository\org\apache\httpcomponents\httpcore\4.4.12\httpcore-4.4.12.jar,C:\Users\troya\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar,C:\Users\troya\.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar,C:\Users\troya\.m2\repository\commons-io\commons-io\2.6\commons-io-2.6.jar,C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.10.0\jackson-core-2.10.0.jar,C:\Users\troya\.m2\repository\org\jsoup\jsoup\1.12.1\jsoup-1.12.1.jar,C:\Users\troya\.m2\repository\net\iharder\base64\2.3.9\base64-2.3.9.jar,C:\Users\troya\.m2\repository\com\google\apis\google-api-services-youtube\v3-rev222-1.25.0\google-api-services-youtube-v3-rev222-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\api-client\google-api-client\1.25.0\google-api-client-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\oauth-client\google-oauth-client\1.25.0\google-oauth-client-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\http-client\google-http-client\1.25.0\google-http-client-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar,C:\Users\troya\.m2\repository\com\google\http-client\google-http-client-jackson2\1.25.0\google-http-client-jackson2-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\guava\guava\20.0\guava-20.0.jar,C:\Users\troya\.m2\repository\org\slf4j\slf4j-api\2.0.0-alpha1\slf4j-api-2.0.0-alpha1.jar,C:\Users\troya\.m2\repository\org\slf4j\slf4j-nop\2.0.0-alpha1\slf4j-nop-2.0.0-alpha1.jar,C:/Users/troya/OneDrive/Desktop/java programs/random projects/bin, sonar.java.source=13, sonar.java.binaries=C:/Users/troya/OneDrive/Desktop/java programs/DiscordBot/target/classes, sonar.java.test.binaries=C:/Users/troya/OneDrive/Desktop/java programs/DiscordBot/target/test-classes, sonar.java.test.libraries=C:/Users/troya/OneDrive/Desktop/java programs/DiscordBot/target/classes,C:\Program Files\Java\jdk-13.0.2\lib\jrt-fs.jar,C:\Users\troya\.m2\repository\net\dv8tion\JDA\4.1.1_122\JDA-4.1.1_122.jar,C:\Users\troya\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar,C:\Users\troya\.m2\repository\org\jetbrains\annotations\16.0.1\annotations-16.0.1.jar,C:\Users\troya\.m2\repository\com\neovisionaries\nv-websocket-client\2.9\nv-websocket-client-2.9.jar,C:\Users\troya\.m2\repository\com\squareup\okhttp3\okhttp\3.13.0\okhttp-3.13.0.jar,C:\Users\troya\.m2\repository\com\squareup\okio\okio\1.17.2\okio-1.17.2.jar,C:\Users\troya\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar,C:\Users\troya\.m2\repository\net\sf\trove4j\trove4j\3.0.3\trove4j-3.0.3.jar,C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.10.1\jackson-databind-2.10.1.jar,C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.1\jackson-annotations-2.10.1.jar,C:\Users\troya\.m2\repository\com\sedmelluq\lavaplayer\1.3.34\lavaplayer-1.3.34.jar,C:\Users\troya\.m2\repository\com\sedmelluq\lava-common\1.1.0\lava-common-1.1.0.jar,C:\Users\troya\.m2\repository\com\sedmelluq\lavaplayer-natives\1.3.13\lavaplayer-natives-1.3.13.jar,C:\Users\troya\.m2\repository\org\apache\httpcomponents\httpclient\4.5.10\httpclient-4.5.10.jar,C:\Users\troya\.m2\repository\org\apache\httpcomponents\httpcore\4.4.12\httpcore-4.4.12.jar,C:\Users\troya\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar,C:\Users\troya\.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar,C:\Users\troya\.m2\repository\commons-io\commons-io\2.6\commons-io-2.6.jar,C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.10.0\jackson-core-2.10.0.jar,C:\Users\troya\.m2\repository\org\jsoup\jsoup\1.12.1\jsoup-1.12.1.jar,C:\Users\troya\.m2\repository\net\iharder\base64\2.3.9\base64-2.3.9.jar,C:\Users\troya\.m2\repository\com\google\apis\google-api-services-youtube\v3-rev222-1.25.0\google-api-services-youtube-v3-rev222-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\api-client\google-api-client\1.25.0\google-api-client-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\oauth-client\google-oauth-client\1.25.0\google-oauth-client-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\http-client\google-http-client\1.25.0\google-http-client-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar,C:\Users\troya\.m2\repository\com\google\http-client\google-http-client-jackson2\1.25.0\google-http-client-jackson2-1.25.0.jar,C:\Users\troya\.m2\repository\com\google\guava\guava\20.0\guava-20.0.jar,C:\Users\troya\.m2\repository\org\slf4j\slf4j-api\2.0.0-alpha1\slf4j-api-2.0.0-alpha1.jar,C:\Users\troya\.m2\repository\org\slf4j\slf4j-nop\2.0.0-alpha1\slf4j-nop-2.0.0-alpha1.jar,C:/Users/troya/OneDrive/Desktop/java programs/random projects/bin}
  excludedRules: []
  includedRules: []
  inputFiles: [
    file:/C:/Users/troya/OneDrive/Desktop/java%20programs/DiscordBot/src/main/java/bot/discord/minimlparsing/TooManyRootsException.java (UTF-8)
  ]
]

TypeScript sensor excluded
Available languages:
  * PHP => "php"
  * Python => "py"
  * Java => "java"
  * HTML => "web"
  * JSP => "jsp"
  * JavaScript => "js"
  * TypeScript => "ts"
Start analysis
Declared extensions of language PHP were converted to php: **/*.php,** /*.php3, **/*.php4,** /*.php5, **/*.phtml,** /*.inc
Declared extensions of language Python were converted to py: **/*.py
Declared extensions of language Java were converted to java: **/*.java,** /*.jav
Declared extensions of language HTML were converted to web: **/*.html,** /*.xhtml, **/*.cshtml,** /*.vbhtml, **/*.aspx,** /*.ascx, **/*.rhtml,** /*.erb, **/*.shtm,** /*.shtml
Declared extensions of language JSP were converted to jsp: **/*.jsp,** /*.jspf,**/*.jspx
Declared extensions of language JavaScript were converted to js: **/*.js,** /*.jsx,**/*.vue
Declared extensions of language TypeScript were converted to ts: **/*.ts,** /*.tsx
Index files
Language of file 'file:/C:/Users/troya/OneDrive/Desktop/java%20programs/DiscordBot/src/main/java/bot/discord/minimlparsing/TooManyRootsException.java' is detected to be 'java'
1 file indexed
Execute Sensor: JavaSquidSensor
Configured Java source version (sonar.java.source): 13
JavaClasspath initialization
JavaClasspath initialization (done) | time=2ms
JavaTestClasspath initialization
JavaTestClasspath initialization (done) | time=3ms
----- Classpath analyzed by Squid:
C:\Users\troya\OneDrive\Desktop\java programs\DiscordBot\target\classes
C:\Program Files\Java\jdk-13.0.2\lib\jrt-fs.jar
C:\Users\troya\.m2\repository\net\dv8tion\JDA\4.1.1_122\JDA-4.1.1_122.jar
C:\Users\troya\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar
C:\Users\troya\.m2\repository\org\jetbrains\annotations\16.0.1\annotations-16.0.1.jar
C:\Users\troya\.m2\repository\com\neovisionaries\nv-websocket-client\2.9\nv-websocket-client-2.9.jar
C:\Users\troya\.m2\repository\com\squareup\okhttp3\okhttp\3.13.0\okhttp-3.13.0.jar
C:\Users\troya\.m2\repository\com\squareup\okio\okio\1.17.2\okio-1.17.2.jar
C:\Users\troya\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar
C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.10.1\jackson-databind-2.10.1.jar
C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.1\jackson-annotations-2.10.1.jar
C:\Users\troya\.m2\repository\com\sedmelluq\lavaplayer\1.3.34\lavaplayer-1.3.34.jar
C:\Users\troya\.m2\repository\com\sedmelluq\lava-common\1.1.0\lava-common-1.1.0.jar
C:\Users\troya\.m2\repository\com\sedmelluq\lavaplayer-natives\1.3.13\lavaplayer-natives-1.3.13.jar
C:\Users\troya\.m2\repository\org\apache\httpcomponents\httpclient\4.5.10\httpclient-4.5.10.jar
C:\Users\troya\.m2\repository\org\apache\httpcomponents\httpcore\4.4.12\httpcore-4.4.12.jar
C:\Users\troya\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar
C:\Users\troya\.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar
C:\Users\troya\.m2\repository\commons-io\commons-io\2.6\commons-io-2.6.jar
C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.10.0\jackson-core-2.10.0.jar
C:\Users\troya\.m2\repository\org\jsoup\jsoup\1.12.1\jsoup-1.12.1.jar
C:\Users\troya\.m2\repository\net\iharder\base64\2.3.9\base64-2.3.9.jar
C:\Users\troya\.m2\repository\com\google\apis\google-api-services-youtube\v3-rev222-1.25.0\google-api-services-youtube-v3-rev222-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\api-client\google-api-client\1.25.0\google-api-client-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\oauth-client\google-oauth-client\1.25.0\google-oauth-client-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\http-client\google-http-client\1.25.0\google-http-client-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar
C:\Users\troya\.m2\repository\com\google\http-client\google-http-client-jackson2\1.25.0\google-http-client-jackson2-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\guava\guava\20.0\guava-20.0.jar
C:\Users\troya\.m2\repository\org\slf4j\slf4j-api\2.0.0-alpha1\slf4j-api-2.0.0-alpha1.jar
C:\Users\troya\.m2\repository\org\slf4j\slf4j-nop\2.0.0-alpha1\slf4j-nop-2.0.0-alpha1.jar
C:\Users\troya\OneDrive\Desktop\java programs\random projects\bin
-----
----- Classpath analyzed by Squid:
C:\Users\troya\OneDrive\Desktop\java programs\DiscordBot\target\test-classes
C:\Users\troya\OneDrive\Desktop\java programs\DiscordBot\target\classes
C:\Program Files\Java\jdk-13.0.2\lib\jrt-fs.jar
C:\Users\troya\.m2\repository\net\dv8tion\JDA\4.1.1_122\JDA-4.1.1_122.jar
C:\Users\troya\.m2\repository\com\google\code\findbugs\jsr305\3.0.2\jsr305-3.0.2.jar
C:\Users\troya\.m2\repository\org\jetbrains\annotations\16.0.1\annotations-16.0.1.jar
C:\Users\troya\.m2\repository\com\neovisionaries\nv-websocket-client\2.9\nv-websocket-client-2.9.jar
C:\Users\troya\.m2\repository\com\squareup\okhttp3\okhttp\3.13.0\okhttp-3.13.0.jar
C:\Users\troya\.m2\repository\com\squareup\okio\okio\1.17.2\okio-1.17.2.jar
C:\Users\troya\.m2\repository\org\apache\commons\commons-collections4\4.1\commons-collections4-4.1.jar
C:\Users\troya\.m2\repository\net\sf\trove4j\trove4j\3.0.3\trove4j-3.0.3.jar
C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.10.1\jackson-databind-2.10.1.jar
C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.10.1\jackson-annotations-2.10.1.jar
C:\Users\troya\.m2\repository\com\sedmelluq\lavaplayer\1.3.34\lavaplayer-1.3.34.jar
C:\Users\troya\.m2\repository\com\sedmelluq\lava-common\1.1.0\lava-common-1.1.0.jar
C:\Users\troya\.m2\repository\com\sedmelluq\lavaplayer-natives\1.3.13\lavaplayer-natives-1.3.13.jar
C:\Users\troya\.m2\repository\org\apache\httpcomponents\httpclient\4.5.10\httpclient-4.5.10.jar
C:\Users\troya\.m2\repository\org\apache\httpcomponents\httpcore\4.4.12\httpcore-4.4.12.jar
C:\Users\troya\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar
C:\Users\troya\.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar
C:\Users\troya\.m2\repository\commons-io\commons-io\2.6\commons-io-2.6.jar
C:\Users\troya\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.10.0\jackson-core-2.10.0.jar
C:\Users\troya\.m2\repository\org\jsoup\jsoup\1.12.1\jsoup-1.12.1.jar
C:\Users\troya\.m2\repository\net\iharder\base64\2.3.9\base64-2.3.9.jar
C:\Users\troya\.m2\repository\com\google\apis\google-api-services-youtube\v3-rev222-1.25.0\google-api-services-youtube-v3-rev222-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\api-client\google-api-client\1.25.0\google-api-client-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\oauth-client\google-oauth-client\1.25.0\google-oauth-client-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\http-client\google-http-client\1.25.0\google-http-client-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar
C:\Users\troya\.m2\repository\com\google\http-client\google-http-client-jackson2\1.25.0\google-http-client-jackson2-1.25.0.jar
C:\Users\troya\.m2\repository\com\google\guava\guava\20.0\guava-20.0.jar
C:\Users\troya\.m2\repository\org\slf4j\slf4j-api\2.0.0-alpha1\slf4j-api-2.0.0-alpha1.jar
C:\Users\troya\.m2\repository\org\slf4j\slf4j-nop\2.0.0-alpha1\slf4j-nop-2.0.0-alpha1.jar
C:\Users\troya\OneDrive\Desktop\java programs\random projects\bin
-----
Java Main Files AST scan
1 source files to be analyzed
Initializing metadata of file file:/C:/Users/troya/OneDrive/Desktop/java%20programs/DiscordBot/src/main/java/bot/discord/minimlparsing/TooManyRootsException.java
Java Main Files AST scan (done) | time=611ms
1/1 source files have been analyzed
Java Test Files AST scan
0 source files to be analyzed
Java Test Files AST scan (done) | time=0ms
'PHP sensor' skipped because there is no related file in current project
'Analyzer for "php.ini" files' skipped because there is no related file in current project
'Python Sensor' skipped because there is no related file in current project
Execute Sensor: JavaXmlSensor
Execute Sensor: HTML
'JavaScript analysis' skipped because there is no related file in current project
Found 1 issue(s)
Done in 713 ms
0/0 source files have been analyzed

```

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [April 15, 2020, 7:14am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/6 "2020-04-15T07:14:57Z")

</div>

Thanks, I see nothing suspicious here. I also tried to use a JDK 13 as target, but I’m still unable to reproduce.  
Is your code snippet a single class? Or an inner class of a bigger file?

Can you also double check that the inherited class is really `java.lang.RuntimeException` and not something else in a different package?

---

<div class="post-metadata">

**Author:** ![LoadingBG](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/loadingbg/32/10857_2.png) [@LoadingBG](https://community.sonarsource.com/u/LoadingBG)\
**Post date:** [April 16, 2020, 1:26pm UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/7 "2020-04-16T13:26:08Z")

</div>

It is a normal class from a bigger project.  
Even when specifing `java.lang.RuntimeException` the positive persists.

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [April 17, 2020, 7:08am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/9 "2020-04-17T07:08:37Z")

</div>

Hum, I start to be out of ideas. Can you try to create a new project in Eclipse, with only this class, and see if the false positive is still there? This is to find if the issue is specific to your project, or to your environment.

---

<div class="post-metadata">

**Author:** ![LoadingBG](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/loadingbg/32/10857_2.png) [@LoadingBG](https://community.sonarsource.com/u/LoadingBG)\
**Post date:** [April 17, 2020, 8:27am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/10 "2020-04-17T08:27:10Z")

</div>

It’s still positive.

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [April 17, 2020, 9:24am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/11 "2020-04-17T09:24:00Z")

</div>

Then I have no idea. On, my side it is working fine (Windows, SonarLint 5.0 as well):

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/2/2ed72c2d2ad2ebfc3d73fb1f22792ef2a1649aee.png)

I will try with a JDK 13 but I don’t see why it would make any difference.

Can you share a reproducer (sample project zipped)?

---

<div class="post-metadata">

**Author:** ![LoadingBG](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/loadingbg/32/10857_2.png) [@LoadingBG](https://community.sonarsource.com/u/LoadingBG)\
**Post date:** [April 18, 2020, 10:32am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/12 "2020-04-18T10:32:35Z")

</div>

[https://www.zipshare.com/download/eyJhcmNoaXZlSWQiOiJhZGI4ZGE5Ni1mZTNkLTRiNGYtYmM4MC02YmI0YTg0MDJhZjMiLCJlbWFpbCI6InRyb3lhbmtydUBnbWFpbC5jb20ifQ==](https://www.zipshare.com/download/eyJhcmNoaXZlSWQiOiJhZGI4ZGE5Ni1mZTNkLTRiNGYtYmM4MC02YmI0YTg0MDJhZjMiLCJlbWFpbCI6InRyb3lhbmtydUBnbWFpbC5jb20ifQ==)  
This is a ZIP folder with a test project.

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [April 20, 2020, 7:16am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/13 "2020-04-20T07:16:17Z")

</div>

I opened your project and no issues for me.

One thing I forgot to ask, is what is the JVM you are using to start Eclipse? You can check by opening Help -\> About Eclipse -\> Installation Details -\> Configuration

 ![image](https://europe1.discourse-cdn.com/sonarsource/uploads/sonarcommunity/original/2X/8/836258d8a91da8690703cd4d8fe726c37fe064d0.png)

---

<div class="post-metadata">

**Author:** ![LoadingBG](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/loadingbg/32/10857_2.png) [@LoadingBG](https://community.sonarsource.com/u/LoadingBG)\
**Post date:** [April 20, 2020, 4:13pm UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/14 "2020-04-20T16:13:02Z")

</div>

eclipse.vm=C:\Program Files\Java\jre1.8.0\_51\bin\server\jvm.dll

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [April 21, 2020, 7:04am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/15 "2020-04-21T07:04:49Z")

</div>

Perfect, that was the missing part of the puzzle 🙂 I am now able to reproduce.

We will investigate and I will keep you posted. You can also follow this ticket: [https://jira.sonarsource.com/browse/SLE-348](https://jira.sonarsource.com/browse/SLE-348)

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [April 22, 2020, 9:09am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/17 "2020-04-22T09:09:28Z")

</div>

I forgot to say one workaround in the meantime is to [run Eclipse with a more recent JDK](https://wiki.eclipse.org/Eclipse.ini#-vm_value:_Windows_Example).

---

<div class="post-metadata">

**Author:** ![LoadingBG](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/loadingbg/32/10857_2.png) [@LoadingBG](https://community.sonarsource.com/u/LoadingBG)\
**Post date:** [April 22, 2020, 11:14am UTC](https://community.sonarsource.com/t/java-s2166-rule-not-working/22943/18 "2020-04-22T11:14:21Z")

</div>

That fixed it actually.
