Skip to content

Commit ec46544

Browse files
authored
Polish (#3629)
1 parent fcb0758 commit ec46544

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

implementations/micrometer-registry-dynatrace/src/main/java/io/micrometer/dynatrace/types/DynatraceSummarySnapshotSupport.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
public interface DynatraceSummarySnapshotSupport {
2727

2828
/**
29-
* @deprecated This method might lead to problems with a race condition if values are
30-
* added to the summary after reading the number of values already recorded. Take a
31-
* snapshot and use {@link DynatraceSummarySnapshot#getCount()} instead.
29+
* @deprecated since 1.9.8. This method might lead to problems with a race condition
30+
* if values are added to the summary after reading the number of values already
31+
* recorded. Take a snapshot and use {@link DynatraceSummarySnapshot#getCount()}
32+
* instead.
3233
*/
33-
@Deprecated()
34+
@Deprecated
3435
boolean hasValues();
3536

3637
DynatraceSummarySnapshot takeSummarySnapshot();

implementations/micrometer-registry-dynatrace/src/test/java/io/micrometer/dynatrace/types/DynatraceDistributionSummaryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void testDynatraceDistributionSummary_NegativeValuesAreIgnored() {
7272
ds.record(-1.23);
7373
ds.record(-100.3);
7474

75-
assertMinMaxSumCount(ds, 0., 0., 0., 0);
75+
assertMinMaxSumCount(ds, 0.0, 0.0, 0.0, 0);
7676
}
7777

7878
@Test
@@ -81,7 +81,7 @@ void testDynatraceDistributionSummary_NaNValuesAreIgnored() {
8181

8282
ds.record(Double.NaN);
8383

84-
assertMinMaxSumCount(ds, 0., 0., 0., 0);
84+
assertMinMaxSumCount(ds, 0.0, 0.0, 0.0, 0);
8585
}
8686

8787
@Test

implementations/micrometer-registry-dynatrace/src/test/java/io/micrometer/dynatrace/types/DynatraceTimerTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ void testTimerCount() {
6262

6363
timer.takeSummarySnapshotAndReset(BASE_TIME_UNIT);
6464
assertThat(timer.count()).isZero();
65-
6665
}
6766

6867
@Test
@@ -140,7 +139,7 @@ void testConvertIfNecessary() {
140139
TimeUnit unit = TimeUnit.MILLISECONDS;
141140
DynatraceTimer timer = new DynatraceTimer(ID, CLOCK, DISTRIBUTION_STATISTIC_CONFIG, PAUSE_DETECTOR, unit);
142141

143-
DynatraceSummarySnapshot snapshot = new DynatraceSummarySnapshot(1000., 2000., 3000., 2);
142+
DynatraceSummarySnapshot snapshot = new DynatraceSummarySnapshot(1000.0, 2000.0, 3000.0, 2);
144143
DynatraceSummarySnapshot unconverted = timer.convertIfNecessary(snapshot, unit);
145144
assertThat(unconverted).isEqualTo(snapshot);
146145

implementations/micrometer-registry-dynatrace/src/test/java/io/micrometer/dynatrace/v1/DynatraceExporterV1Test.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,11 @@ void trySendHttpRequestThrows() throws Throwable {
495495
verify(reqBuilder).send();
496496
// assert that an error is logged that does not contain the token.
497497
assertThat(LOGGER.getLogEvents()).hasSize(1).extracting(LogEvent::getMessage)
498-
.containsExactlyInAnyOrder("failed to send metrics to Dynatrace").noneMatch(x -> x.contains(apiToken));
498+
.containsExactly("failed to send metrics to Dynatrace").noneMatch(x -> x.contains(apiToken));
499499
}
500500

501501
private DynatraceExporterV1 getDynatraceExporterV1(HttpSender httpClient, String url, String apiToken) {
502-
DynatraceExporterV1 exporter = FACTORY.injectLogger(() -> new DynatraceExporterV1(new DynatraceConfig() {
502+
return FACTORY.injectLogger(() -> new DynatraceExporterV1(new DynatraceConfig() {
503503
@Override
504504
public String get(String key) {
505505
return null;
@@ -515,7 +515,6 @@ public String uri() {
515515
return url;
516516
}
517517
}, clock, httpClient));
518-
return exporter;
519518
}
520519

521520
private DynatraceExporterV1 createExporter(HttpSender httpClient) {

micrometer-core/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ dependencies {
111111
exclude group: "org.slf4j", module: "jcl-over-slf4j"
112112
}
113113
testImplementation("org.apache.maven.resolver:maven-resolver-connector-basic:latest.release")
114-
testImplementation("org.springframework:spring-core")
115114
}
116115

117116
task shenandoahTest(type: Test) {

micrometer-core/src/main/java/io/micrometer/core/instrument/binder/httpcomponents/MicrometerHttpRequestExecutor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,9 @@ public Builder exportTagsForRoute(boolean exportTagsForRoute) {
196196
}
197197

198198
/**
199-
* @return Creates an instance of {@link MicrometerHttpRequestExecutor} with all
200-
* the configured properties.
199+
* Creates an instance of {@link MicrometerHttpRequestExecutor} with all the
200+
* configured properties.
201+
* @return an instance of {@link MicrometerHttpRequestExecutor}
201202
*/
202203
public MicrometerHttpRequestExecutor build() {
203204
return new MicrometerHttpRequestExecutor(waitForContinue, registry, uriMapper, tags, exportTagsForRoute);

micrometer-core/src/test/java/io/micrometer/core/instrument/composite/CompositeMeterRegistryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void namingConventions() {
150150
void commonTags() {
151151
simple.config().commonTags("instance", "local"); // added alongside other common
152152
// tags in the composite
153-
simple.config().commonTags("region", "us-west-1"); // overriden by the composite
153+
simple.config().commonTags("region", "us-west-1"); // overridden by the composite
154154

155155
composite.config().commonTags("region", "us-east-1");
156156
composite.add(simple);

0 commit comments

Comments
 (0)