From 7e5de1125ad957b97eec0ebab6d979c59ea3e101 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 27 Feb 2013 15:36:46 +0400 Subject: [PATCH 1/7] cleanup --- .../src/com/intellij/ide/wizard/AbstractWizard.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/platform/platform-api/src/com/intellij/ide/wizard/AbstractWizard.java b/platform/platform-api/src/com/intellij/ide/wizard/AbstractWizard.java index 2dafd653b7fa..cd0ff214d453 100644 --- a/platform/platform-api/src/com/intellij/ide/wizard/AbstractWizard.java +++ b/platform/platform-api/src/com/intellij/ide/wizard/AbstractWizard.java @@ -361,7 +361,7 @@ public abstract class AbstractWizard extends DialogWrapper { // Commit data of current step final Step currentStep = mySteps.get(myCurrentStep); LOG.assertTrue(currentStep != null); - LOG.assertTrue(!isLastStep()); + LOG.assertTrue(!isLastStep(), "steps: " + mySteps + " current: " + currentStep); try { currentStep._commit(false); } @@ -522,8 +522,4 @@ public abstract class AbstractWizard extends DialogWrapper { @Nullable @NonNls protected abstract String getHelpID(); - - protected boolean isCurrentStep(final T step) { - return step != null && getCurrentStepComponent() == step.getComponent(); - } } From 200a3dc9ad320649923abbde391d1e4349c6d796 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 27 Feb 2013 15:39:24 +0400 Subject: [PATCH 2/7] diagnostics for EA-44279 - assert: AnchorReference.resolve --- xml/impl/src/com/intellij/xml/util/AnchorReference.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/xml/util/AnchorReference.java b/xml/impl/src/com/intellij/xml/util/AnchorReference.java index 5bae0f65d68e..def10cfa8217 100644 --- a/xml/impl/src/com/intellij/xml/util/AnchorReference.java +++ b/xml/impl/src/com/intellij/xml/util/AnchorReference.java @@ -87,7 +87,7 @@ public class AnchorReference implements PsiReference, EmptyResolveMessageProvide attribute = tag.getAttribute("usemap"); } - assert attribute != null; + assert attribute != null: tag.getText(); return attribute.getValueElement(); } From f21285e673e741627d523f80c0a381b79fea7a5e Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Wed, 27 Feb 2013 13:06:20 +0100 Subject: [PATCH 3/7] exceptions while editing file in editor --- .../ide/diff/VirtualFileDiffElement.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/diff/VirtualFileDiffElement.java b/platform/platform-impl/src/com/intellij/ide/diff/VirtualFileDiffElement.java index d1247fb21d7d..8d80ff89e4f5 100644 --- a/platform/platform-impl/src/com/intellij/ide/diff/VirtualFileDiffElement.java +++ b/platform/platform-impl/src/com/intellij/ide/diff/VirtualFileDiffElement.java @@ -19,7 +19,7 @@ import com.intellij.ide.presentation.VirtualFilePresentation; import com.intellij.ide.util.PropertiesComponent; import com.intellij.openapi.actionSystem.DataProvider; import com.intellij.openapi.actionSystem.PlatformDataKeys; -import com.intellij.openapi.application.ex.ApplicationManagerEx; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diff.DiffRequest; import com.intellij.openapi.editor.Document; import com.intellij.openapi.fileChooser.FileChooser; @@ -34,6 +34,7 @@ import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.PlatformIcons; +import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -278,12 +279,17 @@ public class VirtualFileDiffElement extends DiffElement { } if (!docsToSave.isEmpty()) { - ApplicationManagerEx.getApplicationEx().runEdtSafeAction(new Runnable() { + UIUtil.invokeAndWaitIfNeeded(new Runnable() { @Override public void run() { - for (Document document : docsToSave) { - manager.saveDocument(document); - } + ApplicationManager.getApplication().runWriteAction(new Runnable() { + @Override + public void run() { + for (Document document : docsToSave) { + manager.saveDocument(document); + } + } + }); } }); } From deafc829828ba938af8a233d4a08abf8374ff19f Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 27 Feb 2013 16:25:03 +0400 Subject: [PATCH 4/7] EA-43374 - assert: XmlTagImpl$.runInner --- .../codeInsight/completion/ExtendedTagInsertHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java b/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java index 644dcb93a2cd..7d990565655f 100644 --- a/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java +++ b/xml/impl/src/com/intellij/codeInsight/completion/ExtendedTagInsertHandler.java @@ -155,7 +155,7 @@ public class ExtendedTagInsertHandler extends XmlTagInsertHandler { final PsiElement tag = element.getParent(); if (tag instanceof XmlTag) { final String prefix = ((XmlTag)tag).getNamespacePrefix(); - if (!prefix.equals(namespacePrefix)) { + if (!prefix.equals(namespacePrefix) && StringUtil.isNotEmpty(namespacePrefix)) { final String name = namespacePrefix + ":" + ((XmlTag)tag).getLocalName(); try { ((XmlTag)tag).setName(name); From 95f8e79ab8f1a215821b86cec52e1e4cdba5b6be Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 27 Feb 2013 16:04:22 +0400 Subject: [PATCH 5/7] Rename method According to a review comment CR-IC-84 --- .../src/com/intellij/ui/EditorTextFieldProviderImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ui/EditorTextFieldProviderImpl.java b/platform/lang-impl/src/com/intellij/ui/EditorTextFieldProviderImpl.java index b92d780e7970..1bf409178e7a 100644 --- a/platform/lang-impl/src/com/intellij/ui/EditorTextFieldProviderImpl.java +++ b/platform/lang-impl/src/com/intellij/ui/EditorTextFieldProviderImpl.java @@ -94,11 +94,11 @@ public class EditorTextFieldProviderImpl implements EditorTextFieldProvider { EditorSettings settings = ex.getSettings(); settings.setAdditionalColumnsCount(3); settings.setVirtualSpace(false); - applyFeatures(ex); + applyCustomizations(ex); return ex; } - private void applyFeatures(@NotNull EditorEx editor) { + private void applyCustomizations(@NotNull EditorEx editor) { for (EditorCustomization customization : myCustomizations) { customization.customize(editor); } From 6070c4c285871998568ee6d2f7bbb23403a12d76 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 27 Feb 2013 16:07:37 +0400 Subject: [PATCH 6/7] add javadoc statement --- .../src/com/intellij/ui/EditorTextFieldProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/ui/EditorTextFieldProvider.java b/platform/platform-impl/src/com/intellij/ui/EditorTextFieldProvider.java index 3bf5cecf9b74..a67ed714b295 100644 --- a/platform/platform-impl/src/com/intellij/ui/EditorTextFieldProvider.java +++ b/platform/platform-impl/src/com/intellij/ui/EditorTextFieldProvider.java @@ -32,7 +32,7 @@ public interface EditorTextFieldProvider { * * @param language target language used by document that will be displayed by returned editor * @param project target project - * @return + * @return {@link EditorTextField} with specified customizations applied to its editor. */ @NotNull EditorTextField getEditorField(@NotNull Language language, @NotNull Project project, @NotNull Iterable features); From bf343ccd4014660644bbe0721f61910976697196 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Wed, 27 Feb 2013 16:09:19 +0400 Subject: [PATCH 7/7] new HashSet() -> ContainerUtil.newHashSet According to a review comment in CR-IC-84. --- .../openapi/vcs/changes/ui/NewEditChangelistPanel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java index 58add2e8a032..1fa2184c734c 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java @@ -28,10 +28,10 @@ import com.intellij.openapi.vcs.changes.LocalChangeList; import com.intellij.spellchecker.ui.SpellCheckingEditorCustomization; import com.intellij.ui.*; import com.intellij.util.Consumer; +import com.intellij.util.containers.ContainerUtil; import javax.swing.*; import java.awt.*; -import java.util.HashSet; import java.util.Set; public abstract class NewEditChangelistPanel extends JPanel { @@ -163,7 +163,7 @@ public abstract class NewEditChangelistPanel extends JPanel { final EditorTextFieldProvider service = ServiceManager.getService(project, EditorTextFieldProvider.class); final EditorTextField editorField; - final Set editorFeatures = new HashSet(); + final Set editorFeatures = ContainerUtil.newHashSet(); editorFeatures.add(SpellCheckingEditorCustomization.ENABLED); if (defaultLines == 1) {