Update to groovy 4.0.7
Supersedes
MODIFY
dependencyManagement/build.gradle.kts
dependencyManagement/build.gradle.kts
@@ -12,7 +12,7 @@ val dependencyVersions = hashMapOf<String, String>()
rootProject.extra["versions"] = dependencyVersions
// Need both BOM and groovy jars
-val groovyVersion = "4.0.6"
+val groovyVersion = "4.0.7"
// We don't force libraries we instrument to new versions since we compile and test against specific
// old baseline versions but we do try to force those libraries' transitive dependencies to new

MODIFY
instrumentation-annotations-support/src/test/groovy/io/opentelemetry/instrumentation/api/annotation/support/AnnotationReflectionHelperTest.groovy
instrumentation-annotations-support/src/test/groovy/io/opentelemetry/instrumentation/api/annotation/support/AnnotationReflectionHelperTest.groovy
package io.opentelemetry.instrumentation.api.annotation.support
+import groovy.transform.CompileStatic
import spock.lang.Specification
import java.lang.invoke.MethodHandles
@@ -41,10 +42,18 @@ class AnnotationReflectionHelperTest extends Specification {
cls == null
}
+ // Using @CompileStatic to ensure that groovy does not call MethodHandles.lookup using method
+ // handles. MethodHandles.lookup is caller sensitive. Test fails with lookup where the caller is
+ // an anonymous class.
+ @CompileStatic
+ private static MethodHandles.Lookup getLookup() {
+ return MethodHandles.lookup()
+ }
+
def "returns bound functional interface to annotation element"() {
given:
def function = AnnotationReflectionHelper.bindAnnotationElementMethod(
- MethodHandles.lookup(),
+ getLookup(),
CustomAnnotation,
"value",
String

Update to groovy 4.0.7 (#7478)

Supersedes
https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/7473