Skip to content

Commit a650ee4

Browse files
committed
Formatting fix after recent TypeSafe config changes.
Also fixed a logic bug in previous commit re: IdentifierIndex
1 parent 97d9c4c commit a650ee4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

core/src/main/java/com/datastax/oss/driver/internal/core/config/typesafe/TypesafeDriverConfig.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.datastax.oss.driver.api.core.config.DriverExecutionProfile;
2222
import com.datastax.oss.driver.api.core.config.DriverOption;
2323
import com.datastax.oss.driver.internal.core.util.Loggers;
24-
import com.datastax.oss.driver.shaded.guava.common.base.Preconditions;
2524
import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
2625
import com.typesafe.config.Config;
2726
import com.typesafe.config.ConfigObject;
@@ -152,7 +151,10 @@ public DriverExecutionProfile getProfile(@NonNull String profileName) {
152151
return defaultProfile;
153152
}
154153
return Optional.ofNullable(profiles.get(profileName))
155-
.orElseThrow(() -> new IllegalArgumentException(String.format("Unknown profile '%s'. Check your configuration.", profileName)));
154+
.orElseThrow(
155+
() ->
156+
new IllegalArgumentException(
157+
String.format("Unknown profile '%s'. Check your configuration.", profileName)));
156158
}
157159

158160
@NonNull

core/src/main/java/com/datastax/oss/driver/internal/core/data/IdentifierIndex.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public List<Integer> allIndicesOf(String name) {
7676
*/
7777
public int firstIndexOf(String name) {
7878
Iterator<Integer> indices = allIndicesOf(name).iterator();
79-
return indices.hasNext() ? -1 : indices.next();
79+
return indices.hasNext() ? indices.next() : -1;
8080
}
8181

8282
/** Returns all occurrences of a given identifier. */
@@ -87,6 +87,6 @@ public List<Integer> allIndicesOf(CqlIdentifier id) {
8787
/** Returns the first occurrence of a given identifier, or -1 if it's not in the list. */
8888
public int firstIndexOf(CqlIdentifier id) {
8989
Iterator<Integer> indices = allIndicesOf(id).iterator();
90-
return indices.hasNext() ? -1 : indices.next();
90+
return indices.hasNext() ? indices.next() : -1;
9191
}
9292
}

0 commit comments

Comments
 (0)