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

S2226 FP on lambda parameters of servlet fields initializers

    Details

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

      Description

      import java.util.function.Function;
      import javax.servlet.http.HttpServlet;
      
      public class Servlet extends HttpServlet {
        private static final Function<Integer, Integer> SOME_FUN = param -> 1; // FP raised on param of the lambda as the rule wrongly consider all variables owned by the class inheriting from servlet and not solely fields.
      } 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alban.auzeill Alban Auzeill
                Reporter:
                nicolas.peru Nicolas Peru
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: