Skip to content

Commit 265cec1

Browse files
Bump Guava to 33.6.0-jre and drop redundant usage (#11722)
Bump and clean guava library usages. Merge branch 'master' into alexeyk/bump-and-clean-guava # Conflicts: # gradle/libs.versions.toml Fixed failed test that hard linked to old Guava. Drop unused guava. Use Java built-in charsets. Merge branch 'master' into alexeyk/bump-and-clean-guava Lock files updated. Merge branch 'master' into alexeyk/bump-and-clean-guava Merge branch 'master' into alexeyk/bump-and-clean-guava # Conflicts: # dd-java-agent/instrumentation/glassfish-3.0/gradle.lockfile # dd-java-agent/instrumentation/grizzly/grizzly-2.0/gradle.lockfile # dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/gradle.lockfile # dd-java-agent/instrumentation/kafka/kafka-clients-0.11/gradle.lockfile # dd-java-agent/instrumentation/kafka/kafka-clients-3.8/gradle.lockfile # dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/gradle.lockfile Fixed lock file. Fixed review notes. Merge branch 'master' into alexeyk/bump-and-clean-guava Pin guava for old cassandra. Cleanup not needed guava pin for SofaRpc. Cleanup for cassandra. Merge branch 'master' into alexeyk/bump-and-clean-guava Co-authored-by: alexey.kuznetsov <alexey.kuznetsov@datadoghq.com>
1 parent 4e7bb7b commit 265cec1

30 files changed

Lines changed: 151 additions & 70 deletions

File tree

dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/codeowners/CodeownersTest.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package datadog.trace.civisibility.codeowners
22

3-
import com.google.common.base.Charsets
3+
import static java.nio.charset.StandardCharsets.UTF_8
4+
45
import spock.lang.Specification
56

67
class CodeownersTest extends Specification {
78

89
def "test codeowners matching: #path"() {
910
setup:
10-
def codeowners = new InputStreamReader(CodeownersTest.getClassLoader().getResourceAsStream("ci/codeowners/CODEOWNERS_sample"), Charsets.UTF_8).withCloseable { reader ->
11-
CodeownersImpl.parse(reader)
12-
}
11+
def codeowners = new InputStreamReader(CodeownersTest.getClassLoader().getResourceAsStream("ci/codeowners/CODEOWNERS_sample"), UTF_8)
12+
.withCloseable { reader -> CodeownersImpl.parse(reader) }
1313

1414
when:
1515
def owners = codeowners.getOwners(path)

dd-java-agent/agent-iast/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ dependencies {
5151
testImplementation project(':dd-java-agent:agent-bootstrap')
5252
testImplementation('org.skyscreamer:jsonassert:1.5.1')
5353
testImplementation(libs.bytebuddy)
54-
testImplementation(libs.guava)
5554

5655
testImplementation(libs.groovy.yaml)
5756

dd-java-agent/agent-iast/gradle.lockfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ com.google.errorprone:error_prone_type_annotations:2.23.0=annotationProcessor,er
5151
com.google.errorprone:javac:9+181-r4173-1=errorproneJavac
5252
com.google.guava:failureaccess:1.0.1=annotationProcessor,errorprone,jmhAnnotationProcessor,jmhRuntimeClasspath,testAnnotationProcessor,testCompileProtoPath,testRuntimeClasspath
5353
com.google.guava:guava-parent:32.1.1-jre=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor
54-
com.google.guava:guava:20.0=testCompileClasspath
5554
com.google.guava:guava:30.1.1-android=jmhRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath
5655
com.google.guava:guava:32.1.1-jre=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor
5756
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=jmhRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath

dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/util/ObjectVisitorTest.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.datadog.iast.util
22

3-
import com.google.common.collect.Iterables
43
import foo.bar.VisitableClass
54
import spock.lang.Specification
65

@@ -40,7 +39,7 @@ class ObjectVisitorTest extends Specification {
4039
given:
4140
final visitor = Mock(ObjectVisitor.Visitor)
4241
final wrapped = ['1', '2', '3']
43-
final target = Iterables.unmodifiableIterable(wrapped)
42+
final Iterable target = wrapped.&iterator as Iterable
4443

4544
when:
4645
ObjectVisitor.visit(target, visitor) { Iterable.isAssignableFrom(it) }

dd-java-agent/agent-profiling/profiling-controller/gradle.lockfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs
1212
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
1313
com.google.code.gson:gson:2.13.2=spotbugs
1414
com.google.errorprone:error_prone_annotations:2.41.0=spotbugs
15-
com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath
15+
com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath
16+
com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath
17+
com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath
18+
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath
19+
com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath
1620
com.thoughtworks.qdox:qdox:1.12.1=codenarc
1721
commons-io:commons-io:2.20.0=spotbugs
1822
de.thetaphi:forbiddenapis:3.10=compileClasspath
@@ -47,6 +51,7 @@ org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt
4751
org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt
4852
org.jacoco:org.jacoco.core:0.8.14=jacocoAnt
4953
org.jacoco:org.jacoco.report:0.8.14=jacocoAnt
54+
org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath
5055
org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath
5156
org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath
5257
org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath

dd-java-agent/agent-profiling/profiling-testing/gradle.lockfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs
1212
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
1313
com.google.code.gson:gson:2.13.2=spotbugs
1414
com.google.errorprone:error_prone_annotations:2.41.0=spotbugs
15-
com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
15+
com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
16+
com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
17+
com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
18+
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
19+
com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1620
com.squareup.okhttp3:mockwebserver:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1721
com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
1822
com.squareup.okio:okio:1.15.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -55,6 +59,7 @@ org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt
5559
org.jacoco:org.jacoco.core:0.8.14=jacocoAnt
5660
org.jacoco:org.jacoco.report:0.8.14=jacocoAnt
5761
org.javadelight:delight-fileupload:0.0.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
62+
org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
5863
org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath
5964
org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath
6065
org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath

dd-java-agent/gradle.lockfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs
2828
com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
2929
com.google.code.gson:gson:2.13.2=spotbugs
3030
com.google.errorprone:error_prone_annotations:2.41.0=spotbugs
31-
com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath
31+
com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath
32+
com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath
33+
com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath
34+
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath
35+
com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath
3236
com.google.re2j:re2j:1.8=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude
3337
com.squareup.moshi:moshi:1.11.0=sharedShadowInclude,testCompileClasspath,testRuntimeClasspath,traceShadowInclude
3438
com.squareup.okhttp3:mockwebserver:3.12.12=testCompileClasspath,testRuntimeClasspath
@@ -72,6 +76,7 @@ org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath
7276
org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath
7377
org.jctools:jctools-core-jdk11:4.0.6=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude
7478
org.jctools:jctools-core:4.0.6=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude
79+
org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath
7580
org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath
7681
org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath
7782
org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath

dd-java-agent/instrumentation-testing/gradle.lockfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testAnnotationPr
3333
com.google.code.gson:gson:2.13.2=spotbugs
3434
com.google.errorprone:error_prone_annotations:2.18.0=testAnnotationProcessor
3535
com.google.errorprone:error_prone_annotations:2.41.0=spotbugs
36+
com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
3637
com.google.guava:failureaccess:1.0.1=testAnnotationProcessor
37-
com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
38+
com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
3839
com.google.guava:guava:32.0.1-jre=testAnnotationProcessor
39-
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testAnnotationProcessor
40+
com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
41+
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
4042
com.google.j2objc:j2objc-annotations:2.8=testAnnotationProcessor
43+
com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
4144
com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath
4245
com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
4346
com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
@@ -86,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=compileClasspath,runtimeClasspath,testCompileClas
8689
org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath
8790
org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath
8891
org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath
92+
org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
8993
org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
9094
org.junit.jupiter:junit-jupiter-engine:5.14.1=runtimeClasspath,testRuntimeClasspath
9195
org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath

dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ muzzle {
4040

4141
apply from: "$rootDir/gradle/java.gradle"
4242

43-
4443
testJvmConstraints {
4544
// Test use Cassandra 3 which requires Java 8. (Currently incompatible with Java 9.)
4645
maxJavaVersion = JavaVersion.VERSION_1_8
@@ -49,6 +48,13 @@ testJvmConstraints {
4948
addTestSuiteForDir('latestDepTest', 'test')
5049

5150
dependencies {
51+
constraints {
52+
testImplementation("com.google.guava:guava") {
53+
version { strictly "19.0" }
54+
because "cassandra-driver-core 3.x is not compatible with Guava 20+"
55+
}
56+
}
57+
5258
compileOnly group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.0.0'
5359
compileOnly group: 'com.google.guava', name: 'guava', version: '18.0'
5460

dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,11 @@ dependencies {
2323
// Anything 1.0+ fails with a java.lang.NoClassDefFoundError: org/eclipse/jetty/server/RequestLog
2424
// latestDepTestImplementation group: 'io.dropwizard', name: 'dropwizard-testing', version: '1.+'
2525
}
26+
27+
// Dropwizard 0.8 (via Jackson's FuzzyEnumModule) references the CharMatcher.WHITESPACE field,
28+
// which present only until 25.1-jre.
29+
['testCompileClasspath', 'testRuntimeClasspath'].each {
30+
configurations.named(it) {
31+
resolutionStrategy.force 'com.google.guava:guava:25.1-jre'
32+
}
33+
}

0 commit comments

Comments
 (0)