Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-3536

Consistently support Nullable/CheckForNull/Nonnull annotations in rules

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.9
    • Component/s: Rules
    • Labels:
      None

      Description

      Many rules rely on @Nullable@CheckForNull and @Nonnull annotations in their implementation, to either find new issues or remove false positives. These annotations can come from different dependencies. Currently, many rules define on their side different lists of annotations. It makes the situation inconsistent, and hard to maintain.

      We already have a NullableAnnotationUtils, we should use it in all rules relying on such annotations.

      Specifically:

      • Many rules only support the 3 annotations coming from javax.annotation package. We should improve them to support more well-known packages. This change will remove:
      • Symbolic execution rules already rely on the common helper

      In addition, it would make sense to add the support for more annotations commonly used:

      • edu.umd.cs.findbugs.annotations.CheckForNull

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alban.auzeill Alban Auzeill
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: