[ 
http://issues.apache.org/jira/browse/TUSCANY-25?page=comments#action_12369440 ] 

Michael John Edwards commented on TUSCANY-25:
---------------------------------------------

Sebastien's interpretation is the correct one.  @Reference can be used 
irrespective of access modifier of the field.

I will raise an issue against the SCA Java C&I spec to ensure that this is made 
explicit in future versions of the specification.

> @Reference doesn't work on fields with protected or default access modifier
> ---------------------------------------------------------------------------
>
>          Key: TUSCANY-25
>          URL: http://issues.apache.org/jira/browse/TUSCANY-25
>      Project: Tuscany
>         Type: Bug
>   Components: Java SCA POJO Container
>     Reporter: ant elder

>
> The @Reference annotation only works on a field which is private or public. 
> If the field is protected or uses the default access modifier then the 
> reference is silently ignored.
> The section on @Reference in the SCA client and implementaion model for Java 
> doc doesn't clearly say if this is correct or not, but if private and public 
> work then it seems reasonable that the others should as well.
> Looks like this is caused by 
> org.apache.tuscany.container.java.config.Java5ComponentTypeIntrospector 
> method introspectPrivateFields which ignores all fields which aren't private. 
> Also looks like the same problem will happen with @Property or when 
> annotating methods instead of fields. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to