mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: LST - @NotNull
This commit is contained in:
@@ -58,29 +58,29 @@ public class LineStatusTracker {
|
||||
private final Object myLock = new Object();
|
||||
private BaseLoadState myBaseLoaded;
|
||||
|
||||
private final Document myDocument;
|
||||
private final Document myVcsDocument;
|
||||
@NotNull private final Document myDocument;
|
||||
@NotNull private final Document myVcsDocument;
|
||||
|
||||
private List<Range> myRanges;
|
||||
@NotNull private List<Range> myRanges;
|
||||
|
||||
private final Project myProject;
|
||||
@NotNull private final Project myProject;
|
||||
|
||||
private MyDocumentListener myDocumentListener;
|
||||
|
||||
private boolean mySuppressUpdate;
|
||||
private boolean myBulkUpdate;
|
||||
private final Application myApplication;
|
||||
@NotNull private final Application myApplication;
|
||||
@Nullable private RevisionPack myBaseRevisionNumber;
|
||||
private boolean myAnathemaThrown;
|
||||
private FileEditorManager myFileEditorManager;
|
||||
private final VcsDirtyScopeManager myVcsDirtyScopeManager;
|
||||
private final VirtualFile myVirtualFile;
|
||||
@NotNull private final FileEditorManager myFileEditorManager;
|
||||
@NotNull private final VcsDirtyScopeManager myVcsDirtyScopeManager;
|
||||
@NotNull private final VirtualFile myVirtualFile;
|
||||
private boolean myReleased = false;
|
||||
|
||||
private LineStatusTracker(@NotNull final Document document,
|
||||
@NotNull final Document vcsDocument,
|
||||
final Project project,
|
||||
@Nullable final VirtualFile virtualFile) {
|
||||
@NotNull final Project project,
|
||||
@NotNull final VirtualFile virtualFile) {
|
||||
myVirtualFile = virtualFile;
|
||||
myApplication = ApplicationManager.getApplication();
|
||||
myDocument = document;
|
||||
@@ -153,8 +153,8 @@ public class LineStatusTracker {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"AutoBoxing"})
|
||||
private RangeHighlighter createHighlighter(final Range range) {
|
||||
@NotNull
|
||||
private RangeHighlighter createHighlighter(@NotNull Range range) {
|
||||
LOG.assertTrue(!myReleased, "Already released");
|
||||
|
||||
int first =
|
||||
@@ -205,10 +205,12 @@ public class LineStatusTracker {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Document getDocument() {
|
||||
return myDocument;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public VirtualFile getVirtualFile() {
|
||||
return myVirtualFile;
|
||||
}
|
||||
@@ -412,6 +414,7 @@ public class LineStatusTracker {
|
||||
Range lastRangeBefore = ContainerUtil.getLastItem(rangesBefore);
|
||||
Range firstRangeAfter = ContainerUtil.getFirstItem(rangesAfter);
|
||||
|
||||
//noinspection UnnecessaryLocalVariable
|
||||
int afterChangedLine1 = beforeChangedLine1;
|
||||
int afterChangedLine2 = beforeChangedLine2 + linesShift;
|
||||
|
||||
@@ -435,7 +438,7 @@ public class LineStatusTracker {
|
||||
if (!range.hasHighlighter()) range.setHighlighter(createHighlighter(range));
|
||||
}
|
||||
|
||||
if (myRanges.isEmpty() && myVirtualFile != null) {
|
||||
if (myRanges.isEmpty()) {
|
||||
markFileUnchanged();
|
||||
}
|
||||
}
|
||||
@@ -869,7 +872,7 @@ public class LineStatusTracker {
|
||||
}
|
||||
}
|
||||
|
||||
public static LineStatusTracker createOn(@Nullable VirtualFile virtualFile, @NotNull final Document doc, final Project project) {
|
||||
public static LineStatusTracker createOn(@NotNull VirtualFile virtualFile, @NotNull final Document doc, final Project project) {
|
||||
final Document document = new DocumentImpl("", true);
|
||||
return new LineStatusTracker(doc, document, project, virtualFile);
|
||||
}
|
||||
@@ -880,6 +883,7 @@ public class LineStatusTracker {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ import java.util.List;
|
||||
*/
|
||||
|
||||
public class RangesBuilder {
|
||||
private List<Range> myRanges;
|
||||
@NotNull private final List<Range> myRanges;
|
||||
|
||||
public RangesBuilder(@NotNull Document current, @NotNull Document vcs) throws FilesTooBigForDiffException {
|
||||
this(new DocumentWrapper(current).getLines(), new DocumentWrapper(vcs).getLines(), 0, 0);
|
||||
@@ -47,8 +47,8 @@ public class RangesBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<Range> getRanges() {
|
||||
return myRanges;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ import com.intellij.util.concurrency.QueueProcessorRemovePartner;
|
||||
import com.intellij.util.containers.HashMap;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -75,7 +76,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
return PeriodicalTasksCloser.getInstance().safeGetComponent(project, LineStatusTrackerManagerI.class);
|
||||
}
|
||||
|
||||
private final Project myProject;
|
||||
@NotNull private final Project myProject;
|
||||
|
||||
private final Map<Document, LineStatusTracker> myLineStatusTrackers;
|
||||
// !!! no state queries and self lock for add/remove
|
||||
@@ -84,18 +85,18 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
|
||||
@NonNls protected static final String IGNORE_CHANGEMARKERS_KEY = "idea.ignore.changemarkers";
|
||||
|
||||
private final ProjectLevelVcsManager myVcsManager;
|
||||
private final VcsBaseContentProvider myStatusProvider;
|
||||
private final Application myApplication;
|
||||
private final FileEditorManager myFileEditorManager;
|
||||
private final Disposable myDisposable;
|
||||
@NotNull private final ProjectLevelVcsManager myVcsManager;
|
||||
@NotNull private final VcsBaseContentProvider myStatusProvider;
|
||||
@NotNull private final Application myApplication;
|
||||
@NotNull private final FileEditorManager myFileEditorManager;
|
||||
@NotNull private final Disposable myDisposable;
|
||||
private long myLoadCounter;
|
||||
|
||||
public LineStatusTrackerManager(final Project project,
|
||||
final ProjectLevelVcsManager vcsManager,
|
||||
final VcsBaseContentProvider statusProvider,
|
||||
final Application application,
|
||||
final FileEditorManager fileEditorManager,
|
||||
public LineStatusTrackerManager(@NotNull final Project project,
|
||||
@NotNull final ProjectLevelVcsManager vcsManager,
|
||||
@NotNull final VcsBaseContentProvider statusProvider,
|
||||
@NotNull final Application application,
|
||||
@NotNull final FileEditorManager fileEditorManager,
|
||||
@SuppressWarnings("UnusedParameters") DirectoryIndex makeSureIndexIsInitializedFirst) {
|
||||
myLoadCounter = 0;
|
||||
myProject = project;
|
||||
@@ -218,7 +219,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
}
|
||||
}
|
||||
|
||||
private void releaseTracker(final Document document) {
|
||||
private void releaseTracker(@NotNull final Document document) {
|
||||
if ((!myProject.isOpen()) || myProject.isDisposed()) return;
|
||||
|
||||
synchronized (myLock) {
|
||||
@@ -230,7 +231,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
}
|
||||
}
|
||||
|
||||
private boolean shouldBeInstalled(final VirtualFile virtualFile) {
|
||||
private boolean shouldBeInstalled(@Nullable final VirtualFile virtualFile) {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
|
||||
if (virtualFile == null || virtualFile instanceof LightVirtualFile) return false;
|
||||
@@ -251,7 +252,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
return true;
|
||||
}
|
||||
|
||||
private void installTracker(final VirtualFile virtualFile, final Document document) {
|
||||
private void installTracker(@NotNull final VirtualFile virtualFile, @NotNull final Document document) {
|
||||
synchronized (myLock) {
|
||||
if (myLineStatusTrackers.containsKey(document)) return;
|
||||
assert !myPartner.containsKey(document);
|
||||
@@ -263,7 +264,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
}
|
||||
}
|
||||
|
||||
private void startAlarm(final Document document, final VirtualFile virtualFile) {
|
||||
private void startAlarm(@NotNull final Document document, @NotNull final VirtualFile virtualFile) {
|
||||
myApplication.assertReadAccessAllowed();
|
||||
|
||||
synchronized (myLock) {
|
||||
@@ -272,10 +273,10 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
}
|
||||
|
||||
private class BaseRevisionLoader implements Runnable {
|
||||
private final VirtualFile myVirtualFile;
|
||||
private final Document myDocument;
|
||||
@NotNull private final VirtualFile myVirtualFile;
|
||||
@NotNull private final Document myDocument;
|
||||
|
||||
private BaseRevisionLoader(final Document document, final VirtualFile virtualFile) {
|
||||
private BaseRevisionLoader(@NotNull final Document document, @NotNull final VirtualFile virtualFile) {
|
||||
myDocument = document;
|
||||
myVirtualFile = virtualFile;
|
||||
}
|
||||
@@ -323,7 +324,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
nonModalAliveInvokeLater(runnable);
|
||||
}
|
||||
|
||||
private void nonModalAliveInvokeLater(Runnable runnable) {
|
||||
private void nonModalAliveInvokeLater(@NotNull Runnable runnable) {
|
||||
myApplication.invokeLater(runnable, ModalityState.NON_MODAL, new Condition() {
|
||||
@Override
|
||||
public boolean value(final Object ignore) {
|
||||
@@ -378,6 +379,7 @@ public class LineStatusTrackerManager implements ProjectComponent, LineStatusTra
|
||||
@Override
|
||||
public void run() {
|
||||
if (shouldBeInstalled(virtualFile)) {
|
||||
assert virtualFile != null;
|
||||
installTracker(virtualFile, document);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user