Skip to content

Fix collection type resolution in DefaultConfiguratorRegistry#2833

Merged
timja merged 3 commits intojenkinsci:masterfrom
somiljain2006:Collection-type-parameter-safety
Apr 16, 2026
Merged

Fix collection type resolution in DefaultConfiguratorRegistry#2833
timja merged 3 commits intojenkinsci:masterfrom
somiljain2006:Collection-type-parameter-safety

Conversation

@somiljain2006
Copy link
Copy Markdown
Contributor

@somiljain2006 somiljain2006 commented Apr 15, 2026

Fix unsafe cast in DefaultConfiguratorRegistry for collection types. Use Types.getBaseClass to safely resolve collection element types instead of casting Type directly. This avoids potential ClassCastException and improves handling of nested generics, wildcards, type variables, and custom collection subclasses. Add tests covering raw collections, nested generics, wildcard bounds, type variables, and custom subclasses.

Your checklist for this pull request

🚨 Please review the guidelines for contributing to this repository.

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or in Jenkins JIRA
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Did you provide a test case? That demonstrates a feature that works or fixes the issue.

@somiljain2006 somiljain2006 requested a review from a team as a code owner April 15, 2026 23:31
@timja timja added the chore a PR that adds to maintenance - used by Release Drafter label Apr 16, 2026
@timja timja merged commit b6053ae into jenkinsci:master Apr 16, 2026
17 checks passed
@somiljain2006 somiljain2006 deleted the Collection-type-parameter-safety branch April 16, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore a PR that adds to maintenance - used by Release Drafter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants