Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

NPE is thrown when setting log level lower than FINER #1201

@Gerschtli

Description

@Gerschtli

Currently I can't set the log level lower than FINER because this library throws a NPE. The cause of this problem is a missing pair of parentheses in https://github.com/googleapis/gax-java/blob/master/gax/src/main/java/com/google/api/gax/retrying/BasicRetryingFuture.java#L179.

This is the current snippet:

"enclosingMethod: " + callable.getClass().getEnclosingMethod() != null
  ? callable.getClass().getEnclosingMethod().getName()
  : ""

Which is equivalent to:

("enclosingMethod: " + callable.getClass().getEnclosingMethod()) != null
  ? callable.getClass().getEnclosingMethod().getName()
  : ""

This results in calling callable.getClass().getEnclosingMethod().getName() even if callable.getClass().getEnclosingMethod() is null.

For a potential fix, see #1198.

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions