Skip to content

Commit fff95e0

Browse files
fix(deps): update errorproneversion to v2.47.0 (#8051)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jack Berg <johnmberg8@gmail.com>
1 parent 73d0833 commit fff95e0

File tree

8 files changed

+17
-6
lines changed

8 files changed

+17
-6
lines changed

api/all/src/test/java/io/opentelemetry/api/baggage/propagation/PercentEscaperFuzzTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import edu.berkeley.cs.jqf.fuzz.random.NoGuidance;
1414
import io.opentelemetry.api.internal.PercentEscaper;
1515
import java.net.URLDecoder;
16+
import java.nio.charset.StandardCharsets;
1617
import org.junit.jupiter.api.Test;
1718
import org.junit.runner.Result;
1819
import org.junit.runner.RunWith;
@@ -22,10 +23,11 @@ class PercentEscaperFuzzTest {
2223
public static class TestCases {
2324
private final PercentEscaper percentEscaper = new PercentEscaper();
2425

26+
@SuppressWarnings("JdkObsolete") // Recommended alternative was introduced in java 10
2527
@Fuzz
2628
public void roundTripWithUrlDecoder(String value) throws Exception {
2729
String escaped = percentEscaper.escape(value);
28-
String decoded = URLDecoder.decode(escaped, "UTF-8");
30+
String decoded = URLDecoder.decode(escaped, StandardCharsets.UTF_8.name());
2931
assertThat(decoded).isEqualTo(value);
3032
}
3133
}

dependencyManagement/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ rootProject.extra["versions"] = dependencyVersions
99

1010

1111
val autoValueVersion = "1.11.1"
12-
val errorProneVersion = "2.46.0"
12+
val errorProneVersion = "2.47.0"
1313
val jmhVersion = "1.37"
1414
// Mockito 5.x.x requires Java 11 https://github.com/mockito/mockito/releases/tag/v5.0.0
1515
val mockitoVersion = "4.11.0"

exporters/logging-otlp/src/test/java/io/opentelemetry/exporter/logging/otlp/AbstractOtlpStdoutExporterTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ protected abstract T createExporter(
8383

8484
protected abstract T createDefaultExporter();
8585

86+
@SuppressWarnings("JdkObsolete") // Recommended alternative was introduced in java 10
8687
private String output(@Nullable OutputStream outputStream, @Nullable Path file) {
8788
if (outputStream == null) {
8889
return logs.getEvents().stream()

exporters/otlp/all/src/main/java/io/opentelemetry/exporter/otlp/internal/OtlpConfigUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ public static void configureOtlpExporterBuilder(
150150
ExporterBuilderUtil.configureExporterMemoryMode(config, setMemoryMode);
151151
}
152152

153+
@SuppressWarnings("JdkObsolete") // Recommended alternative was introduced in java 10
153154
static void configureOtlpHeaders(
154155
ConfigProperties config, String dataType, BiConsumer<String, String> addHeader) {
155156
Map<String, String> headers = config.getMap("otel.exporter.otlp." + dataType + ".headers");
@@ -162,7 +163,7 @@ static void configureOtlpHeaders(
162163
try {
163164
// headers are encoded as URL - see
164165
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#specifying-headers-via-environment-variables
165-
addHeader.accept(key, URLDecoder.decode(value, StandardCharsets.UTF_8.displayName()));
166+
addHeader.accept(key, URLDecoder.decode(value, StandardCharsets.UTF_8.name()));
166167
} catch (Exception e) {
167168
throw new ConfigurationException("Cannot decode header value: " + value, e);
168169
}

exporters/prometheus/src/test/java/io/opentelemetry/exporter/prometheus/PrometheusMetricReaderTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,7 @@ private static String toPattern(String expected) {
11341134
return regexBuilder.toString();
11351135
}
11361136

1137+
@SuppressWarnings("JdkObsolete") // Recommended alternative was introduced in java 10
11371138
private static String toOpenMetrics(MetricSnapshots snapshots) throws IOException {
11381139
ByteArrayOutputStream out = new ByteArrayOutputStream();
11391140
OpenMetricsTextFormatWriter writer = new OpenMetricsTextFormatWriter(true, true);

extensions/trace-propagators/src/main/java/io/opentelemetry/extension/trace/propagation/JaegerPropagator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import io.opentelemetry.context.propagation.TextMapSetter;
2323
import java.io.UnsupportedEncodingException;
2424
import java.net.URLDecoder;
25+
import java.nio.charset.StandardCharsets;
2526
import java.util.Collection;
2627
import java.util.Collections;
2728
import java.util.logging.Level;
@@ -156,6 +157,7 @@ public String toString() {
156157
return "JaegerPropagator";
157158
}
158159

160+
@SuppressWarnings("JdkObsolete") // Recommended alternative was introduced in java 10
159161
private static <C> SpanContext getSpanContextFromHeader(
160162
@Nullable C carrier, TextMapGetter<C> getter) {
161163
String value = getter.get(carrier, PROPAGATION_HEADER);
@@ -168,7 +170,7 @@ private static <C> SpanContext getSpanContextFromHeader(
168170
if (value.lastIndexOf(PROPAGATION_HEADER_DELIMITER) == -1) {
169171
try {
170172
// the propagation value
171-
value = URLDecoder.decode(value, "UTF-8");
173+
value = URLDecoder.decode(value, StandardCharsets.UTF_8.name());
172174
} catch (UnsupportedEncodingException e) {
173175
logger.fine(
174176
"Error decoding '"

extensions/trace-propagators/src/test/java/io/opentelemetry/extension/trace/propagation/JaegerPropagatorTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import io.opentelemetry.context.propagation.TextMapSetter;
2525
import java.io.UnsupportedEncodingException;
2626
import java.net.URLEncoder;
27+
import java.nio.charset.StandardCharsets;
2728
import java.util.Collections;
2829
import java.util.LinkedHashMap;
2930
import java.util.Map;
@@ -357,13 +358,15 @@ void extract_SampledContext_Short_TraceId() {
357358
}
358359

359360
@Test
361+
@SuppressWarnings("JdkObsolete") // Recommended alternative was introduced in java 10
360362
void extract_UrlEncodedContext() throws UnsupportedEncodingException {
361363
Map<String, String> carrier = new LinkedHashMap<>();
362364
JaegerSpanContext context =
363365
new JaegerSpanContext(
364366
TRACE_ID_HI, TRACE_ID_LOW, SPAN_ID_LONG, DEPRECATED_PARENT_SPAN_LONG, (byte) 5);
365367
carrier.put(
366-
PROPAGATION_HEADER, URLEncoder.encode(TextMapCodec.contextAsString(context), "UTF-8"));
368+
PROPAGATION_HEADER,
369+
URLEncoder.encode(TextMapCodec.contextAsString(context), StandardCharsets.UTF_8.name()));
367370

368371
assertThat(getSpanContext(jaegerPropagator.extract(Context.current(), carrier, getter)))
369372
.isEqualTo(

sdk-extensions/autoconfigure/src/main/java/io/opentelemetry/sdk/autoconfigure/ResourceConfiguration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public static Resource createEnvironmentResource() {
6565
* @param config the {@link ConfigProperties} used to obtain resource properties
6666
* @return the resource.
6767
*/
68+
@SuppressWarnings("JdkObsolete") // Recommended alternative was introduced in java 10
6869
public static Resource createEnvironmentResource(ConfigProperties config) {
6970
AttributesBuilder resourceAttributes = Attributes.builder();
7071
try {
@@ -74,7 +75,7 @@ public static Resource createEnvironmentResource(ConfigProperties config) {
7475
// Attributes specified via otel.resource.attributes follow the W3C Baggage spec and
7576
// characters outside the baggage-octet range are percent encoded
7677
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#specifying-resource-information-via-an-environment-variable
77-
URLDecoder.decode(entry.getValue(), StandardCharsets.UTF_8.displayName()));
78+
URLDecoder.decode(entry.getValue(), StandardCharsets.UTF_8.name()));
7879
}
7980
} catch (UnsupportedEncodingException e) {
8081
// Should not happen since always using standard charset

0 commit comments

Comments
 (0)