googleapis / googleapis/google-cloud-java

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

オープン
#11,922 コメント 5 件 リアクション 0 件 担当者 1 名 @cindy-peng が担当を希望しています GitHub で見る
api: logging next major: breaking change priority: p3 type: bug
主要言語
Java
スター
2.1k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
154

説明

`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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。