error-prone
error-prone copied to clipboard
FormatMethod: about the position of the argument: [FormatStringAnnotation] extra format arguments: used 0, provided 1
Hi, I'm using @FormatMethod
to format my code. Should the argument be behind the format string?
If I write as below, I will get an error.
@FormatMethod
public GravitinoRuntimeException(@FormatString String message, Object... args) {
super(String.format(message, args));
}
@FormatMethod
public GravitinoRuntimeException(@FormatString String message, Throwable cause, Object... args) {
super(String.format(message, args), cause);
}
new GravitinoRuntimeException("Error creating datasource", exception)
The error like:
[FormatStringAnnotation] extra format arguments: used 0, provided 1
Thanks.