CDI.setCDIProvider states that you can only set the provider once but the actual code doesn't check this at all.
Code link - https://github.com/jakartaee/cdi/blob/master/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java#L120
The javadoc makes sense and the code should IMO adhere to it - there is no reason to change CDI provider during runtime.
Since this is behavioral change, we should fix it for next major.
This is also related to #617 since both APIs should work the same way so we should change both.
CDI.setCDIProviderstates that you can only set the provider once but the actual code doesn't check this at all.Code link - https://github.com/jakartaee/cdi/blob/master/api/src/main/java/jakarta/enterprise/inject/spi/CDI.java#L120
The javadoc makes sense and the code should IMO adhere to it - there is no reason to change CDI provider during runtime.
Since this is behavioral change, we should fix it for next major.
This is also related to #617 since both APIs should work the same way so we should change both.