diff --git a/jps/model/src/org/jetbrains/ether/dependencyView/IntIntPersistentMultiMaplet.java b/jps/model/src/org/jetbrains/ether/dependencyView/IntIntPersistentMultiMaplet.java index 181d6ccb6d98..4c1224a7c2b3 100644 --- a/jps/model/src/org/jetbrains/ether/dependencyView/IntIntPersistentMultiMaplet.java +++ b/jps/model/src/org/jetbrains/ether/dependencyView/IntIntPersistentMultiMaplet.java @@ -78,7 +78,7 @@ class IntIntPersistentMultiMaplet extends IntIntMultiMaplet { public void replace(int key, TIntHashSet value) { try { myCache.remove(key); - if (value == null || value.size() == 0) { + if (value == null || value.isEmpty()) { myMap.remove(key); } else { diff --git a/jps/model/src/org/jetbrains/ether/dependencyView/IntIntTransientMultiMaplet.java b/jps/model/src/org/jetbrains/ether/dependencyView/IntIntTransientMultiMaplet.java index a88f27ef5641..b92bbc5d7922 100644 --- a/jps/model/src/org/jetbrains/ether/dependencyView/IntIntTransientMultiMaplet.java +++ b/jps/model/src/org/jetbrains/ether/dependencyView/IntIntTransientMultiMaplet.java @@ -56,7 +56,7 @@ class IntIntTransientMultiMaplet extends IntIntMultiMaplet { @Override public void replace(int key, TIntHashSet value) { - if (value == null || value.size() == 0) { + if (value == null || value.isEmpty()) { myMap.remove(key); } else { diff --git a/jps/model/src/org/jetbrains/ether/dependencyView/IntObjectPersistentMultiMaplet.java b/jps/model/src/org/jetbrains/ether/dependencyView/IntObjectPersistentMultiMaplet.java index d2978f49021c..ee2a57226846 100644 --- a/jps/model/src/org/jetbrains/ether/dependencyView/IntObjectPersistentMultiMaplet.java +++ b/jps/model/src/org/jetbrains/ether/dependencyView/IntObjectPersistentMultiMaplet.java @@ -83,7 +83,7 @@ class IntObjectPersistentMultiMaplet extends IntObjectMult public void replace(int key, Collection value) { try { myCache.remove(key); - if (value == null) { + if (value == null || value.isEmpty()) { myMap.remove(key); } else { diff --git a/jps/model/src/org/jetbrains/ether/dependencyView/IntObjectTransientMultiMaplet.java b/jps/model/src/org/jetbrains/ether/dependencyView/IntObjectTransientMultiMaplet.java index 830bdae198f5..c9a8b889a441 100644 --- a/jps/model/src/org/jetbrains/ether/dependencyView/IntObjectTransientMultiMaplet.java +++ b/jps/model/src/org/jetbrains/ether/dependencyView/IntObjectTransientMultiMaplet.java @@ -55,7 +55,7 @@ class IntObjectTransientMultiMaplet extends IntObjectMulti @Override public void replace(int key, Collection value) { - if (value == null) { + if (value == null || value.isEmpty()) { myMap.remove(key); } else { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java index dfbc027222fb..b81e09416b14 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2012 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -144,12 +144,14 @@ public class ReformatCodeAction extends AnAction implements DumbAware { boolean optimizeImports = ReformatFilesDialog.isOptmizeImportsOptionOn(); boolean processWholeFile = false; boolean processChangedTextOnly = false; - if (EditorSettingsExternalizable.getInstance().getOptions().SHOW_REFORMAT_DIALOG || (file == null && dir != null)) { + final boolean showDialog = EditorSettingsExternalizable.getInstance().getOptions().SHOW_REFORMAT_DIALOG; + if (showDialog || (file == null && dir != null)) { final LayoutCodeDialog dialog = new LayoutCodeDialog(project, CodeInsightBundle.message("process.reformat.code"), file, dir, hasSelection ? Boolean.TRUE : Boolean.FALSE, HELP_ID); dialog.show(); if (!dialog.isOK()) return; - EditorSettingsExternalizable.getInstance().getOptions().SHOW_REFORMAT_DIALOG = !dialog.isDoNotAskMe(); + final boolean showDialogAtFuture = dir == null ? !dialog.isDoNotAskMe() : processChangedTextOnly; + EditorSettingsExternalizable.getInstance().getOptions().SHOW_REFORMAT_DIALOG = showDialogAtFuture; updateShowDialogSetting(dialog, "\"Reformat Code\" dialog disabled"); optimizeImports = dialog.isOptimizeImports(); processWholeFile = dialog.isProcessWholeFile();