@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:
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
| Constructor and description |
|---|
FormatStringChecker() |
Copyright © 2003-2025 The Apache Software Foundation. All rights reserved.