Skip to content

Commit 3433f48

Browse files
committed
Spotless apply
1 parent 0def203 commit 3433f48

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

dd-java-agent/instrumentation/kafka-clients-0.11/src/test/groovy/KafkaClientTestBase.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase {
296296
"kafka_cluster_id:$clusterId",
297297
"topic:$SHARED_TOPIC".toString(),
298298
"type:kafka"
299-
)
299+
)
300300
}
301301
List<String> produce = [
302302
"kafka_cluster_id:$clusterId",
@@ -436,7 +436,7 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase {
436436
"kafka_cluster_id:$clusterId".toString(),
437437
"topic:$SHARED_TOPIC".toString(),
438438
"type:kafka"
439-
)
439+
)
440440
}
441441

442442
StatsGroup second = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == first.hash }
@@ -447,7 +447,7 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase {
447447
"kafka_cluster_id:$clusterId".toString(),
448448
"topic:$SHARED_TOPIC".toString(),
449449
"type:kafka"
450-
)
450+
)
451451
}
452452
List<String> produce = [
453453
"kafka_cluster_id:$clusterId".toString(),

internal-api/src/main/java/datadog/trace/api/datastreams/DataStreamsTags.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -143,52 +143,52 @@ public static DataStreamsTags fromTags(String[] tags) {
143143
String partition = null;
144144

145145
for (String tag : tags) {
146-
String[] splitResult = tag.split(":");
147-
if (splitResult.length != 2) {
146+
if (tag.indexOf(':') == -1) {
148147
continue;
149148
}
150-
switch (splitResult[0]) {
149+
String key = tag.substring(0, tag.indexOf(':'));
150+
String value = tag.substring(tag.indexOf(':') + 1);
151+
switch (key) {
151152
case BUS_TAG:
152-
bus = splitResult[1];
153+
bus = value;
153154
break;
154155
case DIRECTION_TAG:
155-
direction =
156-
Objects.equals(splitResult[1], "out") ? Direction.Outbound : Direction.Inbound;
156+
direction = Objects.equals(value, "out") ? Direction.Outbound : Direction.Inbound;
157157
break;
158158
case EXCHANGE_TAG:
159-
exchange = splitResult[1];
159+
exchange = value;
160160
break;
161161
case TOPIC_TAG:
162-
topic = splitResult[1];
162+
topic = value;
163163
break;
164164
case TYPE_TAG:
165-
type = splitResult[1];
165+
type = value;
166166
break;
167167
case SUBSCRIPTION_TAG:
168-
subscription = splitResult[1];
168+
subscription = value;
169169
break;
170170
case DATASET_NAME_TAG:
171-
datasetName = splitResult[1];
171+
datasetName = value;
172172
break;
173173
case DATASET_NAMESPACE_TAG:
174-
datasetNamespace = splitResult[1];
174+
datasetNamespace = value;
175175
break;
176176
case MANUAL_TAG:
177-
isManual = Objects.equals(splitResult[1], "true");
177+
isManual = Objects.equals(value, "true");
178178
case GROUP_TAG:
179-
group = splitResult[1];
179+
group = value;
180180
break;
181181
case CONSUMER_GROUP_TAG:
182-
consumerGroup = splitResult[1];
182+
consumerGroup = value;
183183
break;
184184
case HAS_ROUTING_KEY_TAG:
185-
hasRoutingKey = Objects.equals(splitResult[1], "true");
185+
hasRoutingKey = Objects.equals(value, "true");
186186
break;
187187
case KAFKA_CLUSTER_ID_TAG:
188-
kafkaClusterId = splitResult[1];
188+
kafkaClusterId = value;
189189
break;
190190
case PARTITION_TAG:
191-
partition = splitResult[1];
191+
partition = value;
192192
break;
193193
}
194194
}

0 commit comments

Comments
 (0)