From 2391971a49dd40d3cf832ab283e7fe4a2746414a Mon Sep 17 00:00:00 2001 From: sagnghos Date: Mon, 30 Dec 2024 05:41:10 +0000 Subject: [PATCH] feat(spanner): removing isExternalHost as a data member of the builder class --- .../google/cloud/spanner/connection/ConnectionOptions.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java index eea3e9f34dc..d205699bb9e 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/ConnectionOptions.java @@ -842,7 +842,6 @@ public static Builder newBuilder() { private final Credentials fixedCredentials; private final String host; - private boolean isExternalHost; private final String projectId; private final String instanceId; private final String databaseName; @@ -856,10 +855,10 @@ public static Builder newBuilder() { private ConnectionOptions(Builder builder) { Matcher matcher; - this.isExternalHost = false; + boolean isExternalHost = false; if (builder.isValidExternalHostUri(builder.uri)) { matcher = Builder.EXTERNAL_HOST_PATTERN.matcher(builder.uri); - this.isExternalHost = true; + isExternalHost = true; } else { matcher = Builder.SPANNER_URI_PATTERN.matcher(builder.uri); } @@ -982,7 +981,7 @@ && getInitialConnectionPropertyValue(OAUTH_TOKEN) == null String projectId = "default"; String instanceId = matcher.group(Builder.INSTANCE_GROUP); - if (!this.isExternalHost) { + if (!isExternalHost) { projectId = matcher.group(Builder.PROJECT_GROUP); } else if (instanceId == null) { instanceId = "default";