// shouldn't happen provided OpenDoPEHandler preserved SDT ID on first instance of repeat
log.error( OpenDoPEHandler.getSdtPr(entry).getTag().getVal() + " - No replacement SDT with ID " + key.toString() );
}
// ok, replace
Child child = (Child)entry;
Object parent = child.getParent();
log.info("parent: " + parent.getClass().getName() );
if (parent instanceof ContentAccessor
|| parent instanceof java.util.ArrayList) {
List<Object> list = (parent instanceof ContentAccessor) ?
((ContentAccessor)parent).getContent() : (java.util.ArrayList)parent;
int index = 0;
boolean found = false;
for (Object o : list) {
if (XmlUtils.unwrap(o).equals(child)) {
found = true;
break;
}
index++;
}
if (found) {
list.set(index, replacement);
} else {
log.error("Couldn't find repeat sdt: " + key );
}
} else {
log.error("TODO " + parent.getClass().getName() );
}
}
// the sdts to remove
for ( Object entry : instanceSdtPrFinder.repeatSdtToDelete ) {
Child child = (Child)entry;
Object parent = child.getParent();
log.info("parent: " + parent.getClass().getName() );
if (parent instanceof ContentAccessor
|| parent instanceof java.util.ArrayList) {