Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347369

Summary: @JavaTypeConstraint should also support OR types
Product: z_Archived Reporter: Ling Hao <ling.hao>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: konstantin
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.