Bump Guava to 33.6.0-jre and drop redundant usage#11722
Bump Guava to 33.6.0-jre and drop redundant usage#11722AlexeyKuznetsov-DD wants to merge 10 commits into
Conversation
# Conflicts: # gradle/libs.versions.toml
# 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
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1dd56229e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
The PR replaces Iterables.unmodifiableIterable(wrapped) with wrapped.&iterator in ObjectVisitorTest, but this change breaks the test. A Groovy method reference (.&iterator) creates a Closure, which does NOT implement Iterable. When ObjectVisitor checks instanceof Iterable, the Closure fails the check and is processed as a regular object, causing the expected visitor calls to never occur.
📊 Validated against 1 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit b1dd562 · What is Autotest? · Any feedback? Reach out in #autotest
| final visitor = Mock(ObjectVisitor.Visitor) | ||
| final wrapped = ['1', '2', '3'] | ||
| final target = Iterables.unmodifiableIterable(wrapped) | ||
| final Iterable target = wrapped.&iterator |
There was a problem hiding this comment.
Test semantic failure: wrapped.&iterator is not an Iterable
Test failure that prevents the build from passing and blocks the Guava bump PR.
Assertion details
- Input: Test visiting iterable with ObjectVisitor where target is wrapped.&iterator (a Groovy method reference/closure)
- Expected:
ObjectVisitor should treat the target as an Iterable and call visitor.visit() for each element: root[0], root[1], root[2] - Actual: wrapped.&iterator creates a Closure which does NOT implement Iterable. ObjectVisitor checks
instanceof Iterableat line 83, which fails for Closure. The object is then processed via visitObject() instead of visitIterable(), and since the predicateIterable.isAssignableFrom(Closure.class)is false, no elements are visited. Test mock expectations (lines 48-50) expect 3 visitor calls but will get 0 or 1, causing test failure.
Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · Any feedback? Reach out in #autotest
There was a problem hiding this comment.
This one is actually a false-positive - test passed.
But to make things more obvious applied cosmetic fix in b05db2ea
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Kafka / producer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics. See unchanged results
|
Kafka / consumer-benchmarkParameters
See matching parameters
SummaryFound 0 performance improvements and 1 performance regressions! Performance is the same for 2 metrics, 0 unstable metrics.
See unchanged results
|
What Does This Do
Bumps Guava from the legacy
[16.0,20.0]range (pinned for Java 7) to33.6.0-jre(April 14) and cleans up obvious places where Guava was used for things available out-of-the-box in the JDK:com.google.common.base.Charsets.UTF_8withjava.nio.charset.StandardCharsets.UTF_8.Iterables.unmodifiableIterable(...)with a plainIterable.testImplementation(libs.guava)fromdd-trace-api,agent-iast, andcorrelation-id-injection.25.1-jre(Jackson'sFuzzyEnumModulereferencesCharMatcher.WHITESPACE).20.0(Jersey 2.0 links to the removedMoreExecutors.sameThreadExecutor).gradle.lockfiles.Motivation
The Guava version was still pinned to a 2016-era range for Java 7 compatibility, which is long obsolete. Bumping to the latest
-jrerelease keeps us current on security/bug fixes, and removing trivial Guava usages reduces our reliance on the library where the JDK already provides equivalents.Additional Notes
Guava used only in
testscope.See releases for the guava changes.