Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting CDI SPI implementations repeatedly #696

Merged
merged 1 commit into from
Nov 7, 2023

Commits on Oct 25, 2023

  1. Allow setting CDI SPI implementations repeatedly

    The `CDI.setCDIProvider()` method has been documented to throw
    `IllegalStateException` on repeated calls since version 1.0, but since
    version 2.0, the implementation in fact didn't honor this documentation.
    Multiple implementations started to silently depend on repeated
    `setCDIProvider()` calls being allowed, especially for testing.
    
    We previously [1][2] fixed the implementation to actually do what
    it documents, planning to release the fix in CDI 4.1, but it turns out
    this is very inconvenient. Therefore, this commit makes repeated calls
    of `setCDIProvider()` officially allowed. For consistency, it also
    allows repeated calls of `BuildServicesResolver.setBuildServices()`.
    
    [1] jakartaee@82ec5d7
    [2] jakartaee@8ead70b
    Ladicek committed Oct 25, 2023
    Configuration menu
    Copy the full SHA
    c74b34f View commit details
    Browse the repository at this point in the history