/** Pair method to {@link #annotate}. It releases all resources. */ private void release() { editorUI.removePropertyChangeListener(this); textComponent.removeComponentListener(this); doc.removeDocumentListener(this); caret.removeChangeListener(this); if (caretTimer != null) { caretTimer.removeActionListener(this); } elementAnnotations = Collections.<Element, AnnotateLine>emptyMap(); previousRevisions = null; originalFiles = null; // cancel running annotation task if active if (latestAnnotationTask != null) { latestAnnotationTask.cancel(); } AnnotationMarkProvider amp = AnnotationMarkInstaller.getMarkProvider(textComponent); if (amp != null) { amp.setMarks(Collections.<AnnotationMark>emptyList()); } clearRecentFeedback(); }