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

FP on S2441: Rule should take into account autoboxing of primitive types

    XMLWordPrintable

    Details

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

      Description

      Primitives types should be taken into account in implementation of rule S2441, as autoboxing convert them into their object wrapper classes.

      int id=20;
      request.getSession().setAttribute("id", id); // Should be compliant (in autoboxed in Integer)
      request.getSession().setAttribute("id", new Integer(id)); // Compliant
      

      Original Thread from SQ google group: https://groups.google.com/d/msgid/sonarqube/6bd9dc85-2168-44fb-9bc1-d74139921516%40googlegroups.com

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              massimo.paladin Massimo PALADIN
              Reporter:
              michael.gumowski Michael Gumowski
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: