From 6110093611ffd3310de30e08d44af47e26e7b1ec Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 28 Jun 2010 15:33:09 +0400 Subject: [PATCH 1/5] write thread dumps every 5 seconds by default --- .../intellij/diagnostic/PerformanceWatcher.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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; } } From 398d972e8428511056ed2951904e716c4b0bb8cb Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 28 Jun 2010 15:48:20 +0400 Subject: [PATCH 2/5] correct cancellation of spellchecker inspections (PY-1148) --- .../com/intellij/spellchecker/inspections/BaseSplitter.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java index 5b50a19288fa..4d93c7da29ea 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java @@ -134,11 +134,7 @@ public abstract class BaseSplitter implements Splitter { } public static void checkCancelled() { - try { - ProgressManager.checkCanceled(); - } - catch (Throwable ignored) { - } + ProgressManager.checkCanceled(); } From ccebb1517f7f973bd635f6d65b4519b8e595150d Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 28 Jun 2010 15:50:24 +0400 Subject: [PATCH 3/5] optimize imports --- .../src/com/intellij/spellchecker/inspections/BaseSplitter.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java b/plugins/spellchecker/src/com/intellij/spellchecker/inspections/BaseSplitter.java index 4d93c7da29ea..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; From bb6f7abd8f214fc79e5e2fdbba7ddd3e29f9d912 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 28 Jun 2010 16:56:32 +0400 Subject: [PATCH 4/5] move extension declaration to correct place (PY-1155) --- platform/platform-resources/src/META-INF/LangExtensions.xml | 2 -- resources/src/META-INF/IdeaPlugin.xml | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) 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/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"/> - + + + From 72f0a61596fe3a83cd217a80ede048a5705e9f31 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 28 Jun 2010 19:40:13 +0400 Subject: [PATCH 5/5] VCS shouldn't react on events of renaming a file to the same name (PY-1149) --- .../com/intellij/openapi/vcs/VcsVFSListener.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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); + } } } }