Skip to content

Commit 25b6872

Browse files
committed
pr feedback
1 parent 5ff4607 commit 25b6872

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

client/src/main/java/io/split/client/SplitClientImpl.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
public final class SplitClientImpl implements SplitClient {
3737
public static final SplitResult SPLIT_RESULT_CONTROL = new SplitResult(Treatments.CONTROL, null);
3838

39-
private static final String METRIC_GET_TREATMENT = "sdk.getTreatment";
40-
private static final String METRIC_GET_TREATMENT_WITH_CONFIG = "sdk.getTreatmentWithConfig";
39+
private static final String GET_TREATMENT = "getTreatment";
40+
private static final String GET_TREATMENT_WITH_CONFIG = "getTreatmentWithConfig";
4141

4242
private static final Logger _log = LoggerFactory.getLogger(SplitClientImpl.class);
4343

@@ -75,27 +75,27 @@ public String getTreatment(String key, String split) {
7575

7676
@Override
7777
public String getTreatment(String key, String split, Map<String, Object> attributes) {
78-
return getTreatmentWithConfigInternal(METRIC_GET_TREATMENT, key, null, split, attributes, "getTreatment").treatment();
78+
return getTreatmentWithConfigInternal(GET_TREATMENT, key, null, split, attributes).treatment();
7979
}
8080

8181
@Override
8282
public String getTreatment(Key key, String split, Map<String, Object> attributes) {
83-
return getTreatmentWithConfigInternal(METRIC_GET_TREATMENT, key.matchingKey(), key.bucketingKey(), split, attributes, "getTreatment").treatment();
83+
return getTreatmentWithConfigInternal(GET_TREATMENT, key.matchingKey(), key.bucketingKey(), split, attributes).treatment();
8484
}
8585

8686
@Override
8787
public SplitResult getTreatmentWithConfig(String key, String split) {
88-
return getTreatmentWithConfigInternal(METRIC_GET_TREATMENT_WITH_CONFIG, key, null, split, Collections.<String, Object>emptyMap(), "getTreatmentWithConfig");
88+
return getTreatmentWithConfigInternal(GET_TREATMENT_WITH_CONFIG, key, null, split, Collections.<String, Object>emptyMap());
8989
}
9090

9191
@Override
9292
public SplitResult getTreatmentWithConfig(String key, String split, Map<String, Object> attributes) {
93-
return getTreatmentWithConfigInternal(METRIC_GET_TREATMENT_WITH_CONFIG, key, null, split, attributes, "getTreatmentWithConfig");
93+
return getTreatmentWithConfigInternal(GET_TREATMENT_WITH_CONFIG, key, null, split, attributes);
9494
}
9595

9696
@Override
9797
public SplitResult getTreatmentWithConfig(Key key, String split, Map<String, Object> attributes) {
98-
return getTreatmentWithConfigInternal(METRIC_GET_TREATMENT_WITH_CONFIG, key.matchingKey(), key.bucketingKey(), split, attributes, "getTreatmentWithConfig");
98+
return getTreatmentWithConfigInternal(GET_TREATMENT_WITH_CONFIG, key.matchingKey(), key.bucketingKey(), split, attributes);
9999
}
100100

101101
@Override
@@ -178,7 +178,7 @@ private boolean track(Event event) {
178178
return _eventClient.track(event, propertiesResult.getEventSize());
179179
}
180180

181-
private SplitResult getTreatmentWithConfigInternal(String label, String matchingKey, String bucketingKey, String split, Map<String, Object> attributes, String method) {
181+
private SplitResult getTreatmentWithConfigInternal(String method, String matchingKey, String bucketingKey, String split, Map<String, Object> attributes) {
182182
try {
183183
if (_container.isDestroyed()) {
184184
_log.error("Client has already been destroyed - no calls possible");
@@ -215,7 +215,7 @@ private SplitResult getTreatmentWithConfigInternal(String label, String matching
215215
split,
216216
start,
217217
result.treatment,
218-
label,
218+
String.format("sdk.%s", method),
219219
_config.labelsEnabled() ? result.label : null,
220220
result.changeNumber,
221221
attributes

client/src/main/java/io/split/inputValidation/SplitNameValidator.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ public class SplitNameValidator {
1111
public static Optional<String> isValid(String name, String method) {
1212
if (name == null) {
1313
_log.error(String.format("%s: you passed a null split name, split name must be a non-empty string", method));
14-
//return new InputValidationResult(false);
1514
return Optional.empty();
1615
}
1716

1817
if (name.isEmpty()) {
1918
_log.error(String.format("%s: you passed an empty split name, split name must be a non-empty string", method));
20-
//return new InputValidationResult(false);
2119
return Optional.empty();
2220
}
2321

@@ -27,7 +25,6 @@ public static Optional<String> isValid(String name, String method) {
2725
name = trimmed;
2826
}
2927

30-
//return new InputValidationResult(true, name);
3128
return Optional.of(name);
3229
}
3330
}

0 commit comments

Comments
 (0)