Skip to content

[Java] ErrorProne Enhancements with @FormatMethod and @FormatString #41951

Description

@vibhatha

Describe the enhancement requested

ErrorProne warnings have been common to functions with a similar signature as follows.

privatevoidhist(StringnoteFormat, Object... args) {
if (historicalLog != null) {
historicalLog.recordEvent(noteFormat, args);
}
}

And they must be updated as follows.

@FormatMethodprivatevoidhist(@FormatStringStringnoteFormat, Object... args) {
if (historicalLog != null) {
historicalLog.recordEvent(noteFormat, args);
}
}

At the moment, this would be suppressed based on the discussion here. But this must be resolved once we support JDK11+.

Component(s)

Java

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions