diff --git a/platform/lang-impl/src/com/intellij/ide/actions/RelatedItemLineMarkerGotoAdapter.java b/platform/lang-impl/src/com/intellij/ide/actions/RelatedItemLineMarkerGotoAdapter.java index b1e0e71d1b07..a701e8133062 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/RelatedItemLineMarkerGotoAdapter.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/RelatedItemLineMarkerGotoAdapter.java @@ -74,7 +74,9 @@ public class RelatedItemLineMarkerGotoAdapter extends GotoRelatedProvider { continue; } } - ContainerUtil.addIfNotNull(element.getContainingFile(), addedFiles); + if (element != null) { + ContainerUtil.addIfNotNull(element.getContainingFile(), addedFiles); + } result.add(item); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/project/FileContentQueue.java b/platform/platform-impl/src/com/intellij/openapi/project/FileContentQueue.java index 6eac681acb32..c506347723cd 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/FileContentQueue.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/FileContentQueue.java @@ -23,7 +23,6 @@ import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.vfs.InvalidVirtualFileAccessException; import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -100,21 +99,19 @@ public class FileContentQueue { boolean counterUpdated = false; try { - if (contentLength < PersistentFS.MAX_INTELLISENSE_FILESIZE) { - synchronized (this) { - while (myTotalSize > SIZE_THRESHOLD) { - if (indicator != null) { - indicator.checkCanceled(); - } - wait(300); + synchronized (this) { + while (myTotalSize > SIZE_THRESHOLD) { + if (indicator != null) { + indicator.checkCanceled(); } - myTotalSize += contentLength; - counterUpdated = true; + wait(300); } - - content.getBytes(); // Reads the content bytes and caches them. + myTotalSize += contentLength; + counterUpdated = true; } + content.getBytes(); // Reads the content bytes and caches them. + return true; } catch (Throwable e) { @@ -191,14 +188,12 @@ public class FileContentQueue { } return null; } - if (result.getLength() < PersistentFS.MAX_INTELLISENSE_FILESIZE) { - synchronized (this) { - try { - myTotalSize -= result.getLength(); - } - finally { - notifyAll(); - } + synchronized (this) { + try { + myTotalSize -= result.getLength(); + } + finally { + notifyAll(); } } diff --git a/plugins/git4idea/src/git4idea/actions/GitResolveConflictsAction.java b/plugins/git4idea/src/git4idea/actions/GitResolveConflictsAction.java index 895624d9804c..34363cc9709c 100644 --- a/plugins/git4idea/src/git4idea/actions/GitResolveConflictsAction.java +++ b/plugins/git4idea/src/git4idea/actions/GitResolveConflictsAction.java @@ -44,6 +44,9 @@ public class GitResolveConflictsAction extends GitAction { } }); for (Change change : ChangeListManager.getInstance(project).getAllChanges()) { + if (change.getFileStatus() != FileStatus.MERGED_WITH_CONFLICTS) { + continue; + } final ContentRevision before = change.getBeforeRevision(); final ContentRevision after = change.getAfterRevision(); if (before != null) {