You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Gilbert Kwan (JIRA)" <tu...@ws.apache.org> on 2008/05/01 21:22:55 UTC
[jira] Created: (TUSCANY-2289) Java runtime should inject property
into an unannotated non-public field by public setter
Java runtime should inject property into an unannotated non-public field by public setter
-----------------------------------------------------------------------------------------
Key: TUSCANY-2289
URL: https://issues.apache.org/jira/browse/TUSCANY-2289
Project: Tuscany
Issue Type: Bug
Components: Java SCA Core Runtime, Java SCA Verification Tests
Affects Versions: Java-SCA-1.2
Reporter: Gilbert Kwan
Assignee: Simon Laws
Fix For: Java-SCA-Next
Java Common Annotations and APIs v1.0 - Sec 1.8.13:
1349 Properties may also be injected via public setter methods even when the @Property annotation is not
1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
1352 name of the field or setter.
Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TUSCANY-2289) Java runtime should not inject
property into an unannotated non-public field by protected setter
Posted by "Dan Becker (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12604607#action_12604607 ]
Dan Becker commented on TUSCANY-2289:
-------------------------------------
The way I read these rules are:
Proposition A: Properties may also be injected via public setter methods
(The extra information clause "even when the @Property annotation is not present" is not needed, it is just amplifying that present or not present @Property annotation is OK.)
Proposition B: The @Property annotation must be used in order to inject a property onto a non-public field.
The rules use the word "injection for both @Property annotation and public setter methods, so:
Gilbert, there can be injection with a protected setter, if you use the @Property annotation.
Vamsi, you are correct, you can use a protected setter, if you use the @Property annotation.
The rules seem a little ambiguous because they don't distinguish the @Property annotation on the method versus on the instance variable.
Given "properties are injected into unannotated protected fields too" , it sounds to me that this could be legal if you have had
@Property(name="currency", required=true)
protected void setCurrency( String theCurrency );
and
protected String currency;
An example on line 1376 shows how you can have an unannotated field and an annotated setter.
> Java runtime should not inject property into an unannotated non-public field by protected setter
> ------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TUSCANY-2289) Java runtime should not inject
property into an unannotated non-public field by protected setter
Posted by "Vamsavardhana Reddy (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593639#action_12593639 ]
Vamsavardhana Reddy commented on TUSCANY-2289:
----------------------------------------------
Can't figure where it says protected setter method can not inject a property!!
> Java runtime should not inject property into an unannotated non-public field by protected setter
> ------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (TUSCANY-2289) Java runtime should inject property
into an unannotated non-public field by public setter
Posted by "Gilbert Kwan (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gilbert Kwan updated TUSCANY-2289:
----------------------------------
Component/s: (was: Java SCA Verification Tests)
Affects Version/s: (was: Java-SCA-1.2)
Java-SCA-Next
> Java runtime should inject property into an unannotated non-public field by public setter
> -----------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TUSCANY-2289) Java runtime should not inject
property into an unannotated non-public field by protected setter
Posted by "Gilbert Kwan (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593625#action_12593625 ]
Gilbert Kwan commented on TUSCANY-2289:
---------------------------------------
Should this issue be reassigned to Vamsavardhana Reddy who fixed 2271?
> Java runtime should not inject property into an unannotated non-public field by protected setter
> ------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TUSCANY-2289) Java runtime should inject
property into an unannotated non-public field by public setter
Posted by "Gilbert Kwan (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593614#action_12593614 ]
Gilbert Kwan commented on TUSCANY-2289:
---------------------------------------
Q 2. protected/private field but its setter is public
- there should be no injection, too
Ans: No, the property should be injected in this case.
I tested the above, where the non-public field is not injected by its public setter.
> Java runtime should inject property into an unannotated non-public field by public setter
> -----------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (TUSCANY-2289) Java runtime should not inject
property into an unannotated non-public field by protected setter
Posted by "Gilbert Kwan (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gilbert Kwan updated TUSCANY-2289:
----------------------------------
Summary: Java runtime should not inject property into an unannotated non-public field by protected setter (was: Java runtime should inject property into an unannotated non-public field by public setter)
> Java runtime should not inject property into an unannotated non-public field by protected setter
> ------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (TUSCANY-2289) Java runtime should not inject
property into an unannotated non-public field by protected setter
Posted by "Dan Becker (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Becker closed TUSCANY-2289.
-------------------------------
Resolution: Invalid
@Property protected method may be used to change protected field by previous argument. Reopen if you have a counter argument or counter example.
> Java runtime should not inject property into an unannotated non-public field by protected setter
> ------------------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TUSCANY-2289) Java runtime should inject
property into an unannotated non-public field by public setter
Posted by "Gilbert Kwan (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593616#action_12593616 ]
Gilbert Kwan commented on TUSCANY-2289:
---------------------------------------
Q 1. protected field and its setter is protected
- there should be no injection.
A: Only in the case of protected field without a setter method, the property should not be injected.
I tested above that un-annotated protected field is injected by its protected setter
> Java runtime should inject property into an unannotated non-public field by public setter
> -----------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (TUSCANY-2289) Java runtime should inject property
into an unannotated non-public field by public setter
Posted by "Gilbert Kwan (JIRA)" <tu...@ws.apache.org>.
[ https://issues.apache.org/jira/browse/TUSCANY-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gilbert Kwan updated TUSCANY-2289:
----------------------------------
Comment: was deleted
> Java runtime should inject property into an unannotated non-public field by public setter
> -----------------------------------------------------------------------------------------
>
> Key: TUSCANY-2289
> URL: https://issues.apache.org/jira/browse/TUSCANY-2289
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
> Affects Versions: Java-SCA-Next
> Reporter: Gilbert Kwan
> Assignee: Simon Laws
> Fix For: Java-SCA-Next
>
>
> Java Common Annotations and APIs v1.0 - Sec 1.8.13:
> 1349 Properties may also be injected via public setter methods even when the @Property annotation is not
> 1350 present. However, the @Property annotation must be used in order to inject a property onto a non-public
> 1351 field. In the case where there is no @Property annotation, the name of the property is the same as the
> 1352 name of the field or setter.
> Currently the properties are injected into unannotated protected fields too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.