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

FP on S2441: Array or Collection of Serializable objects are Serializable

    Details

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

      Description

      import java.util.ArrayList;
      import java.util.List;
      
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpSession;
      
      public class Main {
      
          public void test(HttpServletRequest request) {
              // test with Array
              HttpSession session = request.getSession();
              session.setAttribute("test with array", new String[] { "1", "2" }); // False Positive
      
              // test with List
              List<String> list = new ArrayList<>(); 
              session.setAttribute("test with list", list); // False Positive
          }
      
      }
      

        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

                • Created:
                  Updated:
                  Resolved: