blob: 21b866857bf14e51e3496d9060a5e7f7fe40b247 [file] [log] [blame]
import org.checkerframework.checker.formatter.qual.ConversionCategory;
import org.checkerframework.checker.formatter.qual.Format;
import org.checkerframework.checker.formatter.qual.FormatMethod;
public class FormatMethodAndFormat {
// This method contains both @FormatMethod and @Format. Both constrain the arguments.
@FormatMethod
void log(@Format(ConversionCategory.INT) String format, Object... args) {
System.out.printf(format, args);
}
void client() {
// Without the @Format annotation (with just the @FormatMethod anno), this would be legal.
// :: error: (argument)
log("%s %s", "hello", "goodbye");
}
}