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