Closed glassfishrobot closed 2 years ago
@glassfishrobot Commented Reported by @nigeldeakin
@glassfishrobot Commented Issue-Links: blocks JAVAEE_SPEC-36
@glassfishrobot Commented This issue was imported from java.net JIRA JMS_SPEC-151
It is weird this change was not included in Java EE 8.0 in which the main work is aligning with Java 8 SE.
This has been fixed by #298. To add test coverage, #299 and #300 were raised, so I will close this issue.
Java SE 7 did not allow class-level annotations such as tt>@JMSConnectionFactoryDefinition</tt and tt>@JMSDestinationDefinition</tt to be repeated.
This meant that if a class needed to define more than one connection factory or destination, then they needed to be wrapped in a tt>@JMSConnectionFactoryDefinitions</tt or tt>@JMSDestinationDefinitions</tt annotation, which made the code quite complicated:
Java SE 8 allows annotation types to be marked as "repeatable". If the tt>@JMSConnectionFactoryDefinition</tt and tt>@JMSDestinationDefinition</tt annotations were marked as repeatable then the above example could be simplified to
To allow this, the tt>@JMSDestinationDefinition</tt annotation would be extended as follows:
and the tt>@JMSConnectionFactoryDefinition</tt annotation would be extended as follows:
Note that it is necessary to specify a "containing annotation" which is generated by the compiler and used to store repeating annotations. It should be possible to re-use the existing annotations JMSDestinationDefinitions and JMSConnectionFactoryDefinitions for this purpose.
Affected Versions
[2.0]