private MultiEvent assignIDs(MultiEvent me, IResource resource) { int counter = 0; for (Event event : me) { if (event.isNoop()) continue; IResource res = event.getResource(); String resId = resource.getId(); if (res instanceof DocumentPart && !(resource instanceof DocumentPart)) { String id = ""; if (counter++ == 0) id = resId; else id = String.format("%s_%d", resId, counter++); res.setId("" + String.format("dp_%s", id)); } else { res.setId(resId); if (res instanceof BaseNameable && resource instanceof BaseNameable) { ResourceUtil.copyProperties((BaseNameable) resource, (BaseNameable) res); } } } return me; }
res.setId(subFilter.buildResourceId(res.getId(), res.getClass()));