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

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

Closed
Gerschtli opened this issue Oct 5, 2020 · 1 comment
Closed

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

Gerschtli opened this issue Oct 5, 2020 · 1 comment
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@Gerschtli
Copy link
Contributor

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.

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Oct 6, 2020
@AlanGasperini AlanGasperini added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Oct 6, 2020
@Gerschtli
Copy link
Contributor Author

Can be closed as #1198 was merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants