Skip to content

Commit

Permalink
feat(spanner): removing isExternalHost as a data member of the builde…
Browse files Browse the repository at this point in the history
…r class
  • Loading branch information
sagnghos committed Jan 2, 2025
1 parent d0a2612 commit 2391971
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 2391971

Please sign in to comment.