Skip to content

Commit 5c4c8c5

Browse files
authored
fix!: initialize should be protected (#536)
* fix!: iniialize should be protected * fix: fix clirr build error
1 parent 1811f52 commit 5c4c8c5

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

google-cloud-spanner/clirr-ignored-differences.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,4 +377,21 @@
377377
<className>com/google/cloud/spanner/AsyncTransactionManager</className>
378378
<method>com.google.api.core.ApiFuture closeAsync()</method>
379379
</difference>
380+
381+
<!-- Note: The following change for the LazySpannerInitializer.initialize() method must be specified twice, both with return type java.lang.Object and with com.google.cloud.spanner.Spanner. -->
382+
<difference>
383+
<differenceType>7009</differenceType>
384+
<className>com/google/cloud/spanner/LazySpannerInitializer</className>
385+
<method>com.google.cloud.spanner.Spanner initialize()</method>
386+
</difference>
387+
<difference>
388+
<differenceType>7009</differenceType>
389+
<className>com/google/cloud/spanner/LazySpannerInitializer</className>
390+
<method>java.lang.Object initialize()</method>
391+
</difference>
392+
<difference>
393+
<differenceType>7009</differenceType>
394+
<className>com/google/cloud/spanner/AbstractLazyInitializer</className>
395+
<method>java.lang.Object initialize()</method>
396+
</difference>
380397
</differences>

google-cloud-spanner/src/main/java/com/google/cloud/spanner/AbstractLazyInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ public T get() throws Exception {
5151
* Initializes the actual object that should be returned. Is called once the first time an
5252
* instance of T is required.
5353
*/
54-
public abstract T initialize() throws Exception;
54+
protected abstract T initialize() throws Exception;
5555
}

google-cloud-spanner/src/main/java/com/google/cloud/spanner/LazySpannerInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class LazySpannerInitializer extends AbstractLazyInitializer<Spanner> {
2323
* custom configuration.
2424
*/
2525
@Override
26-
public Spanner initialize() throws Exception {
26+
protected Spanner initialize() throws Exception {
2727
return SpannerOptions.newBuilder().build().getService();
2828
}
2929
}

0 commit comments

Comments
 (0)