Status: Closed (View Workflow)
Affects Version/s: None
Fix Version/s: 2.0.0-alpha-4
java version "1.7.0_01"
Java(TM) SE Runtime Environment (build 1.7.0_01-b08)
Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
Linux ayaki.localdomain 3.3.0-4.fc16.x86_64 #1 SMP Tue Mar 20 18:05:40 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
The attached test case produces an invalid beans.xml with a duplicate <alternatives/> entry with the code:
'getOrCreate' is in fact always creating an alternatives entry, so the following beans.xml is produced in the example:
The produced beans.xml descriptor fails at deployment time with:
WELD-001203 <alternatives> can only be specified once, but appears multiple times: vfs:/content/demo.jar/META-INF/beans.xml@6
Also: Since there can only ever be one <alternatives/> block, it's not clear what the difference between getOrCreateAlternatives() and createAlternatives() is. Is the latter supposed to replace any existing block?
The API for managing alternatives is in Descriptors 2.0 is IMO difficult to use and understand. Issues with examples pending.