Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347369 - @JavaTypeConstraint should also support OR types
Summary: @JavaTypeConstraint should also support OR types
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2011-05-26 16:31 EDT by Ling Hao CLA
Modified: 2021-11-19 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ling Hao CLA 2011-05-26 16:31:50 EDT
Currently if you specify more than one "type" in the JavaTypeConstraint annotation then the value must implement/extends "all" the specified type. Perhaps an option to specify that the value must implements/extends "one" of the specified type.
Comment 1 Konstantin Komissarchik CLA 2011-06-07 00:23:22 EDT
Enhancement implemented. Added a section to the 0.3 release what's new document. Unit test coverage in TestJava0004.testRequiredClass6() and TestJavaJdt0004.testRequiredClass6().

The syntax is as follows:

@JavaTypeConstraint( kind = JavaTypeKind.CLASS, type = { "java.util.List", "java.util.Map" }, behavior = JavaTypeConstraintBehavior.AT_LEAST_ONE )

The default behavior is JavaTypeConstraintBehavior.ALL, which matches old behavior for this constraint. There is no migration impact.

Please verify.
Comment 2 Ling Hao CLA 2011-06-08 13:21:44 EDT
Verified with Coherence test case.