fix(spanner): cache auto-tagging options to avoid system property lock contention by sakthivelmanii · Pull Request #13273 · googleapis/google-cloud-java (original) (raw)

high

Removing the public method isAutoTaggingDisabled() is a breaking change for the public API of SpannerOptions. To avoid breaking backward compatibility while still preventing system property lock contention, we should keep this method and return a cached value.

Note: You will also need to declare private final boolean autoTaggingDisabled; as a field in the class.

public boolean isAutoTaggingDisabled() {
return environment.isAutoTaggingDisabled();
}
public boolean isAutoTaggingDisabled() {
return autoTaggingDisabled;
}