[
https://jira.jboss.org/jira/browse/JBXB-165?page=com.atlassian.jira.plugi...
]
Alexey Loubyansky closed JBXB-165.
----------------------------------
Resolution: Done
Done except for the maps. I removed the map tests since they don't make sense with the
current implementation and binding options for maps.
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