You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Holly Cummins (JIRA)" <ji...@apache.org> on 2012/07/15 19:00:48 UTC

[jira] [Created] (ARIES-874) Blueprint should treat "value-type" on a map as a default, not a requirement

Holly Cummins created ARIES-874:
-----------------------------------

             Summary: Blueprint should treat "value-type" on a map as a default, not a requirement
                 Key: ARIES-874
                 URL: https://issues.apache.org/jira/browse/ARIES-874
             Project: Aries
          Issue Type: Bug
          Components: Blueprint
    Affects Versions: blueprint-0.4.0
            Reporter: Holly Cummins
            Assignee: Holly Cummins
            Priority: Minor


We have six failures in the OSGi blueprint compliance tests with errors similar to the following: 

 "Unable to convert value 1.0 to type java.lang.Boolean"

I've done a bit of digging and the problem happens when a <map> in a blueprint.xml specifies a value-type. Since ARIES-703, the MapRecipe converts every value in the collection to the value-type. However, the specification describes the value-type as follows: "Optional default type for values." That is, the value-type is only a default, and individual entries in the map can override the type. 

We're seeing failures because we're trying to convert values which are declared as double to the default type for the map, boolean.

I've updated MapRecipe to check if there is a value specified on the type, and use that for the conversion where possible. What I ended up with is fairly similar to what CollectionRecipe already does, reassuringly. I've also done the same thing for key-types. Finally, our tests for constructing maps were commented out, so I've re-enabled them and added some extra ones to test these more complex scenarios.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (ARIES-874) Blueprint should treat "value-type" on a map as a default, not a requirement

Posted by "Holly Cummins (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Holly Cummins resolved ARIES-874.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0
    
> Blueprint should treat "value-type" on a map as a default, not a requirement
> ----------------------------------------------------------------------------
>
>                 Key: ARIES-874
>                 URL: https://issues.apache.org/jira/browse/ARIES-874
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: blueprint-0.4.0
>            Reporter: Holly Cummins
>            Assignee: Holly Cummins
>            Priority: Minor
>             Fix For: 1.0
>
>
> We have six failures in the OSGi blueprint compliance tests with errors similar to the following: 
>  "Unable to convert value 1.0 to type java.lang.Boolean"
> I've done a bit of digging and the problem happens when a <map> in a blueprint.xml specifies a value-type. Since ARIES-703, the MapRecipe converts every value in the collection to the value-type. However, the specification describes the value-type as follows: "Optional default type for values." That is, the value-type is only a default, and individual entries in the map can override the type. 
> We're seeing failures because we're trying to convert values which are declared as double to the default type for the map, boolean.
> I've updated MapRecipe to check if there is a value specified on the type, and use that for the conversion where possible. What I ended up with is fairly similar to what CollectionRecipe already does, reassuringly. I've also done the same thing for key-types. Finally, our tests for constructing maps were commented out, so I've re-enabled them and added some extra ones to test these more complex scenarios.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira