googleapis / googleapis/google-cloud-java
[java-logging] LoggingOptions.getDefaultInstance() always returns a new object
- Langage dominant
- Java
- Étoiles
- 2.1k
- Forks
- 1.2k
- Merge moyen
- 1 j 23 h
- PR mergées (30 j)
- 154
Description
`LoggingOptions.getDefaultInstance()` always returns a new object:
```java
public static LoggingOptions getDefaultInstance() {
return newBuilder().build();
}
```
This is very misleading, because the method name suggests it will return the same instance.
Consequences are that `Logging` instance is not shared among handlers etc. if we use `LoggingOptions.getDefaultInstance()` to pass the options, without saving them to a variable.
In fact, our codebase had `LoggingOptions.getDefaultInstance().service` in a few places, and a new client was always created as a result.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.