Source:
public void splitAnnotation(final IAnnotationModel model, final int offset) { if (!contribtionAnnotationsEnabled) return; final List<ContributionAnnotation> annotationsToRemove = new ArrayList<ContributionAnnotation>(); final Map<ContributionAnnotation, Position> annotationsToAdd = new HashMap<ContributionAnnotation, Position>(); for (Iterator<Annotation> it = model.getAnnotationIterator(); it.hasNext(); ) { final Annotation annotation = it.next(); if (!(annotation instanceof ContributionAnnotation)) continue; final ContributionAnnotation contributionAnnotation = (ContributionAnnotation) annotation; final User source = contributionAnnotation.getSource(); final Position pos = model.getPosition(contributionAnnotation); if ((offset > pos.offset) && (offset < pos.offset + pos.length)) { final Position before = new Position(pos.offset, offset - pos.offset); final Position after = new Position(offset, pos.length - (offset - pos.offset)); annotationsToRemove.add(contributionAnnotation); final ContributionAnnotation beforeAnnotation = new ContributionAnnotation(source, model); final ContributionAnnotation afterAnnotation = new ContributionAnnotation(source, model); annotationsToAdd.put(beforeAnnotation, before); annotationsToAdd.put(afterAnnotation, after); final History history = getHistory(source); for (final ListIterator<HistoryEntry> lit = history.entries.listIterator(); lit.hasNext(); ) { final HistoryEntry entry = lit.next(); if (entry.annotation.equals(contributionAnnotation)) { final HistoryEntry beforeHistoryEntry = new HistoryEntry(beforeAnnotation, entry.insertStamp); final HistoryEntry afterHistoryEntry = new HistoryEntry(afterAnnotation, entry.insertStamp); lit.remove(); lit.add(afterHistoryEntry); lit.add(beforeHistoryEntry); break; } } } } annotationModelHelper.replaceAnnotationsInModel(model, annotationsToRemove, annotationsToAdd); }

Target:
public void splitAnnotation(final IAnnotationModel model, final int offset) { if (!contribtionAnnotationsEnabled) return; final List<ContributionAnnotation> annotationsToRemove = new ArrayList<ContributionAnnotation>(); final Map<ContributionAnnotation, Position> annotationsToAdd = new HashMap<ContributionAnnotation, Position>(); for (Iterator<Annotation> it = model.getAnnotationIterator(); it.hasNext(); ) { final Annotation annotation = it.next(); if (!(annotation instanceof ContributionAnnotation)) continue; final ContributionAnnotation contributionAnnotation = (ContributionAnnotation) annotation; final User source = contributionAnnotation.getSource(); final Position pos = model.getPosition(contributionAnnotation); if ((offset > pos.offset) && (offset < pos.offset + pos.length)) { final Position before = new Position(pos.offset, offset - pos.offset); final Position after = new Position(offset, pos.length - (offset - pos.offset)); annotationsToRemove.add(contributionAnnotation); final ContributionAnnotation beforeAnnotation = new ContributionAnnotation(source, model); final ContributionAnnotation afterAnnotation = new ContributionAnnotation(source, model); annotationsToAdd.put(beforeAnnotation, before); annotationsToAdd.put(afterAnnotation, after); replaceInHistory(contributionAnnotation, beforeAnnotation, afterAnnotation); } } annotationModelHelper.replaceAnnotationsInModel(model, annotationsToRemove, annotationsToAdd); }