You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Mark Combellack (JIRA)" <tu...@ws.apache.org> on 2007/10/14 00:10:50 UTC

[jira] Commented: (TUSCANY-1848) Tuscany cannot inject a many value Property into an array

    [ https://issues.apache.org/jira/browse/TUSCANY-1848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534572 ] 

Mark Combellack commented on TUSCANY-1848:
------------------------------------------

When a multi-value property is found, the JavaPropertyValueObjectFactory always uses a ListObjectFactoryImpl instance to create the value for the property. The ListObjectFactoryImpl always returns a List of objects.

This causes problems when the method/field that is being injected is an array as a List is not an array.

The fix is to update the JavaPropertyValueObjectFactory so that it looks at the type of the injection point to determine if it is an Array and if so then convert the List to an Array before injecting.

> Tuscany cannot inject a many value Property into an array
> ---------------------------------------------------------
>
>                 Key: TUSCANY-1848
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1848
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Core Runtime
>    Affects Versions: Java-SCA-1.0
>         Environment: SVN Head revision #584454
> Linux
>            Reporter: Mark Combellack
>            Priority: Minor
>             Fix For: Java-SCA-Next
>
>
> Currently, Tuscany cannot inject multi value properties into methods/fields that are defined as an array type. For example, the following injection scenarios do not work:
>     @Property(name = "daysOfTheWeek")
>     protected String[] daysOfTheWeek;
>     
>     @Property(name = "integerNumbers")
>     protected Integer[] integerNumbers;
>     @Property(name = "intNumbers")
>     protected int[] intNumbers;
>     @Property(name = "sdoArray")
>     protected DataObject[] sdoArray;
> There is no sample in the Java Common Annotations and APIs specification that says this should be allowed. However, it does strongly suggest it should be:
> 1369     If the property is defined as an array or as a java.util.Collection, then the implied component type has a
> 1370     property with a many attribute set to true.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org