Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit 787599c

Browse files
committed
chore: remove redundant checks
1 parent af2040a commit 787599c

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryJdbcOAuthUtility.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,7 @@ static Map<String, String> parseOAuthProperties(DataSource ds, String callerClas
129129
String serviceAccountEmail = ds.getOAuthServiceAcctEmail();
130130
String serviceAccountPK = ds.getOAuthPvtKey();
131131
String serviceAccountPrivateKeyPath = ds.getOAuthPvtKeyPath();
132-
String p12Password =
133-
ds.getOAuthP12Password() != null
134-
? ds.getOAuthP12Password()
135-
: BigQueryJdbcUrlUtility.DEFAULT_OAUTH_P12_PASSWORD_VALUE;
132+
String p12Password = ds.getOAuthP12Password();
136133

137134
oauthProperties.put(
138135
BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME, serviceAccountEmail);
@@ -150,10 +147,7 @@ static Map<String, String> parseOAuthProperties(DataSource ds, String callerClas
150147
BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME, ds.getOAuthClientId());
151148
oauthProperties.put(
152149
BigQueryJdbcUrlUtility.OAUTH_CLIENT_SECRET_PROPERTY_NAME, ds.getOAuthClientSecret());
153-
int reqGoogleDriveScope =
154-
ds.getRequestGoogleDriveScope() != null
155-
? ds.getRequestGoogleDriveScope()
156-
: BigQueryJdbcUrlUtility.DEFAULT_REQUEST_GOOGLE_DRIVE_SCOPE_VALUE;
150+
int reqGoogleDriveScope = ds.getRequestGoogleDriveScope();
157151
oauthProperties.put(
158152
BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME,
159153
String.valueOf(reqGoogleDriveScope));
@@ -234,14 +228,10 @@ static Map<String, String> parseOAuthProperties(DataSource ds, String callerClas
234228
|| authType == AuthType.PRE_GENERATED_TOKEN) {
235229
oauthProperties.put(
236230
BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_EMAIL_PROPERTY_NAME,
237-
ds.getOAuthSAImpersonationEmail() != null
238-
? ds.getOAuthSAImpersonationEmail()
239-
: BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_EMAIL_VALUE);
231+
ds.getOAuthSAImpersonationEmail());
240232
oauthProperties.put(
241233
BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_CHAIN_PROPERTY_NAME,
242-
ds.getOAuthSAImpersonationChain() != null
243-
? ds.getOAuthSAImpersonationChain()
244-
: BigQueryJdbcUrlUtility.DEFAULT_OAUTH_SA_IMPERSONATION_CHAIN_VALUE);
234+
ds.getOAuthSAImpersonationChain());
245235
oauthProperties.put(
246236
BigQueryJdbcUrlUtility.OAUTH_SA_IMPERSONATION_SCOPES_PROPERTY_NAME,
247237
ds.getOAuthSAImpersonationScopes() != null

google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/DataSource.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,9 @@ public void setSwaAppendRowCount(Integer swaAppendRowCount) {
11021102
}
11031103

11041104
public String getOAuthP12Password() {
1105-
return oAuthP12Password;
1105+
return oAuthP12Password != null
1106+
? oAuthP12Password
1107+
: BigQueryJdbcUrlUtility.DEFAULT_OAUTH_P12_PASSWORD_VALUE;
11061108
}
11071109

11081110
public void setOAuthP12Password(String oAuthP12Password) {

0 commit comments

Comments
 (0)