Skip to content

Commit b2ed955

Browse files
committed
address some comments
1 parent 30e93a3 commit b2ed955

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void setValueOnConfig(DatabricksConfig cfg, String value) throws IllegalA
6969
field.set(cfg, ProxyConfig.ProxyAuthType.valueOf(value));
7070
} else if (List.class.isAssignableFrom(field.getType())) {
7171
// Handle List<String> fields (e.g., scopes)
72-
// Parse comma and/or whitespace separated values from environment variable or config file
72+
// Parse comma and/or whitespace separated values from environment variable or config file.
7373
if (field.getGenericType() instanceof ParameterizedType) {
7474
ParameterizedType paramType = (ParameterizedType) field.getGenericType();
7575
if (paramType.getActualTypeArguments().length > 0
@@ -111,7 +111,10 @@ public String toString() {
111111

112112
public String getAsString(Object value) {
113113
if (value instanceof List) {
114-
return String.join(" ", (List<String>) value);
114+
List<?> list = (List<?>) value;
115+
return list.stream()
116+
.map(Object::toString)
117+
.collect(Collectors.joining(", ", "[", "]"));
115118
}
116119
return value.toString();
117120
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private synchronized DatabricksConfig innerResolve() {
213213
}
214214
}
215215

216-
/** Sort scopes in-place for better de-duplication in the refresh token cache. */
216+
// Sort scopes in-place for better de-duplication in the refresh token cache.
217217
private void sortScopes() {
218218
if (scopes != null && !scopes.isEmpty()) {
219219
java.util.Collections.sort(scopes);

databricks-sdk-java/src/test/java/com/databricks/sdk/core/DatabricksConfigTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,6 @@ public void testDisableOauthRefreshTokenEnvironmentVariable() {
329329
}
330330

331331
// Config File Scope Parsing Tests
332-
333332
private static Stream<Arguments> provideConfigFileScopesTestCases() {
334333
return Stream.of(
335334
Arguments.of("Empty scopes defaults to all-apis", "scope-empty", Arrays.asList("all-apis")),
@@ -357,9 +356,6 @@ public void testConfigFileScopes(String testName, String profile, List<String> e
357356
config.resolve(new Environment(env, new ArrayList<>(), System.getProperty("os.name")));
358357

359358
List<String> scopes = config.getScopes();
360-
assertEquals(expectedScopes.size(), scopes.size());
361-
for (int i = 0; i < expectedScopes.size(); i++) {
362-
assertEquals(expectedScopes.get(i), scopes.get(i));
363-
}
359+
assertIterableEquals(expectedScopes, scopes);
364360
}
365361
}

0 commit comments

Comments
 (0)