ViewerAnnotator (@NotNull T viewer, @NotNull Side side) { TwosideViewerAnnotatorFactory<T> factory = this; Project project = viewer.getProject(); assert project != null; return new ViewerAnnotator() { @NotNull @Override public T getViewer() { return viewer; } @Override public boolean isAnnotationShown() { return factory.isAnnotationShown(viewer, side); } @Override public void showAnnotation(@NotNull AnnotationData data) { factory.showAnnotation(viewer, side, data); } @Override public void hideAnnotation() { factory.hideAnnotation(viewer, side); } @Nullable @Override public FileAnnotationLoader createAnnotationsLoader() { return createTwosideAnnotationsLoader(project, viewer.getRequest(), side); } @Override @NotNull public BackgroundableActionLock getBackgroundableLock() { return BackgroundableActionLock.getLock(viewer.getProject(), VcsBackgroundableActions.ANNOTATE, viewer, side); } }; }