Skip to content

Commit e918ca3

Browse files
committed
Remove redundant null check in initValidationScheme
Signed-off-by: Federico Torres <[email protected]>
1 parent 65bfb6b commit e918ca3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

prometheus-metrics-model/src/main/java/io/prometheus/metrics/model/snapshots/PrometheusNaming.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,11 @@ public class PrometheusNaming {
7878
};
7979

8080
static ValidationScheme initValidationScheme() {
81-
if (PrometheusProperties.get() != null && PrometheusProperties.get().getNamingProperties() != null) {
82-
String validationScheme = PrometheusProperties.get().getNamingProperties().getValidationScheme();
83-
if (validationScheme != null && validationScheme.equals("utf-8")) {
84-
return ValidationScheme.UTF_8_VALIDATION;
85-
}
81+
String validationScheme = PrometheusProperties.get().getNamingProperties().getValidationScheme();
82+
if (validationScheme != null && validationScheme.equals("utf-8")) {
83+
return ValidationScheme.UTF_8_VALIDATION;
8684
}
85+
8786
return ValidationScheme.LEGACY_VALIDATION;
8887
}
8988

0 commit comments

Comments
 (0)