From f70ef96e1464b010349da4fbb361971b05e8266c Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Mon, 23 Sep 2013 19:14:28 +0400 Subject: [PATCH 1/4] EA-50139 - assert: TextRange. --- .../codeInsight/editorActions/moveUpDown/XmlMover.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xml/impl/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMover.java b/xml/impl/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMover.java index 98e646c5b8a9..770ac7a1b868 100644 --- a/xml/impl/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMover.java +++ b/xml/impl/src/com/intellij/codeInsight/editorActions/moveUpDown/XmlMover.java @@ -19,6 +19,7 @@ import com.intellij.lang.injection.InjectedLanguageManager; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.util.TextRange; +import com.intellij.openapi.util.UnfairTextRange; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiNamedElement; @@ -106,7 +107,7 @@ class XmlMover extends LineMover { movedLineStart = updateMovedRegionStart(document, movedLineStart, textRange.getStartOffset(), info, down); } - final TextRange moveDestinationRange = new TextRange( + final TextRange moveDestinationRange = new UnfairTextRange( document.getLineStartOffset(info.toMove2.startLine), document.getLineEndOffset(info.toMove2.endLine - 1) ); From dc82859e7e13e7ea79a03ee5459bcddc7492f977 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Tue, 24 Sep 2013 10:34:55 +0400 Subject: [PATCH 2/4] cleanup --- .../intellij/openapi/fileTypes/impl/FileTypeConfigurable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java index 6ac59b224dbd..37e7089dc5a9 100644 --- a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java +++ b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java @@ -154,7 +154,7 @@ public class FileTypeConfigurable extends BaseConfigurable implements Searchable @Override public boolean isModified() { if (!myManager.isIgnoredFilesListEqualToCurrent(myFileTypePanel.myIgnoreFilesField.getText())) return true; - HashSet types = new HashSet(Arrays.asList(getModifiableFileTypes())); + HashSet types = new HashSet(Arrays.asList(getModifiableFileTypes())); return !myTempPatternsTable.equals(myManager.getExtensionMap()) || !myTempFileTypes.equals(types) || !myOriginalToEditedMap.isEmpty() || !myTempTemplateDataLanguages.equals(TemplateDataLanguagePatterns.getInstance().getAssocTable()); From 99563ea54844dc48631f24c46520e9b72de489c7 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Tue, 24 Sep 2013 10:38:18 +0400 Subject: [PATCH 3/4] EA-49418 - NPE: InjectLanguageAction.invokeImpl --- .../plugins/intelliLang/inject/InjectLanguageAction.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java index 0d6a2be57bf5..bc54939ff202 100644 --- a/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java +++ b/plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java @@ -192,8 +192,10 @@ public class InjectLanguageAction implements IntentionAction { JBPopup popup = new PopupChooserBuilder(list).setItemChoosenCallback(new Runnable() { public void run() { Injectable value = (Injectable)list.getSelectedValue(); - onChosen.process(value); - PropertiesComponent.getInstance().setValue(LAST_INJECTED_LANGUAGE, value.getId()); + if (value != null) { + onChosen.process(value); + PropertiesComponent.getInstance().setValue(LAST_INJECTED_LANGUAGE, value.getId()); + } } }).setFilteringEnabled(new Function() { @Override From 5cd2b376d2032e338fc5380fe97111d2b020deb1 Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Tue, 24 Sep 2013 10:42:56 +0400 Subject: [PATCH 4/4] assertion for EA-45385 - NPE: XmlTagImpl.getDescriptor --- .../src/com/intellij/psi/impl/source/xml/XmlTagImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java index c986bb1ebb25..b030815ad2a4 100644 --- a/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java +++ b/xml/xml-psi-impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java @@ -296,7 +296,7 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag { final String schemaLocationDeclaration = getAttributeValue("schemaLocation", XmlUtil.XML_SCHEMA_INSTANCE_URI); if (noNamespaceDeclaration != null) { - map = initializeSchema(XmlUtil.EMPTY_URI, null, noNamespaceDeclaration, map); + map = initializeSchema(XmlUtil.EMPTY_URI, null, noNamespaceDeclaration, null); } if (schemaLocationDeclaration != null) { final StringTokenizer tokenizer = new StringTokenizer(schemaLocationDeclaration); @@ -334,7 +334,7 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag { return null; } - private Map> initializeSchema(final String namespace, + private Map> initializeSchema(final @NotNull String namespace, @Nullable final String version, final String fileLocation, Map> map) { @@ -422,7 +422,7 @@ public class XmlTagImpl extends XmlElementImpl implements XmlTag { } @Nullable - private PsiMetaOwner retrieveOwner(final XmlFile file, final String namespace) { + private PsiMetaOwner retrieveOwner(final XmlFile file, final @NotNull String namespace) { if (file == null) { return namespace.equals(XmlUtil.getTargetSchemaNsFromTag(this)) ? this : null; }