FormatStringChecker (Groovy 5.0.6)

Package: groovy.typecheckers

## [Groovy] Class FormatStringChecker

- groovy.typecheckers.FormatStringChecker

-     @Incubating
      class FormatStringChecker
      extends TypeCheckingDSL

  Checks at compile-time for incorrect format strings in format methods such as `printf` and `String.format`. A format method’s specification requires that:

  •
  - The format string’s syntax is valid
  •
  - The correct number of arguments is passed
  •
  - Each argument has the appropriate type
  - Example invalid format strings include:

             String.format('%y', 7)                 // unknown conversion: 'y'
             sprintf('%d', 'some string')           // illegal conversion: d != java.lang.String
             printf("%d %s", 7)                     // missing argument: '%s'
             System.out.printf('%-tT', new Date())  // missing width
             String.format(Locale.US, '%#b', true)  // invalid flag

  Modelled on the checker framework checker with the same name: https://checkerframework.org/manual/#formatter-checker https://homes.cs.washington.edu/~mernst/pubs/format-string-issta2014-abstract.html https://github.com/typetools/checker-framework/tree/master/checker/src/main/java/org/checkerframework/checker/formatter

- - ### Constructor Summary

    Constructors
    Constructor and description
    `FormatStringChecker()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `Object` | `run()`

- - ### Constructor Detail

    - #### FormatStringChecker()

  - ### Method Detail

    - #### @Override
      Object run()