//JD: not sure why we do this, rather than just task.setStore(existing);
CatalogBuilder cb = new CatalogBuilder(importer.getCatalog());
StoreInfo clone;
if (existing instanceof DataStoreInfo) {
clone = cb.buildDataStore(existing.getName());
cb.updateDataStore((DataStoreInfo) clone, (DataStoreInfo) existing);
}
else if (existing instanceof CoverageStoreInfo) {
clone = cb.buildCoverageStore(existing.getName());
cb.updateCoverageStore((CoverageStoreInfo) clone, (CoverageStoreInfo) existing);