diff --git a/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java b/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java index 2eab2a25673a..9db084401813 100644 --- a/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java +++ b/platform/platform-impl/src/com/intellij/diagnostic/PerformanceWatcher.java @@ -54,6 +54,7 @@ public class PerformanceWatcher implements ApplicationComponent { private List myStacktraceCommonPart; private int UNRESPONSIVE_THRESHOLD = 5; + private int UNRESPONSIVE_INTERVAL = 5; @NotNull public String getComponentName() { @@ -72,7 +73,16 @@ public class PerformanceWatcher implements ApplicationComponent { // ignore } } - if (UNRESPONSIVE_THRESHOLD == 0) { + final String interval = System.getProperty("performance.watcher.interval"); + if (interval != null) { + try { + UNRESPONSIVE_INTERVAL = Integer.parseInt(interval); + } + catch (NumberFormatException e) { + // ignore + } + } + if (UNRESPONSIVE_THRESHOLD == 0 || UNRESPONSIVE_INTERVAL == 0) { return; } @@ -145,7 +155,7 @@ public class PerformanceWatcher implements ApplicationComponent { private void checkEDTResponsiveness() { while(true) { try { - if (myShutdownSemaphore.tryAcquire(1, TimeUnit.SECONDS)) { + if (myShutdownSemaphore.tryAcquire(UNRESPONSIVE_INTERVAL, TimeUnit.SECONDS)) { break; } } diff --git a/platform/platform-resources/src/META-INF/LangExtensions.xml b/platform/platform-resources/src/META-INF/LangExtensions.xml index 9afce29f90d7..fe87fed07bb1 100644 --- a/platform/platform-resources/src/META-INF/LangExtensions.xml +++ b/platform/platform-resources/src/META-INF/LangExtensions.xml @@ -435,8 +435,6 @@ com.intellij.codeInsight.intention.impl.EditFoldingOptionsAction - - diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/VcsVFSListener.java b/platform/vcs-api/src/com/intellij/openapi/vcs/VcsVFSListener.java index c8272d12d5c5..4a7c13ba3653 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/VcsVFSListener.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/VcsVFSListener.java @@ -20,9 +20,9 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.command.CommandAdapter; import com.intellij.openapi.command.CommandEvent; import com.intellij.openapi.command.CommandProcessor; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Comparing; import com.intellij.openapi.vcs.actions.VcsContextFactory; import com.intellij.openapi.vcs.changes.ChangeListManager; import com.intellij.openapi.vfs.*; @@ -276,10 +276,16 @@ public abstract class VcsVFSListener implements Disposable { public void beforePropertyChange(final VirtualFilePropertyEvent event) { if (!isEventIgnored(event) && event.getPropertyName().equalsIgnoreCase(VirtualFile.PROP_NAME)) { - final VirtualFile file = event.getFile(); - final VirtualFile parent = file.getParent(); - if (parent != null) { - addFileToMove(file, parent.getPath(), (String)event.getNewValue()); + String oldName = (String) event.getOldValue(); + String newName = (String) event.getNewValue(); + // in order to force a reparse of a file, the rename event can be fired with old name equal to new name - + // such events needn't be handled by the VCS + if (!Comparing.equal(oldName, newName)) { + final VirtualFile file = event.getFile(); + final VirtualFile parent = file.getParent(); + if (parent != null) { + addFileToMove(file, parent.getPath(), newName); + } } } } diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java index 5b50a19288fa..8d99251253ff 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java @@ -17,14 +17,12 @@ package com.intellij.spellchecker.inspections; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.util.TextRange; -import com.intellij.spellchecker.util.Strings; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.text.CharacterIterator; import java.text.StringCharacterIterator; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -134,11 +132,7 @@ public abstract class BaseSplitter implements Splitter { } public static void checkCancelled() { - try { - ProgressManager.checkCanceled(); - } - catch (Throwable ignored) { - } + ProgressManager.checkCanceled(); } diff --git a/resources/src/META-INF/IdeaPlugin.xml b/resources/src/META-INF/IdeaPlugin.xml index 2187842a6252..c4dba27916f4 100644 --- a/resources/src/META-INF/IdeaPlugin.xml +++ b/resources/src/META-INF/IdeaPlugin.xml @@ -1135,7 +1135,9 @@ serviceImplementation="com.intellij.profile.codeInspection.JavaAwareInspectionProfileManager"/> - + + +