Anurag-S1ngh opened a new pull request, #19257: URL: https://github.com/apache/iceberg/pull/19257
## Summary - `DynConstructors.Builder` accepted implementation classes that do not implement the configured base class, so the error surfaced later as a `ClassCastException` from `Ctor.newInstance()`. - Validate assignability while candidates are added, and surface that error from `build()` and `buildChecked()`. ## Changes - `DynConstructors.Builder.impl` and `hiddenImpl`: reject a class that is not assignable to the base class with a clear `IllegalArgumentException`. - `build()` and `buildChecked()`: throw the assignability problem before the generic missing-constructor error. - `TestDynConstructors`: replace the two TODO cases with assertions for the build-time failure, for both the string and class forms. ## Testing - `./gradlew :iceberg-common:test --rerun-tasks` passes. - Both updated tests fail with `Expecting code to raise a throwable` without the change. - `spotlessApply` run for the module. Closes #17506 -- 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]
