Skip to content

Commit

Permalink
Bump errorProneVersion from 2.18.0 to 2.19.0 (#5435)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jack Berg <jberg@newrelic.com>
  • Loading branch information
dependabot[bot] and jack-berg authored May 12, 2023
1 parent d67faf2 commit d45dce3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ val DEPENDENCY_BOMS = listOf(
)

val autoValueVersion = "1.10.1"
val errorProneVersion = "2.18.0"
val errorProneVersion = "2.19.0"
val jmhVersion = "1.36"
// Mockito 5.x.x requires Java 11 https://github.com/mockito/mockito/releases/tag/v5.0.0
val mockitoVersion = "4.11.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.io.IOException;
import java.net.SocketTimeoutException;
import java.util.Locale;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
Expand Down Expand Up @@ -104,7 +105,7 @@ static boolean isRetryableException(IOException e) {
String message = e.getMessage();
// Connect timeouts can produce SocketTimeoutExceptions with no message, or with "connect timed
// out"
return message == null || message.toLowerCase().contains("connect timed out");
return message == null || message.toLowerCase(Locale.ROOT).contains("connect timed out");
}

// Visible for testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;
import java.util.Locale;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
Expand Down Expand Up @@ -154,7 +155,7 @@ public static void configureOtlpAggregationTemporality(
}
AggregationTemporality temporality;
try {
temporality = AggregationTemporality.valueOf(temporalityStr.toUpperCase());
temporality = AggregationTemporality.valueOf(temporalityStr.toUpperCase(Locale.ROOT));
} catch (IllegalArgumentException e) {
throw new ConfigurationException(
"Unrecognized aggregation temporality: " + temporalityStr, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import io.opentracing.propagation.Format.Builtin;
import io.opentracing.propagation.TextMapInjectAdapter;
import io.opentracing.tag.Tags;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;

Expand Down Expand Up @@ -38,7 +39,7 @@ public void send(boolean convertKeysToUpperCase) throws InterruptedException {
if (convertKeysToUpperCase) {
Message newMessage = new Message();
for (Map.Entry<String, String> entry : message.entrySet()) {
newMessage.put(entry.getKey().toUpperCase(), entry.getValue());
newMessage.put(entry.getKey().toUpperCase(Locale.getDefault()), entry.getValue());
}
message = newMessage;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import io.opentelemetry.sdk.metrics.Aggregation;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

/**
Expand Down Expand Up @@ -59,7 +60,7 @@ private AggregationUtil() {}
* @throws IllegalArgumentException if the name is not recognized
*/
public static Aggregation forName(String name) {
Aggregation aggregation = aggregationByName.get(name.toLowerCase());
Aggregation aggregation = aggregationByName.get(name.toLowerCase(Locale.ROOT));
if (aggregation == null) {
throw new IllegalArgumentException("Unrecognized aggregation name " + name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.opentelemetry.internal.testing.slf4j.SuppressLogger;
import io.opentelemetry.sdk.metrics.internal.state.MetricStorageRegistry;
import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader;
import java.util.Locale;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

Expand Down Expand Up @@ -175,7 +176,7 @@ void testLongCounter_upperCaseConflict() {
.setUnit("metric tonnes")
.build();
assertThat(longCounter).isNotNull();
sdkMeter.counterBuilder("testLongCounter".toUpperCase()).build();
sdkMeter.counterBuilder("testLongCounter".toUpperCase(Locale.getDefault())).build();
metricStorageLogs.assertContains("Found duplicate metric definition");
}

Expand Down Expand Up @@ -213,7 +214,7 @@ void testLongUpDownCounter_upperCaseConflict() {
.build();
assertThat(longUpDownCounter).isNotNull();
assertThat(metricStorageLogs.getEvents()).isEmpty();
sdkMeter.upDownCounterBuilder("testLongUpDownCounter".toUpperCase()).build();
sdkMeter.upDownCounterBuilder("testLongUpDownCounter".toUpperCase(Locale.getDefault())).build();
metricStorageLogs.assertContains("Found duplicate metric definition");
}

Expand Down Expand Up @@ -255,7 +256,10 @@ void testLongHistogram_upperCaseConflict() {
assertThat(longHistogram).isNotNull();
assertThat(metricStorageLogs.getEvents()).isEmpty();

sdkMeter.histogramBuilder("testLongValueRecorder".toUpperCase()).ofLongs().build();
sdkMeter
.histogramBuilder("testLongValueRecorder".toUpperCase(Locale.getDefault()))
.ofLongs()
.build();
metricStorageLogs.assertContains("Found duplicate metric definition");
}

Expand Down Expand Up @@ -283,7 +287,10 @@ void testLongGauge_upperCaseConflicts() {
.buildWithCallback(obs -> {});
assertThat(metricStorageLogs.getEvents()).isEmpty();

sdkMeter.gaugeBuilder("longValueObserver".toUpperCase()).ofLongs().buildWithCallback(x -> {});
sdkMeter
.gaugeBuilder("longValueObserver".toUpperCase(Locale.getDefault()))
.ofLongs()
.buildWithCallback(x -> {});
metricStorageLogs.assertContains("Found duplicate metric definition");
}

Expand All @@ -309,7 +316,9 @@ void testLongSumObserver_upperCaseConflicts() {
.buildWithCallback(x -> {});
assertThat(metricStorageLogs.getEvents()).isEmpty();

sdkMeter.counterBuilder("testLongSumObserver".toUpperCase()).buildWithCallback(x -> {});
sdkMeter
.counterBuilder("testLongSumObserver".toUpperCase(Locale.getDefault()))
.buildWithCallback(x -> {});
metricStorageLogs.assertContains("Found duplicate metric definition");
}

Expand All @@ -336,7 +345,7 @@ void testLongUpDownSumObserver_upperCaseConflicts() {
assertThat(metricStorageLogs.getEvents()).isEmpty();

sdkMeter
.upDownCounterBuilder("testLongUpDownSumObserver".toUpperCase())
.upDownCounterBuilder("testLongUpDownSumObserver".toUpperCase(Locale.getDefault()))
.buildWithCallback(x -> {});
metricStorageLogs.assertContains("Found duplicate metric definition");
}
Expand Down

0 comments on commit d45dce3

Please sign in to comment.