googleapis / googleapis/google-cloud-java
[java-logging] LoggingOptions.getDefaultInstance() always returns a new object
Đang mở
api: logging
next major: breaking change
priority: p3
type: bug
- Ngôn ngữ chính
- Java
- Star
- 2.1k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 154
Mô tả
`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.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.