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

LogData.getTemplateContext() should be @NullableDecl #381

Closed
bhamiltoncx opened this issue May 15, 2024 · 0 comments
Closed

LogData.getTemplateContext() should be @NullableDecl #381

bhamiltoncx opened this issue May 15, 2024 · 0 comments
Assignees
Labels
P2 type=enhancement Make an existing feature better

Comments

@bhamiltoncx
Copy link
Member

LogData.getTemplateContext() is documented to return null for statements which do not require formatting:

  /**
   * Returns a template key for this log statement, or {@code null} if the statement does not
   * require formatting (in which case the message to be logged can be determined by calling
   * {@link #getLiteralArgument()}).
   */
  TemplateContext getTemplateContext();

However, this method is not marked @NullableDecl or @Nullable, so returning null triggers warnings from static analyzers.

@cpovirk cpovirk added P2 type=enhancement Make an existing feature better labels May 16, 2024
@cpovirk cpovirk self-assigned this May 16, 2024
copybara-service bot pushed a commit that referenced this issue May 16, 2024
…oggerName()

Fixes #381 .

Tested:
  % bazel test :api_tests
RELNOTES=Updates nullability for LogData
PiperOrigin-RevId: 634014539
copybara-service bot pushed a commit that referenced this issue May 16, 2024
…oggerName()

Fixes #381 .

Tested:
  % bazel test :api_tests
RELNOTES=Updates nullability for LogData
PiperOrigin-RevId: 634014539
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 type=enhancement Make an existing feature better
Projects
None yet
2 participants