The Multiplicity attribute of reference failed to work as expected
------------------------------------------------------------------

                 Key: TUSCANY-2720
                 URL: https://issues.apache.org/jira/browse/TUSCANY-2720
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Assembly Model
            Reporter: Ku Jun Guo


As the OASIS and OSOA specification said, if multiplicity is specified "1..1", 
the target number should be one.
But when I tested the following case, it passed.

For the OASIS spec, 
"A reference with multiplicity 0..1 or 1..1 MUST NOT have more that one target 
service defined. [ASM50019]"

My composite file likes this:
<reference name="bService" target="ServiceComponent/MyService 
ServiceComponent2/MyService" multiplicity="1..1"> 
        </reference>  

My client class likes this:
@Reference
        protected MyService[] bService ; 

void test() {
   ...
   for (MyService s: bService) {dosomething()}
  ...
}

I only found one warning message: "WARNING: Too many targets on reference: 
bService"
I think it should be a runtime error.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to