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

FP on S1128 when import used in class annotations

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: Rules
    • Labels:
      None

      Description

      The rule reports false positives when the import is used in the class annotations.

       

      package org.foo;
      
      import static org.foo.SomeEntity.FIND_BY_NAME; // FP
      
      @MyAnnotation(name = FIND_BY_NAME)
      class SomeEntity {
        public static final String FIND_BY_NAME = "SomeEntity.findByName";
        private String name;
      }
      
      @interface MyAnnotation {
        String name();
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                amelie.renard Amélie Renard
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: