Uploaded image for project: 'SonarLint For Eclipse'
  1. SonarLint For Eclipse
  2. SLE-348

Type resolution issue lead to false positive depending on the runtime JRE

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Run Eclipse with a JDK 8.

      Create a Java project targeting a JDK 13, with this code snippet:

      class TooManyRootsException extends java.lang.RuntimeException {
        public TooManyRootsException(String message) {
          super(message);
        }
      }
       

      Despite the fact the class is extending RuntimeException, the rule java:S2166 is creating an issue: Rename this class to remove "Exception" or correct its inheritance.

      For another reproducer with rule java:S1854, see https://community.sonarsource.com/t/sonarlint-wrong-useless-assignment-to-local-variables/24297

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                julien.henry Julien Henry
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: