Skip to content

Upgrade Guava from 13.0.1 to 32.0.0-jre#81

Open
AbhishekKumar9984 wants to merge 1 commit intocdapio:developfrom
cloudsufi:common2-cloudsufi-guava-upgrade
Open

Upgrade Guava from 13.0.1 to 32.0.0-jre#81
AbhishekKumar9984 wants to merge 1 commit intocdapio: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.

mg.dupX1();
mg.swap();
mg.invokeConstructor(Type.getType(RuntimeException.class),
getMethod(void.class, "<init>", Throwable.class));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What is the reason behind this change?

}
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How should the clients using this method adapt to this change?

.newInstance(schema, fieldAccessorFactory);
} catch (Exception e) {
throw Throwables.propagate(e);
throw new RuntimeException(e);
Copy link
Copy Markdown

@dheeraj-kholia-cs dheeraj-kholia-cs May 8, 2026

Choose a reason for hiding this comment

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

Instead of just throwing RuntimeException, do this

Throwables.throwIfUnchecked(e);
throw new RuntimeException(e);

Do this everywhere we are removing Thowables.propagate

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