Update to groovy 4.0.7 (#7478)

Supersedes
https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/7473
This commit is contained in:
Lauri Tulmin 2022-12-29 12:14:54 +02:00 committed by GitHub
parent ec5d44400e
commit 87b31475ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -5,6 +5,7 @@
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