[jboss-jira] [JBoss JIRA] Assigned: (JBXB-165) CollectionPropertyHandler should check component type of an item

Ales Justin (JIRA) jira-events at lists.jboss.org
Thu Nov 27 08:59:36 EST 2008


     [ https://jira.jboss.org/jira/browse/JBXB-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ales Justin reassigned JBXB-165:
--------------------------------

    Assignee: Ales Justin


> CollectionPropertyHandler should check component type of an item
> ----------------------------------------------------------------
>
>                 Key: JBXB-165
>                 URL: https://jira.jboss.org/jira/browse/JBXB-165
>             Project: JBoss XML Binding (JBossXB)
>          Issue Type: Bug
>    Affects Versions:  JBossXB-2.0.0.GA
>            Reporter: Alexey Loubyansky
>            Assignee: Ales Justin
>             Fix For: JBossXB-2.0.1.Beta1
>
>
> CollectionPropertyHandler could include this check
>       if (child != null)
>       {
>          TypeInfo typeInfo = propertyInfo.getType();
>          if (typeInfo instanceof ClassInfo)
>          {
>             ClassInfo classInfo = (ClassInfo)typeInfo;
>             TypeInfo componentType = classInfo.getComponentType();
>             if (componentType != null)
>             {
>                TypeInfoFactory tif = componentType.getTypeInfoFactory();
>                TypeInfo childTypeInfo = tif.getTypeInfo(child.getClass());
>                if (componentType.isAssignableFrom(childTypeInfo) == false)
>                   throw new IllegalArgumentException("Illegal child type");
>             }
>          }
>       }

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

        



More information about the jboss-jira mailing list