From 639e90a5d91c977f3fcf0e6fed8e7795608e99c0 Mon Sep 17 00:00:00 2001 From: Danila Ponomarenko Date: Fri, 1 Jun 2012 19:57:20 +0400 Subject: [PATCH] CollectionFactory: factory methods added. Got rid of Guava dependency --- .../psi/impl/light/LightModifierList.java | 2 +- .../NaturalLanguageTextSelectioner.java | 4 +- .../impl/UpdateFoldRegionsOperation.java | 8 +- .../template/impl/ListTemplatesHandler.java | 2 +- .../console/ConsoleFoldingSettings.java | 2 +- .../impl/id/PlatformIdTableBuilding.java | 2 +- .../com/intellij/notification/EventLog.java | 2 +- .../wm/impl/ToolWindowManagerImpl.java | 2 +- .../testFramework/LightPlatformTestCase.java | 2 +- .../util/containers/CollectionFactory.java | 141 ++++++++++++------ .../lang/completion/GroovyCompletionUtil.java | 2 +- .../completion/weighers/GrKindWeigher.java | 2 +- .../groovy/lang/psi/util/GdkMethodUtil.java | 2 +- .../groovy/mvc/MvcModuleStructureUtil.java | 4 +- .../convertToJava/StubGenerator.java | 2 +- .../plugins/groovy/spock/SpockTest.groovy | 2 +- .../maven/compiler/MavenResourceCompiler.java | 2 +- .../idea/maven/dom/MavenDomUtil.java | 2 +- .../maven/execution/MavenResumeAction.java | 2 +- .../idea/maven/project/MavenProject.java | 2 +- .../AddToCompositeCollectionInvocation.java | 2 +- 21 files changed, 124 insertions(+), 67 deletions(-) diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/light/LightModifierList.java b/java/java-psi-impl/src/com/intellij/psi/impl/light/LightModifierList.java index 7f274a4ea7d7..e3ff814bad09 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/light/LightModifierList.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/light/LightModifierList.java @@ -40,7 +40,7 @@ public class LightModifierList extends LightElement implements PsiModifierList { public LightModifierList(PsiManager manager, final Language language, String... modifiers) { super(manager, language); - myModifiers = CollectionFactory.newTroveSet(modifiers); + myModifiers = CollectionFactory.troveSet(modifiers); } public void addModifier(String modifier) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/wordSelection/NaturalLanguageTextSelectioner.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/wordSelection/NaturalLanguageTextSelectioner.java index 9243eb22685d..3e9ec968c08b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/wordSelection/NaturalLanguageTextSelectioner.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/wordSelection/NaturalLanguageTextSelectioner.java @@ -31,8 +31,8 @@ import java.util.List; import java.util.Set; public class NaturalLanguageTextSelectioner extends ExtendWordSelectionHandlerBase { - private static final Set NATURAL = CollectionFactory.newTroveSet('(', ')', '.', ',', ':', ';', '!', '?', '$', '@', '%', '\"', '\''); - private static final Set SENTENCE_END = CollectionFactory.newTroveSet('.', '!', '?'); + private static final Set NATURAL = CollectionFactory.troveSet('(', ')', '.', ',', ':', ';', '!', '?', '$', '@', '%', '\"', '\''); + private static final Set SENTENCE_END = CollectionFactory.troveSet('.', '!', '?'); public boolean canSelect(PsiElement e) { return e instanceof PsiPlainText || e instanceof PsiComment; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java index a88aca1d01c9..7250bd6314b4 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java @@ -36,7 +36,7 @@ import java.util.List; import java.util.Map; import static com.intellij.util.containers.CollectionFactory.arrayList; -import static com.intellij.util.containers.CollectionFactory.newTroveMap; +import static com.intellij.util.containers.CollectionFactory.troveMap; /** * @author cdr @@ -70,12 +70,12 @@ class UpdateFoldRegionsOperation implements Runnable { public void run() { EditorFoldingInfo info = EditorFoldingInfo.get(myEditor); FoldingModelEx foldingModel = (FoldingModelEx)myEditor.getFoldingModel(); - Map rangeToExpandStatusMap = newTroveMap(); + Map rangeToExpandStatusMap = troveMap(); removeInvalidRegions(info, foldingModel, rangeToExpandStatusMap); - Map shouldExpand = newTroveMap(); - Map groupExpand = newTroveMap(); + Map shouldExpand = troveMap(); + Map groupExpand = troveMap(); List newRegions = addNewRegions(info, foldingModel, rangeToExpandStatusMap, shouldExpand, groupExpand); applyExpandStatus(newRegions, shouldExpand, groupExpand); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/ListTemplatesHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/ListTemplatesHandler.java index 7841f165e3a3..bd01e4e1f4fa 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/ListTemplatesHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/ListTemplatesHandler.java @@ -96,7 +96,7 @@ public class ListTemplatesHandler implements CodeInsightActionHandler { if (description == null) { return super.getAllLookupStrings(); } - return CollectionFactory.newSet(getLookupString(), description); + return CollectionFactory.hashSet(getLookupString(), description); } }; } diff --git a/platform/lang-impl/src/com/intellij/execution/console/ConsoleFoldingSettings.java b/platform/lang-impl/src/com/intellij/execution/console/ConsoleFoldingSettings.java index 828b6f574c28..b0665954529f 100644 --- a/platform/lang-impl/src/com/intellij/execution/console/ConsoleFoldingSettings.java +++ b/platform/lang-impl/src/com/intellij/execution/console/ConsoleFoldingSettings.java @@ -70,7 +70,7 @@ public class ConsoleFoldingSettings implements PersistentStateComponent added, List removed, boolean negated) { - Set baseline = CollectionFactory.newTroveSet(); + Set baseline = CollectionFactory.troveSet(); for (CustomizableConsoleFoldingBean regexp : CustomizableConsoleFoldingBean.EP_NAME.getExtensions()) { if (regexp.negate == negated) { baseline.add(regexp.substring); diff --git a/platform/lang-impl/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java b/platform/lang-impl/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java index c190dbb7fa82..2faaf0a649e4 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/cache/impl/id/PlatformIdTableBuilding.java @@ -126,7 +126,7 @@ public abstract class PlatformIdTableBuilding { @NotNull @Override public Map map(FileContent inputData) { - Map result = CollectionFactory.newTroveMap(); + Map result = CollectionFactory.troveMap(); for (DataIndexer indexer : indexers) { for (Map.Entry entry : indexer.map(inputData).entrySet()) { TodoIndexEntry key = entry.getKey(); diff --git a/platform/platform-impl/src/com/intellij/notification/EventLog.java b/platform/platform-impl/src/com/intellij/notification/EventLog.java index 99f50ee18360..a0233b7afbee 100644 --- a/platform/platform-impl/src/com/intellij/notification/EventLog.java +++ b/platform/platform-impl/src/com/intellij/notification/EventLog.java @@ -73,7 +73,7 @@ public class EventLog implements Notifications { private static final String A_CLOSING = ""; private static final Pattern TAG_PATTERN = Pattern.compile("<[^>]*>"); private static final Pattern A_PATTERN = Pattern.compile("]* )?href=[\"\']([^>]*)[\"\'][^>]*>"); - private static final Set NEW_LINES = CollectionFactory.newSet("
", "
", "
", "

", "

", "

"); + private static final Set NEW_LINES = CollectionFactory.hashSet("
", "
", "
", "

", "

", "

"); public EventLog() { ApplicationManager.getApplication().getMessageBus().connect().subscribe(Notifications.TOPIC, this); diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java index 8a75838fcdaf..43a23655bba6 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java @@ -93,7 +93,7 @@ public final class ToolWindowManagerImpl extends ToolWindowManagerEx implements private final HashMap myId2FloatingDecorator; private final HashMap myId2StripeButton; private final HashMap myId2FocusWatcher; - private final Set myDumbAwareIds = Collections.synchronizedSet(CollectionFactory.newTroveSet()); + private final Set myDumbAwareIds = Collections.synchronizedSet(CollectionFactory.troveSet()); private final EditorComponentFocusWatcher myEditorComponentFocusWatcher; private final MyToolWindowPropertyChangeListener myToolWindowPropertyChangeListener; diff --git a/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java b/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java index 4d768aeb94ca..8154d996b0e6 100644 --- a/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java +++ b/platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java @@ -793,7 +793,7 @@ public abstract class LightPlatformTestCase extends UsefulTestCase implements Da final String[] myUrls = mySdk.getRootProvider().getUrls(OrderRootType.CLASSES); final String[] newUrls = newSdk.getRootProvider().getUrls(OrderRootType.CLASSES); - return CollectionFactory.newSet(myUrls).equals(CollectionFactory.newSet(newUrls)); + return CollectionFactory.hashSet(myUrls).equals(CollectionFactory.hashSet(newUrls)); } } diff --git a/platform/util/src/com/intellij/util/containers/CollectionFactory.java b/platform/util/src/com/intellij/util/containers/CollectionFactory.java index 9028cff937f4..897a40b98810 100644 --- a/platform/util/src/com/intellij/util/containers/CollectionFactory.java +++ b/platform/util/src/com/intellij/util/containers/CollectionFactory.java @@ -15,16 +15,11 @@ */ package com.intellij.util.containers; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; import gnu.trove.THashMap; import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; import java.util.*; -import java.util.HashMap; -import java.util.Stack; /** * @author peter @@ -33,34 +28,118 @@ public class CollectionFactory { private CollectionFactory() { } - public static Set newSet(T... elements) { - return new HashSet(Arrays.asList(elements)); + @NotNull + public static Set hashSet() { + return new HashSet(); } - public static Set newTroveSet(T... elements) { - return newTroveSet(Arrays.asList(elements)); + @NotNull + public static Set hashSet(@NotNull Collection elements) { + return new HashSet(elements); } - public static Set newTroveSet(Collection elements) { + @NotNull + public static Set hashSet(@NotNull T... elements) { + return hashSet(Arrays.asList(elements)); + } + + public static LinkedHashSet linkedHashSet() { + return new LinkedHashSet(); + } + + @NotNull + public static Set troveSet(@NotNull T... elements) { + return troveSet(Arrays.asList(elements)); + } + + @NotNull + public static Set troveSet(@NotNull Collection elements) { return new THashSet(elements); } - public static T[] ar(T... elements) { - return elements; + @NotNull + public static TreeSet treeSet() { + return new TreeSet(); } - public static THashMap newTroveMap() { - return new THashMap(); + @NotNull + public static TreeSet treeSet(@NotNull Collection elements) { + return new TreeSet(elements); } + @NotNull + public static TreeSet treeSet(@NotNull T... elements) { + return treeSet(Arrays.asList(elements)); + } + + @NotNull + public static TreeSet treeSet(@NotNull Comparator comparator) { + return new TreeSet(comparator); + } + + @NotNull + public static Set unmodifiableHashSet(@NotNull T... elements) { + return unmodifiableHashSet(Arrays.asList(elements)); + } + + @NotNull + public static Set unmodifiableHashSet(@NotNull Collection elements) { + return Collections.unmodifiableSet(hashSet(elements)); + } + + @NotNull + public static HashMap hashMap() { + return new HashMap(); + } + + @NotNull + public static TreeMap treeMap() { + return new TreeMap(); + } + + @NotNull + public static THashMap troveMap() { + return new THashMap(); + } + + public static LinkedHashMap linkedHashMap() { + return new LinkedHashMap(); + } + + @NotNull + public static Map hashMap(@NotNull final List keys, @NotNull final List values) { + if (keys.size() != values.size()) { + throw new IllegalArgumentException(keys + " should have same length as " + values); + } + + final HashMap map = new HashMap(); + for (int i = 0; i < keys.size(); ++i) { + map.put(keys.get(i), values.get(i)); + } + return map; + } + + @NotNull public static ArrayList arrayList() { - return Lists.newArrayList(); + return new ArrayList(); } + @NotNull + public static ArrayList arrayList(int initialCapacity) { + return new ArrayList(initialCapacity); + } + + @NotNull + public static ArrayList arrayList(Collection elements) { + return new ArrayList(elements); + } + + @NotNull public static ArrayList arrayList(T... elements) { - return new ArrayList(Arrays.asList(elements)); + return arrayList(Arrays.asList(elements)); } + @NotNull public static List arrayList(@NotNull final T[] elements, final int start, final int end) { if (start < 0 || start > end || end > elements.length) throw new IllegalArgumentException("start:" + start + " end:" + end + " length:" + elements.length); @@ -80,35 +159,13 @@ public class CollectionFactory { }; } + @NotNull public static Stack stack() { return new Stack(); } - public static Set hashSet() { - return Sets.newHashSet(); - } - - public static Map hashMap() { - return Maps.newHashMap(); - } - - public static Map hashMap(@NotNull final List keys, @NotNull final List values) { - if (keys.size() != values.size()) { - throw new IllegalArgumentException(keys + " should have some length as " + values); - } - - final HashMap map = Maps.newHashMap(); - for (int i = 0; i < keys.size(); ++i) { - map.put(keys.get(i), values.get(i)); - } - return map; - } - - public static LinkedHashMap linkedMap() { - return Maps.newLinkedHashMap(); - } - - public static LinkedHashSet linkedHashSet() { - return Sets.newLinkedHashSet(); + @NotNull + public static T[] ar(@NotNull T... elements) { + return elements; } } diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyCompletionUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyCompletionUtil.java index 007f387c176a..fb0bfef5c72e 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyCompletionUtil.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyCompletionUtil.java @@ -448,7 +448,7 @@ public class GroovyCompletionUtil { return TailType.insertChar(editor, offset, ')'); } - public static final Set OPERATOR_METHOD_NAMES = CollectionFactory.newSet( + public static final Set OPERATOR_METHOD_NAMES = CollectionFactory.hashSet( "plus", "minus", "multiply", "power", "div", "mod", "or", "and", "xor", "next", "previous", "getAt", "putAt", "leftShift", "rightShift", "isCase", "bitwiseNegate", "negative", "positive", "call" ); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/weighers/GrKindWeigher.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/weighers/GrKindWeigher.java index 442255bd8359..dd469ca38610 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/weighers/GrKindWeigher.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/weighers/GrKindWeigher.java @@ -41,7 +41,7 @@ import java.util.Set; */ public class GrKindWeigher extends CompletionWeigher { private static final Set TRASH_CLASSES = new HashSet(10); - private static final Set PRIORITY_KEYWORDS = CollectionFactory.newSet( + private static final Set PRIORITY_KEYWORDS = CollectionFactory.hashSet( PsiKeyword.RETURN, PsiKeyword.INSTANCEOF, "in", PsiKeyword.PRIVATE, PsiKeyword.PROTECTED, PsiKeyword.PUBLIC, PsiKeyword.STATIC, "def", PsiKeyword.TRUE, PsiKeyword.FALSE, PsiKeyword.NULL); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GdkMethodUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GdkMethodUtil.java index 6ec188bf83e5..360fdb2c63cd 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GdkMethodUtil.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GdkMethodUtil.java @@ -44,7 +44,7 @@ public class GdkMethodUtil { private static final Logger LOG = Logger.getInstance(GdkMethodUtil.class); - public static final Set COLLECTION_METHOD_NAMES = CollectionFactory.newSet( + public static final Set COLLECTION_METHOD_NAMES = CollectionFactory.hashSet( "each", "eachWithIndex", "any", "every", "reverseEach", "collect", "collectAll", "find", "findAll", "retainAll", "removeAll", "split", "groupBy", "groupEntriesBy", "findLastIndexOf", "findIndexValues", "findIndexOf" ); diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureUtil.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureUtil.java index 2f9bd16b5223..f8992644e1e5 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureUtil.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcModuleStructureUtil.java @@ -331,8 +331,8 @@ public class MvcModuleStructureUtil { } private static void removeInvalidSourceRoots(List> actions, MvcProjectStructure structure) { - final Set toRemove = CollectionFactory.newTroveSet(); - final Set toRemoveContent = CollectionFactory.newTroveSet(); + final Set toRemove = CollectionFactory.troveSet(); + final Set toRemoveContent = CollectionFactory.troveSet(); for (ContentEntry entry : ModuleRootManager.getInstance(structure.myModule).getContentEntries()) { final VirtualFile file = entry.getFile(); if (file == null || !structure.isValidContentRoot(file)) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/convertToJava/StubGenerator.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/convertToJava/StubGenerator.java index 3eaeda43530f..8bb3a4e6d155 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/convertToJava/StubGenerator.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/convertToJava/StubGenerator.java @@ -167,7 +167,7 @@ public class StubGenerator implements ClassItemGenerator { return Collections.emptySet(); } - final Set result = CollectionFactory.newTroveSet(ArrayUtil.EMPTY_STRING_ARRAY); + final Set result = CollectionFactory.troveSet(ArrayUtil.EMPTY_STRING_ARRAY); for (PsiClassType type : chainedConstructor.getThrowsList().getReferencedTypes()) { StringBuilder builder = new StringBuilder(); writeType(builder, substitutor.substitute(type), constructor, classNameProvider); diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/spock/SpockTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/spock/SpockTest.groovy index c0709e8e3860..16756d18eed4 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/spock/SpockTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/spock/SpockTest.groovy @@ -190,7 +190,7 @@ class FooSpec extends spock.lang.Specification { assertNotNull(lookupElements); - Set missedVariants = CollectionFactory.newSet(expectedVariants); + Set missedVariants = CollectionFactory.hashSet(expectedVariants); for (LookupElement lookupElement : lookupElements) { missedVariants.remove(lookupElement.getLookupString()); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java index 02f08aa522ab..5aeb6f81c74f 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java @@ -59,7 +59,7 @@ import java.util.regex.Pattern; public class MavenResourceCompiler implements ClassPostProcessingCompiler { private static final Key> FILES_TO_DELETE_KEY = Key.create(MavenResourceCompiler.class.getSimpleName() + ".FILES_TO_DELETE"); - private static final Set DEFAULT_NON_FILTERED_EXTENSIONS = CollectionFactory.newSet("jpg", "jpeg", "gif", "bmp", "png"); + private static final Set DEFAULT_NON_FILTERED_EXTENSIONS = CollectionFactory.hashSet("jpg", "jpeg", "gif", "bmp", "png"); private Map> myOutputItemsCache = new THashMap>(); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomUtil.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomUtil.java index a25bd7878b26..b1906ff44f2b 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomUtil.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomUtil.java @@ -58,7 +58,7 @@ import java.util.regex.Pattern; public class MavenDomUtil { // see http://maven.apache.org/settings.html - private static final Set SUBTAGS_IN_SETTINGS_FILE = CollectionFactory.newSet("localRepository", "interactiveMode", + private static final Set SUBTAGS_IN_SETTINGS_FILE = CollectionFactory.hashSet("localRepository", "interactiveMode", "usePluginRegistry", "offline", "pluginGroups", "servers", "mirrors", "proxies", "profiles", "activeProfiles"); diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenResumeAction.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenResumeAction.java index 43885c5a6ecc..1c728d3a4d17 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenResumeAction.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenResumeAction.java @@ -51,7 +51,7 @@ public class MavenResumeAction extends AnAction { private static final Logger LOG = Logger.getInstance(MavenResumeAction.class); - private static final Set PARAMS_DISABLING_RESUME = CollectionFactory.newSet("-rf", "-resume-from", "-pl", "-projects", "-am", + private static final Set PARAMS_DISABLING_RESUME = CollectionFactory.hashSet("-rf", "-resume-from", "-pl", "-projects", "-am", "-also-make", "-amd", "-also-make-dependents"); public static final int STATE_INITIAL = 0; diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProject.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProject.java index b49f872d8fcd..92e24a4e976e 100644 --- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProject.java +++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProject.java @@ -617,7 +617,7 @@ public class MavenProject { @NotNull public Set getSupportedPackagings() { - Set result = CollectionFactory.newSet(MavenConstants.TYPE_POM, + Set result = CollectionFactory.hashSet(MavenConstants.TYPE_POM, MavenConstants.TYPE_JAR, "ejb", "ejb-client", "war", "ear", "bundle", "maven-plugin"); for (MavenImporter each : getSuitableImporters()) { diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/AddToCompositeCollectionInvocation.java b/xml/dom-impl/src/com/intellij/util/xml/impl/AddToCompositeCollectionInvocation.java index 85793f8269a1..f0e5e67fae0b 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/AddToCompositeCollectionInvocation.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/AddToCompositeCollectionInvocation.java @@ -37,7 +37,7 @@ class AddToCompositeCollectionInvocation implements Invocation { } public Object invoke(final DomInvocationHandler handler, final Object[] args) throws Throwable { - Set set = CollectionFactory.newTroveSet(); + Set set = CollectionFactory.troveSet(); for (final CollectionChildDescriptionImpl qname : myQnames) { set.addAll(qname.getTagsGetter().fun(handler)); }