Skip to content

Commit d4d14cd

Browse files
committed
fix fmt
1 parent ebd14da commit d4d14cd

File tree

2 files changed

+33
-37
lines changed

2 files changed

+33
-37
lines changed

databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public TokenSource getTokenSource() {
239239
return (TokenSource) headerFactory;
240240
}
241241
return new ErrorTokenSource(
242-
String.format("OAuth Token not supported for current auth type %s", authType));
242+
String.format("OAuth Token not supported for current auth type %s", authType));
243243
}
244244

245245
public CredentialsProvider getCredentialsProvider() {
@@ -431,17 +431,13 @@ public DatabricksConfig setAzureUseMsi(boolean azureUseMsi) {
431431
return this;
432432
}
433433

434-
/**
435-
* @deprecated Use {@link #getAzureUseMsi()} instead.
436-
*/
434+
/** @deprecated Use {@link #getAzureUseMsi()} instead. */
437435
@Deprecated()
438436
public boolean getAzureUseMSI() {
439437
return azureUseMsi;
440438
}
441439

442-
/**
443-
* @deprecated Use {@link #getAzureUseMsi()} instead.
444-
*/
440+
/** @deprecated Use {@link #getAzureUseMsi()} instead. */
445441
@Deprecated
446442
public DatabricksConfig setAzureUseMSI(boolean azureUseMsi) {
447443
this.azureUseMsi = azureUseMsi;
@@ -688,10 +684,10 @@ private OpenIDConnectEndpoints fetchDefaultOidcEndpoints() throws IOException {
688684
}
689685

690686
ApiClient apiClient =
691-
new ApiClient.Builder()
692-
.withHttpClient(getHttpClient())
693-
.withGetHostFunc(v -> getHost())
694-
.build();
687+
new ApiClient.Builder()
688+
.withHttpClient(getHttpClient())
689+
.withGetHostFunc(v -> getHost())
690+
.build();
695691
try {
696692
return apiClient.execute(
697693
new Request("GET", "/oidc/.well-known/oauth-authorization-server"),
@@ -761,18 +757,18 @@ public DatabricksConfig clone() {
761757

762758
public DatabricksConfig newWithWorkspaceHost(String host) {
763759
Set<String> fieldsToSkip =
764-
new HashSet<>(
765-
Arrays.asList(
766-
// The config for WorkspaceClient has a different host and Azure Workspace resource
767-
// ID, and also omits
768-
// the account ID.
769-
"host",
770-
"accountId",
771-
"azureWorkspaceResourceId",
772-
// For cloud-native OAuth, we need to reauthenticate as the audience has changed, so
773-
// don't cache the
774-
// header factory.
775-
"headerFactory"));
760+
new HashSet<>(
761+
Arrays.asList(
762+
// The config for WorkspaceClient has a different host and Azure Workspace resource
763+
// ID, and also omits
764+
// the account ID.
765+
"host",
766+
"accountId",
767+
"azureWorkspaceResourceId",
768+
// For cloud-native OAuth, we need to reauthenticate as the audience has changed, so
769+
// don't cache the
770+
// header factory.
771+
"headerFactory"));
776772
return clone(fieldsToSkip).setHost(host);
777773
}
778774

databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/OAuthClient.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private OAuthClient(Builder b) throws IOException {
119119
this.hc = b.hc;
120120

121121
DatabricksConfig config =
122-
new DatabricksConfig().setHost(b.host).setAccountId(b.accountId).resolve();
122+
new DatabricksConfig().setHost(b.host).setAccountId(b.accountId).resolve();
123123
openIDConnectEndpoints = b.openIDConnectEndpoints;
124124
if (openIDConnectEndpoints == null) {
125125
throw new DatabricksException(b.host + " does not support OAuth");
@@ -190,9 +190,9 @@ private static byte[] sha256(byte[] input) {
190190

191191
private static String urlEncode(String urlBase, Map<String, String> params) {
192192
String queryParams =
193-
params.entrySet().stream()
194-
.map(entry -> entry.getKey() + "=" + entry.getValue())
195-
.collect(Collectors.joining("&"));
193+
params.entrySet().stream()
194+
.map(entry -> entry.getKey() + "=" + entry.getValue())
195+
.collect(Collectors.joining("&"));
196196
return urlBase + "?" + queryParams.replaceAll(" ", "%20");
197197
}
198198

@@ -214,15 +214,15 @@ public Consent initiateConsent() throws MalformedURLException {
214214
String url = urlEncode(authUrl, params);
215215

216216
return new Consent.Builder()
217-
.withClientId(clientId)
218-
.withClientSecret(clientSecret)
219-
.withAuthUrl(url)
220-
.withTokenUrl(tokenUrl)
221-
.withRedirectUrl(redirectUrl)
222-
.withState(state)
223-
.withVerifier(verifier)
224-
.withHttpClient(hc)
225-
.withBrowserTimeout(browserTimeout)
226-
.build();
217+
.withClientId(clientId)
218+
.withClientSecret(clientSecret)
219+
.withAuthUrl(url)
220+
.withTokenUrl(tokenUrl)
221+
.withRedirectUrl(redirectUrl)
222+
.withState(state)
223+
.withVerifier(verifier)
224+
.withHttpClient(hc)
225+
.withBrowserTimeout(browserTimeout)
226+
.build();
227227
}
228228
}

0 commit comments

Comments
 (0)