|
1 | 1 | package datadog.trace.api; |
2 | 2 |
|
| 3 | +import lombok.Getter; |
| 4 | +import lombok.ToString; |
| 5 | +import lombok.extern.slf4j.Slf4j; |
| 6 | + |
3 | 7 | import java.io.BufferedReader; |
4 | 8 | import java.io.File; |
5 | 9 | import java.io.FileNotFoundException; |
|
20 | 24 | import java.util.SortedSet; |
21 | 25 | import java.util.UUID; |
22 | 26 | import java.util.regex.Pattern; |
23 | | -import lombok.Getter; |
24 | | -import lombok.ToString; |
25 | | -import lombok.extern.slf4j.Slf4j; |
26 | 27 |
|
27 | 28 | /** |
28 | 29 | * Config reads values with the following priority: 1) system properties, 2) environment variables, |
@@ -463,9 +464,9 @@ public Map<String, String> getMergedJmxTags() { |
463 | 464 | * Returns the sample rate for the specified instrumentation or {@link |
464 | 465 | * #DEFAULT_ANALYTICS_SAMPLE_RATE} if none specified. |
465 | 466 | */ |
466 | | - public float getInstrumentationAnalyticsSampleRate(String... aliases) { |
| 467 | + public float getInstrumentationAnalyticsSampleRate(final String... aliases) { |
467 | 468 | for (final String alias : aliases) { |
468 | | - Float rate = getFloatSettingFromEnvironment(alias + ".analytics.sample-rate", null); |
| 469 | + final Float rate = getFloatSettingFromEnvironment(alias + ".analytics.sample-rate", null); |
469 | 470 | if (null != rate) { |
470 | 471 | return rate; |
471 | 472 | } |
@@ -724,7 +725,7 @@ private static String propertyNameToEnvironmentVariableName(final String setting |
724 | 725 | * @param setting The setting name, e.g. `service.name` |
725 | 726 | * @return The public facing system property name |
726 | 727 | */ |
727 | | - private static String propertyNameToSystemPropertyName(String setting) { |
| 728 | + private static String propertyNameToSystemPropertyName(final String setting) { |
728 | 729 | return PREFIX + setting; |
729 | 730 | } |
730 | 731 |
|
@@ -905,18 +906,18 @@ private static Properties loadConfigurationFile() { |
905 | 906 | configurationFilePath.replaceFirst("^~", System.getProperty("user.home")); |
906 | 907 |
|
907 | 908 | // Configuration properties file is optional |
908 | | - File configurationFile = new File(configurationFilePath); |
| 909 | + final File configurationFile = new File(configurationFilePath); |
909 | 910 | if (!configurationFile.exists()) { |
910 | 911 | log.error("Configuration file '{}' not found.", configurationFilePath); |
911 | 912 | return properties; |
912 | 913 | } |
913 | 914 |
|
914 | 915 | try { |
915 | | - FileReader fileReader = new FileReader(configurationFile); |
| 916 | + final FileReader fileReader = new FileReader(configurationFile); |
916 | 917 | properties.load(fileReader); |
917 | | - } catch (FileNotFoundException fnf) { |
| 918 | + } catch (final FileNotFoundException fnf) { |
918 | 919 | log.error("Configuration file '{}' not found.", configurationFilePath); |
919 | | - } catch (IOException ioe) { |
| 920 | + } catch (final IOException ioe) { |
920 | 921 | log.error( |
921 | 922 | "Configuration file '{}' cannot be accessed or correctly parsed.", configurationFilePath); |
922 | 923 | } |
|
0 commit comments