Skip to content

Common: Validate DynConstructors implementation types#15912

Open
manuzhang wants to merge 1 commit into
apache:mainfrom
manuzhang:common-dynconstructors-assignability-check
Open

Common: Validate DynConstructors implementation types#15912
manuzhang wants to merge 1 commit into
apache:mainfrom
manuzhang:common-dynconstructors-assignability-check

Conversation

@manuzhang

@manuzhang manuzhang commented Apr 8, 2026

Copy link
Copy Markdown
Member

Follow-up of #10542

@manuzhang manuzhang requested a review from findepi April 8, 2026 13:17
@github-actions github-actions Bot added the common label Apr 8, 2026
@manuzhang manuzhang requested a review from nastra April 8, 2026 13:18
@manuzhang manuzhang force-pushed the common-dynconstructors-assignability-check branch from 9fc73a9 to 00e78f0 Compare April 9, 2026 02:39
@github-actions github-actions Bot added the core label Apr 9, 2026
@manuzhang manuzhang force-pushed the common-dynconstructors-assignability-check branch from 00e78f0 to 10d24e6 Compare April 9, 2026 03:13
@github-actions github-actions Bot added the AZURE label Apr 9, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label May 10, 2026
@manuzhang manuzhang requested a review from Fokko May 10, 2026 01:07
@github-actions github-actions Bot removed the stale label May 11, 2026
String.format("Cannot initialize FileIO, %s does not implement FileIO.", impl), e);
}

FileIO fileIO = ctor.newInstance();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

DynConstructors now throws IllegalArgumentException in impl()/hiddenImpl() before newInstance() runs, so this ClassCastException branch is unreachable - and so are the identical catches left in the sibling loaders: loadCatalog (line 288) and loadMetricsReporter (line 538) in this file, plus LocationProviders.java:63, rest/HTTPClient.java:461, and azure AdlsTokenCredentialProviders.java:74, all paths whose tests this PR already updated to the new message. The same now-dead pattern also exists in other builder(base) callers (AwsClientFactories, S3FileIOAwsClientFactories, AuthManagers, LockManagers, EncryptionUtil, Dell/Aliyun factories). Consider removing them here for consistency.

@manuzhang manuzhang added this to the Iceberg 1.12.0 milestone Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants