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

Alexey Loubyansky (JIRA) jira-events at lists.jboss.org
Tue Nov 25 04:44:36 EST 2008


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