googleapis / googleapis/google-cloud-java

[java-logging] LoggingOptions.getDefaultInstance() always returns a new object

Abierto
#11,922 5 comentarios 0 reacciones 1 asignado Reclamado por @cindy-peng Ver en GitHub
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

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.