diff --git a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsSpanMetricsProcessor.java b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsSpanMetricsProcessor.java index 9a3e60519..69ca18476 100644 --- a/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsSpanMetricsProcessor.java +++ b/aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsSpanMetricsProcessor.java @@ -153,16 +153,16 @@ private static Long getAwsStatusCode(SpanData spanData) { Throwable throwable = exceptionEvent.getException(); try { - Method method = throwable.getClass().getMethod("getStatusCode", new Class[] {}); - Object code = method.invoke(throwable, new Object[] {}); + Method method = throwable.getClass().getMethod("getStatusCode"); + Object code = method.invoke(throwable); return Long.valueOf((Integer) code); } catch (Exception e) { // Take no action } try { - Method method = throwable.getClass().getMethod("statusCode", new Class[] {}); - Object code = method.invoke(throwable, new Object[] {}); + Method method = throwable.getClass().getMethod("statusCode"); + Object code = method.invoke(throwable); return Long.valueOf((Integer) code); } catch (Exception e) { // Take no action diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index e5ffef4bc..d715f94e1 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -27,8 +27,8 @@ dependencies { api("com.google.auto.service:auto-service-annotations:1.1.1") api("com.google.auto.value:auto-value:1.11.0") api("com.google.auto.value:auto-value-annotations:1.11.0") - api("com.google.errorprone:error_prone_annotations:2.41.0") - api("com.google.errorprone:error_prone_core:2.41.0") + api("com.google.errorprone:error_prone_annotations:2.42.0") + api("com.google.errorprone:error_prone_core:2.42.0") api("io.github.netmikey.logunit:logunit-jul:2.0.0") api("io.opentelemetry.proto:opentelemetry-proto:1.8.0-alpha") api("io.prometheus:simpleclient:0.16.0") diff --git a/jmx-metrics/src/test/java/io/opentelemetry/contrib/jmxmetrics/MBeanHelperTest.java b/jmx-metrics/src/test/java/io/opentelemetry/contrib/jmxmetrics/MBeanHelperTest.java index 6a9886fe8..6fb3660c7 100644 --- a/jmx-metrics/src/test/java/io/opentelemetry/contrib/jmxmetrics/MBeanHelperTest.java +++ b/jmx-metrics/src/test/java/io/opentelemetry/contrib/jmxmetrics/MBeanHelperTest.java @@ -141,7 +141,7 @@ void transform() throws Exception { mBeanHelper.fetch(); assertThat(mBeanHelper.getAttribute("SomeAttribute")) - .hasSameElementsAs(Stream.of(new String[] {"otherValue"}).collect(Collectors.toList())); + .hasSameElementsAs(Stream.of("otherValue").collect(Collectors.toList())); } @Test @@ -169,10 +169,9 @@ void transformMultipleAttributes() throws Exception { mBeanHelper.fetch(); assertThat(mBeanHelper.getAttribute("SomeAttribute")) - .hasSameElementsAs(Stream.of(new String[] {"newValue"}).collect(Collectors.toList())); + .hasSameElementsAs(Stream.of("newValue").collect(Collectors.toList())); assertThat(mBeanHelper.getAttribute("AnotherAttribute")) - .hasSameElementsAs( - Stream.of(new String[] {"anotherNewValue"}).collect(Collectors.toList())); + .hasSameElementsAs(Stream.of("anotherNewValue").collect(Collectors.toList())); } @Test @@ -190,7 +189,7 @@ void customAttribute() throws Exception { mBeanHelper.fetch(); assertThat(mBeanHelper.getAttribute("CustomAttribute")) - .hasSameElementsAs(Stream.of(new String[] {"customValue"}).collect(Collectors.toList())); + .hasSameElementsAs(Stream.of("customValue").collect(Collectors.toList())); } private static void registerThings(String thingName) throws Exception {