Repository navigation
[cherry-pick][0.13] Upgrade Guava to 33.8.0-jre and bump version to 0.13.2-SNAPSHOT - #93
Conversation
….13.2-SNAPSHOT Cherry-pick the Guava API migration (#87) and bump com.google.guava:guava from 13.0.1 to 33.8.0-jre (#92) on release/0.13. This resolves CVE-2026-102554 and CVE-2026-118042 for CDAP release/6.11, and bumps the common version from 0.13.1 to 0.13.2-SNAPSHOT.
There was a problem hiding this comment.
Code Review
This pull request updates the project's Guava dependency to version 33.8.0-jre and replaces deprecated Guava APIs (such as Charsets, Objects helper methods, InputSupplier, and Throwables.propagate) with standard Java equivalents or modern Guava alternatives. Feedback on these changes suggests improving exception handling during reflective instantiation in ASMDatumWriterFactory and InstantiatorFactory by unwrapping InvocationTargetException before propagation, and using UncheckedIOException instead of a generic RuntimeException in Schema.java when catching IOException.
| } catch (Exception e) { | ||
| throw Throwables.propagate(e); | ||
| Throwables.throwIfUnchecked(e); | ||
| throw new RuntimeException(e); | ||
| } |
There was a problem hiding this comment.
When invoking a constructor reflectively via Constructor.newInstance, any exception thrown by the constructor is wrapped in an InvocationTargetException. Unwrapping InvocationTargetException first allows unchecked exceptions (such as IllegalArgumentException when the schema does not match) to be propagated directly instead of being double-wrapped in a RuntimeException.
} catch (Exception e) {
Throwable cause = e instanceof java.lang.reflect.InvocationTargetException ? e.getCause() : e;
Throwables.throwIfUnchecked(cause);
throw new RuntimeException(cause);
}| } catch (Exception e) { | ||
| throw Throwables.propagate(e); | ||
| Throwables.throwIfUnchecked(e); | ||
| throw new RuntimeException(e); | ||
| } |
There was a problem hiding this comment.
Similar to other reflective instantiation points, defaultCons.newInstance() wraps any constructor-thrown exception in an InvocationTargetException. Unwrapping it before calling Throwables.throwIfUnchecked ensures that any unchecked exceptions thrown during instantiation are propagated directly without unnecessary wrapping.
} catch (Exception e) {
Throwable cause = e instanceof java.lang.reflect.InvocationTargetException ? e.getCause() : e;
Throwables.throwIfUnchecked(cause);
throw new RuntimeException(cause);
}| } catch (IOException e) { | ||
| // It should never throw IOException on the StringBuilder Writer, if it does, something very wrong. | ||
| throw Throwables.propagate(e); | ||
| throw new RuntimeException(e); | ||
| } |
There was a problem hiding this comment.
Since the caught exception is an IOException, throwing a java.io.UncheckedIOException is more specific and idiomatic than a generic RuntimeException. This is also consistent with the exception handling changes made in HttpResponse.java.
| } catch (IOException e) { | |
| // It should never throw IOException on the StringBuilder Writer, if it does, something very wrong. | |
| throw Throwables.propagate(e); | |
| throw new RuntimeException(e); | |
| } | |
| } catch (IOException e) { | |
| // It should never throw IOException on the StringBuilder Writer, if it does, something very wrong. | |
| throw new java.io.UncheckedIOException(e); | |
| } |
Summary
Cherry-pick the Guava API migration (#87) and upgrade
com.google.guava:guavafrom13.0.1to33.8.0-jre(#92) onrelease/0.13so CDAPrelease/6.11resolves bothCVE-2026-102554andCVE-2026-118042.Also bump
io.cdap.common:commonand all five child modules from0.13.1to0.13.2-SNAPSHOTfor the next0.13.xsnapshot build.Testing
mvn clean verify(Apache RAT, Checkstyle, and all unit tests across all 6 reactor modules) passed on Eclipse Temurin 11.mvn dependency:treeconfirmedcom.google.guava:guava:jar:33.8.0-jre(+ failureaccess:1.0.3) across all child modules.