{
col = (ManageableCollection)fieldType.newInstance();
}
catch (Exception e)
{
throw new OJBRuntimeException("Cannot instantiate the default collection type "+fieldType.getName()+" of collection "+desc.getAttributeName()+" in type "+desc.getClassDescriptor().getClassNameOfObject());
}
}
else if (fieldType.isAssignableFrom(RemovalAwareCollection.class))
{
col = new RemovalAwareCollection();
}
else if (fieldType.isAssignableFrom(RemovalAwareList.class))
{
col = new RemovalAwareList();
}
else if (fieldType.isAssignableFrom(RemovalAwareSet.class))
{
col = new RemovalAwareSet();
}
else
{
throw new MetadataException("Cannot determine a default collection type for collection "+desc.getAttributeName()+" in type "+desc.getClassDescriptor().getClassNameOfObject());
}
}
else
{
try
{
col = (ManageableCollection)collectionClass.newInstance();
}
catch (Exception e)
{
throw new OJBRuntimeException("Cannot instantiate the collection class "+collectionClass.getName()+" of collection "+desc.getAttributeName()+" in type "+desc.getClassDescriptor().getClassNameOfObject());
}
}
return col;
}