Skip to content

Upgrade Guava from 13.0.1 to 32.0.0-jre#81

Closed
AbhishekKumar9984 wants to merge 1 commit into
cdapio:developfrom
cloudsufi:common2-cloudsufi-guava-upgrade
Closed

Upgrade Guava from 13.0.1 to 32.0.0-jre#81
AbhishekKumar9984 wants to merge 1 commit into
cdapio:developfrom
cloudsufi:common2-cloudsufi-guava-upgrade

Conversation

@AbhishekKumar9984
Copy link
Copy Markdown

Replace removed APIs:

Throwables.propagate() -> throw new RuntimeException(e)
InputSupplier (removed) -> use existing ContentProvider
Charsets.UTF_8 -> StandardCharsets.UTF_8
Objects.toStringHelper/firstNonNull -> MoreObjects equivalents
Objects.hashCode -> java.util.Objects.hash
startAndWait/stopAndWait -> startAsync().awaitRunning/stopAsync().awaitTerminated
Update ASM bytecode generation to use RuntimeException constructor
Fix header ordering in HttpRequestsTestBase

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the Guava dependency to version 32.0.0-jre and refactors the codebase to use standard Java APIs or updated Guava utilities. Key changes include replacing Guava's Charsets with java.nio.charset.StandardCharsets, migrating Guava's Objects to java.util.Objects or MoreObjects, and updating service lifecycle methods in tests. The reviewer pointed out that replacing Throwables.propagate(e) with new RuntimeException(e) changes the behavior for unchecked exceptions by wrapping them. It is recommended to use Throwables.throwIfUnchecked(e) before wrapping to ensure that RuntimeException and Error instances are rethrown without additional nesting.

Comment thread common-http/src/main/java/io/cdap/common/http/HttpRequest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants