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

Extend S3457 to support String “formatted” method from Java 15

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:

      Description

      In Java 15, there is now a new way to format String:

      "%s".formatted("abc");
      

      It makes sense to extend S3457 to also report when this method is incorrectly used.

      "%s".formatted("a", "b"); // Noncompliant {{2nd argument is not used.}}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                quentin.jaquier Quentin Jaquier
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: