Upgrade Guava from 13.0.1 to 32.0.0-jre#81
Upgrade Guava from 13.0.1 to 32.0.0-jre#81AbhishekKumar9984 wants to merge 1 commit intocdapio:developfrom
Conversation
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
What is the reason behind this change?
| } | ||
| }); | ||
| } | ||
|
|
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Instead of just throwing RuntimeException, do this
Throwables.throwIfUnchecked(e);
throw new RuntimeException(e);
Do this everywhere we are removing Thowables.propagate
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