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

S2441 does not handle correctly unknown types

    XMLWordPrintable

    Details

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

      Description

      Non-resolved argument types should not raise issues.

      The following code report issues with wrong message.

      • The issue is a FP
      • The method/object of arg0 is not resolved, and therefore it's type is not as well, while ECJ stil manage to resolve the method.
      • The message contains uses a type directly when formatting it, resulting in:
        Make "org.sonar.java.resolve.Symbols$UnknownType@51dbd6e4" serializable or don't store it in the session.
        void foo(HttpServletRequest request) {
          HttpSession session = request.getSession();
          session.setAttribute("name", UnknownObject.unknownValue());  //  wrong message here
        }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Due:
                Created:
                Updated:
                Resolved: