Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatMethod: about the position of the argument: [FormatStringAnnotation] extra format arguments: used 0, provided 1 #4278

Open
coolderli opened this issue Feb 7, 2024 · 0 comments

Comments

@coolderli
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant