thswlsqls opened a new pull request, #16884: URL: https://github.com/apache/iceberg/pull/16884
## Summary - `Ctor.newInstance` wrapped `e.getCause()` in a `RuntimeException`, but `newInstanceChecked` rethrows `InstantiationException`/`IllegalAccessException` with no cause (`throw e`), so the wrapper got a null cause and the original exception was lost as `RuntimeException: null`. - Wrap the caught exception `e` directly, preserving the original as the cause — matching the sibling `DynMethods.UnboundMethod.invoke`, which wraps `e` via `Throwables.propagate(e)`. - Regression from PR #10542 (commit c469edf6c), which replaced `Throwables.propagate(e)` with `new RuntimeException(e.getCause())`. - The `InvocationTargetException` branch in `newInstanceChecked` intentionally uses `e.getCause()` and is left unchanged. ## Testing done - Added `TestDynConstructors#testNewInstancePreservesInstantiationException`: builds a `Ctor` for an abstract class and asserts the thrown `RuntimeException` carries the `InstantiationException` as its cause. Fails before the fix (null cause), passes after. - `./gradlew :iceberg-common:check` — green, 6 tests in TestDynConstructors. - `./gradlew :iceberg-common:revapi` — passed (no signature change). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
