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

FN on S1640 : EnumMapCheck

    XMLWordPrintable

    Details

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

      Description

      The following code should raise an issue:

      class MyClass {
        public enum COLOR {
          RED, GREEN, BLUE, ORANGE;
        }
      
        void foo() { 
          Map<COLOR, String> map;
          map = new HashMap<>(); // Noncompliant
        }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michael.gumowski Michael Gumowski
              Reporter:
              michael.gumowski Michael Gumowski
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: