Skip to content

Commit 780aee3

Browse files
committed
rearrange logic in selectors creation for better readability
1 parent f93546a commit 780aee3

File tree

1 file changed

+7
-7
lines changed
  • internal-api/src/main/java/datadog/trace/bootstrap/config/provider/stableconfig

1 file changed

+7
-7
lines changed

internal-api/src/main/java/datadog/trace/bootstrap/config/provider/stableconfig/Rule.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ public static Rule from(Map<?, ?> map) {
4747
.filter(Objects::nonNull)
4848
.map(
4949
s -> {
50-
if (!(s instanceof Map)) {
51-
throw new StableConfigMappingException(
52-
"Each selector must be a map, but got: "
53-
+ s.getClass().getSimpleName()
54-
+ ", value: "
55-
+ StableConfigMappingException.safeToString(s));
50+
if (s instanceof Map) {
51+
return Selector.from((Map<?, ?>) s);
5652
}
57-
return Selector.from((Map<?, ?>) s);
53+
throw new StableConfigMappingException(
54+
"Each selector must be a map, but got: "
55+
+ s.getClass().getSimpleName()
56+
+ ", value: "
57+
+ StableConfigMappingException.safeToString(s));
5858
})
5959
.collect(toList()));
6060

0 commit comments

Comments
 (0)