FormatMethod: about the position of the argument: [FormatStringAnnotation] extra format arguments: used 0, provided 1
Open
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
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.
Contributor guide
Assessment
This issue has not been assessed yet.