googleapis / googleapis/google-cloud-java
[java-logging] LoggingOptions.getDefaultInstance() always returns a new object
Abierto
api: logging
next major: breaking change
priority: p3
type: bug
- Lenguaje dominante
- Java
- Estrellas
- 2.1k
- Forks
- 1.2k
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 154
Descripción
`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.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.