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

Jean-Sebastien Delfino commented on TUSCANY-25:
-----------------------------------------------

Here's what the SCA 0.9 spec says for @Properties:

The @Property annotation may be used irrespective of the access modifier of the 
field (even private), since
the access modifier defines the contract with the client of the component, 
whereas the @Property
annotation specifies a contract with the container of the component.

So for @Properties we should support all fields irrespective of their access 
modifier. I'll create a sub-issue to track the fact that the spec doesn't make 
an explicit statement about the access modifier for @Reference. Until the 
sub-issue is resolved I think we should assume that the correct behavior is the 
same as for @Property.


> @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