From 639e90a5d91c977f3fcf0e6fed8e7795608e99c0 Mon Sep 17 00:00:00 2001 From: Danila Ponomarenko Date: Fri, 1 Jun 2012 19:57:20 +0400 Subject: [PATCH 1/9] 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)); } From 1c06d7099c905a7ecb5f0bcaad8fe8051f0b8ab7 Mon Sep 17 00:00:00 2001 From: Danila Ponomarenko Date: Fri, 1 Jun 2012 20:34:40 +0400 Subject: [PATCH 2/9] CollectionFactory: java.util only --- .../src/com/intellij/util/containers/CollectionFactory.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/util/src/com/intellij/util/containers/CollectionFactory.java b/platform/util/src/com/intellij/util/containers/CollectionFactory.java index 897a40b98810..11f0326cc6fd 100644 --- a/platform/util/src/com/intellij/util/containers/CollectionFactory.java +++ b/platform/util/src/com/intellij/util/containers/CollectionFactory.java @@ -20,6 +20,8 @@ import gnu.trove.THashSet; import org.jetbrains.annotations.NotNull; import java.util.*; +import java.util.Stack; +import java.util.HashSet; /** * @author peter From aa66aee347be97752ef5e1fc8d7c5b4262015650 Mon Sep 17 00:00:00 2001 From: Danila Ponomarenko Date: Fri, 1 Jun 2012 21:16:51 +0400 Subject: [PATCH 3/9] unnecessary sor removed --- .../folding/impl/RecursiveMethodCallFoldingBuilder.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/folding/impl/RecursiveMethodCallFoldingBuilder.java b/java/java-impl/src/com/intellij/codeInsight/folding/impl/RecursiveMethodCallFoldingBuilder.java index b846f2ee6ecd..a333490c0fad 100644 --- a/java/java-impl/src/com/intellij/codeInsight/folding/impl/RecursiveMethodCallFoldingBuilder.java +++ b/java/java-impl/src/com/intellij/codeInsight/folding/impl/RecursiveMethodCallFoldingBuilder.java @@ -55,13 +55,6 @@ public class RecursiveMethodCallFoldingBuilder extends FoldingBuilderEx { } }); - Collections.sort(result, new Comparator() { - @Override - public int compare(FoldingDescriptor o1, FoldingDescriptor o2) { - return o2.getRange().getStartOffset() - o1.getRange().getStartOffset(); - } - }); - return result.toArray(new FoldingDescriptor[result.size()]); } From 040877b66bbafbdef091e36b6377342e8206dd98 Mon Sep 17 00:00:00 2001 From: Anton Makeev Date: Fri, 25 May 2012 14:38:56 +0200 Subject: [PATCH 4/9] AppCode: xcode templates reworked --- .../fileTypes/impl/NativeFileIconProvider.java | 9 +++++++-- .../com/intellij/openapi/util/io/FileUtil.java | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/NativeFileIconProvider.java b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/NativeFileIconProvider.java index 2793909588ed..cbb83407d81c 100644 --- a/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/NativeFileIconProvider.java +++ b/platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/NativeFileIconProvider.java @@ -80,10 +80,10 @@ public class NativeFileIconProvider implements FileIconProvider { assert SwingComponentHolder.ourFileChooser != null || !ApplicationManager.getApplication().isReadAccessAllowed(); if (SystemInfo.isMac && virtualFile.isDirectory() && (flags & Iconable.ICON_FLAG_OPEN) == Iconable.ICON_FLAG_OPEN) { - icon = Foundation.isPackageAtPath(f) ? SwingComponentHolder.ourFileChooser.getIcon(f) : DIR_OPEN_ICON; + icon = Foundation.isPackageAtPath(f) ? getNativeIcon(f) : DIR_OPEN_ICON; } else { - icon = SwingComponentHolder.ourFileChooser.getIcon(f); + icon = getNativeIcon(f); } } catch (Exception e) { // see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4854174 @@ -104,6 +104,11 @@ public class NativeFileIconProvider implements FileIconProvider { }); } + @Nullable + public static Icon getNativeIcon(@Nullable File file) { + return file == null ? null : SwingComponentHolder.ourFileChooser.getIcon(file); + } + private static Ext getExtension(final VirtualFile file, final int flags) { if (file.isDirectory()) { if (file.getExtension() == null) { diff --git a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java index 05e7d2fa2c36..f47ea423c48e 100644 --- a/platform/util/src/com/intellij/openapi/util/io/FileUtil.java +++ b/platform/util/src/com/intellij/openapi/util/io/FileUtil.java @@ -48,10 +48,26 @@ public class FileUtil extends FileUtilRt { @NonNls public static final String ASYNC_DELETE_EXTENSION = ".__del__"; + public static final int REGEX_PATTERN_FLAGS = SystemInfo.isFileSystemCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE; + @SuppressWarnings({"unchecked"}) public static final TObjectHashingStrategy PATH_HASHING_STRATEGY = SystemInfo.isFileSystemCaseSensitive ? TObjectHashingStrategy.CANONICAL : CaseInsensitiveStringHashingStrategy.INSTANCE; + @SuppressWarnings({"unchecked"}) + public static final TObjectHashingStrategy FILE_HASHING_STRATEGY = + SystemInfo.isFileSystemCaseSensitive ? TObjectHashingStrategy.CANONICAL : new TObjectHashingStrategy() { + @Override + public int computeHashCode(File object) { + return fileHashCode(object); + } + + @Override + public boolean equals(File o1, File o2) { + return filesEqual(o1, o2); + } + }; + private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.util.io.FileUtil"); // do not use channels to copy files larger than 5 Mb because of possible MapFailed error From 78b97e9eaf3b796316b15afbec2bb2388ba1abc9 Mon Sep 17 00:00:00 2001 From: Evgeny Zakrevsky Date: Mon, 4 Jun 2012 14:38:12 +0400 Subject: [PATCH 5/9] bug with setting default titled border in internal mode --- .../src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java b/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java index b5526f0efab4..1c5ce1debadc 100644 --- a/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java +++ b/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java @@ -860,7 +860,7 @@ public class AsmCodeGenerator { Type borderFactoryType = ourBorderFactoryType; StringDescriptor borderFactoryValue = (StringDescriptor)container.getDelegeeClientProperties().get(ourBorderFactoryClientProperty); - if (borderFactoryValue == null && Boolean.valueOf(System.getProperty("idea.is.internal")).booleanValue()) { + if (borderFactoryValue == null && borderTitle != null && Boolean.valueOf(System.getProperty("idea.is.internal")).booleanValue()) { borderFactoryValue = StringDescriptor.create("com.intellij.ui.IdeBorderFactory$PlainSmallWithIndent"); container.getDelegeeClientProperties().put(ourBorderFactoryClientProperty, borderFactoryValue); } From 4df280152eb1af66d420bc8e3c4e7efd8bd6dfb4 Mon Sep 17 00:00:00 2001 From: Evgeny Zakrevsky Date: Mon, 4 Jun 2012 14:38:52 +0400 Subject: [PATCH 6/9] commit dialog. summary panel. vertical indents reduced. --- .../intellij/openapi/vcs/changes/ui/CommitLegendPanel.form | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.form b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.form index d3128787f259..e6e87fd95f7d 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.form +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.form @@ -77,8 +77,8 @@ - - + + From 47992a3ef343df974fe1e872e60a0729b02007b3 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 4 Jun 2012 13:27:32 +0400 Subject: [PATCH 7/9] notnull --- .../intellij/openapi/roots/impl/libraries/LibraryTableBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTableBase.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTableBase.java index 1e67ae55dca6..6ef5b0ef7520 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTableBase.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryTableBase.java @@ -144,7 +144,7 @@ public abstract class LibraryTableBase implements PersistentStateComponent Date: Mon, 4 Jun 2012 13:29:03 +0400 Subject: [PATCH 8/9] cleanup --- .../testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/java-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java b/java/java-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java index ea3b243b8132..09f913884a1a 100644 --- a/java/java-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java +++ b/java/java-tests/testSrc/com/intellij/psi/PsiDocumentManagerImplTest.java @@ -167,7 +167,7 @@ public class PsiDocumentManagerImplTest extends PlatformTestCase { assertEquals(0, getPsiDocumentManager().getUncommittedDocuments().length); } - public void testDocumentFromAlienProjectDoesNotEndsUpInMyUncommittedList() throws Exception { + public void testDocumentFromAlienProjectDoesNotEndUpInMyUncommittedList() throws Exception { PsiFile file = getPsiManager().findFile(createFile()); final Document document = getPsiDocumentManager().getDocument(file); From 84d77c47cc2aae72a64e32dc226eecc6eeb18d65 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Mon, 4 Jun 2012 14:58:15 +0400 Subject: [PATCH 9/9] notnull --- .../intellij/codeHighlighting/TextEditorHighlightingPass.java | 4 ++-- .../com/intellij/codeInsight/daemon/impl/CodeFoldingPass.java | 2 +- .../intellij/codeInsight/daemon/impl/ExternalToolPass.java | 2 +- .../codeInsight/daemon/impl/IdentifierHighlighterPass.java | 3 ++- .../src/com/intellij/codeInsight/daemon/impl/IndentsPass.java | 2 +- .../codeInsight/daemon/impl/InjectedCodeFoldingPass.java | 2 +- .../intellij/codeInsight/daemon/impl/PassExecutorService.java | 2 +- .../daemon/impl/ProgressableTextEditorHighlightingPass.java | 4 ++-- .../intellij/codeInsight/daemon/impl/ShowAutoImportPass.java | 2 +- .../intellij/codeInsight/daemon/impl/ShowIntentionsPass.java | 2 +- .../intellij/codeInsight/daemon/impl/SlowLineMarkersPass.java | 2 +- .../framework/detection/impl/FrameworkDetectionManager.java | 2 +- .../changeSignature/ChangeSignaturePassFactory.java | 2 +- .../src/com/intellij/codeHighlighting/HighlightingPass.java | 3 ++- .../com/intellij/testAssistant/TestDataHighlightingPass.java | 2 +- .../codeInspection/local/GroovyPostHighlightingPass.java | 2 +- .../src/com/intellij/uiDesigner/FormHighlightingPass.java | 3 ++- .../designer/inspection/DesignerHighlightingPass.java | 3 ++- .../impl/tagTreeHighlighting/XmlTagTreeHighlightingPass.java | 2 +- 19 files changed, 25 insertions(+), 21 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeHighlighting/TextEditorHighlightingPass.java b/platform/lang-impl/src/com/intellij/codeHighlighting/TextEditorHighlightingPass.java index fcda8e15f6b2..7c7a123b3d5d 100644 --- a/platform/lang-impl/src/com/intellij/codeHighlighting/TextEditorHighlightingPass.java +++ b/platform/lang-impl/src/com/intellij/codeHighlighting/TextEditorHighlightingPass.java @@ -56,7 +56,7 @@ public abstract class TextEditorHighlightingPass implements HighlightingPass { } @Override - public final void collectInformation(ProgressIndicator progress) { + public final void collectInformation(@NotNull ProgressIndicator progress) { if (!isValid()) return; //Document has changed. myDumb = DumbService.getInstance(myProject).isDumb(); doCollectInformation(progress); @@ -103,7 +103,7 @@ public abstract class TextEditorHighlightingPass implements HighlightingPass { doApplyInformationToEditor(); } - public abstract void doCollectInformation(ProgressIndicator progress); + public abstract void doCollectInformation(@NotNull ProgressIndicator progress); public abstract void doApplyInformationToEditor(); public final int getId() { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CodeFoldingPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CodeFoldingPass.java index fb45fc8a99ca..444f8828fb4b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CodeFoldingPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CodeFoldingPass.java @@ -41,7 +41,7 @@ class CodeFoldingPass extends TextEditorHighlightingPass implements DumbAware { } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { final boolean firstTime = isFirstTime(myFile, myEditor, THE_FIRST_TIME); Runnable runnable = CodeFoldingManager.getInstance(myProject).updateFoldRegionsAsync(myEditor, firstTime); synchronized (this) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ExternalToolPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ExternalToolPass.java index d4e0af3d53bb..d27979e12eb9 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ExternalToolPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ExternalToolPass.java @@ -80,7 +80,7 @@ public class ExternalToolPass extends TextEditorHighlightingPass { } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { myDocumentChanged = false; final FileViewProvider viewProvider = myFile.getViewProvider(); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java index ed30584fb855..2012c5c95773 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java @@ -42,6 +42,7 @@ import com.intellij.psi.search.LocalSearchScope; import com.intellij.psi.search.searches.ReferencesSearch; import com.intellij.util.Processor; import com.intellij.util.containers.ContainerUtil; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Collection; @@ -71,7 +72,7 @@ public class IdentifierHighlighterPass extends TextEditorHighlightingPass { } @Override - public void doCollectInformation(final ProgressIndicator progress) { + public void doCollectInformation(@NotNull final ProgressIndicator progress) { if (!CodeInsightSettings.getInstance().HIGHLIGHT_IDENTIFIER_UNDER_CARET) { return; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPass.java index 5ecaffe59ff1..9f1627f4134e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IndentsPass.java @@ -204,7 +204,7 @@ public class IndentsPass extends TextEditorHighlightingPass implements DumbAware } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { final Long stamp = myEditor.getUserData(LAST_TIME_INDENTS_BUILT); if (stamp != null && stamp.longValue() == nowStamp()) return; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPass.java index 5656cd52ece6..10128243f6ad 100755 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPass.java @@ -40,7 +40,7 @@ class InjectedCodeFoldingPass extends TextEditorHighlightingPass implements Dumb } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { boolean firstTime = CodeFoldingPass.isFirstTime(myFile, myEditor, THE_FIRST_TIME_KEY); Runnable runnable = FoldingUpdate.updateInjectedFoldRegions(myEditor, myFile, firstTime); synchronized (this) { diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PassExecutorService.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PassExecutorService.java index 92ff1f1579f8..8a27bba247ab 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PassExecutorService.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PassExecutorService.java @@ -125,7 +125,7 @@ public abstract class PassExecutorService implements Disposable { // run all passes in sequence textEditorHighlightingPass = new TextEditorHighlightingPass(myProject, document, true) { @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { pass.collectInformation(progress); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ProgressableTextEditorHighlightingPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ProgressableTextEditorHighlightingPass.java index 9bc2df392651..dcb582d517bd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ProgressableTextEditorHighlightingPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ProgressableTextEditorHighlightingPass.java @@ -53,7 +53,7 @@ public abstract class ProgressableTextEditorHighlightingPass extends TextEditorH } @Override - public final void doCollectInformation(final ProgressIndicator progress) { + public final void doCollectInformation(@NotNull final ProgressIndicator progress) { myFinished = false; collectInformationWithProgress(progress); repaintTrafficIcon(); @@ -130,7 +130,7 @@ public abstract class ProgressableTextEditorHighlightingPass extends TextEditorH } @Override - public void doCollectInformation(final ProgressIndicator progress) { + public void doCollectInformation(@NotNull final ProgressIndicator progress) { } @Override diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowAutoImportPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowAutoImportPass.java index 821887e40166..7b1b03ed7228 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowAutoImportPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowAutoImportPass.java @@ -62,7 +62,7 @@ public class ShowAutoImportPass extends TextEditorHighlightingPass { } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { } @Override diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java index e90c7b8589b5..f593f86153e8 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java @@ -120,7 +120,7 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass { } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { if (!ApplicationManager.getApplication().isUnitTestMode() && !myEditor.getContentComponent().hasFocus()) return; TemplateState state = TemplateManagerImpl.getTemplateState(myEditor); if (state != null && !state.isFinished()) return; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/SlowLineMarkersPass.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/SlowLineMarkersPass.java index e2951c895e7f..e4cb967c8a2e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/SlowLineMarkersPass.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/SlowLineMarkersPass.java @@ -53,7 +53,7 @@ public class SlowLineMarkersPass extends TextEditorHighlightingPass implements L } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { final FileViewProvider viewProvider = myFile.getViewProvider(); final Set relevantLanguages = viewProvider.getLanguages(); List markers = new SmartList(); diff --git a/platform/lang-impl/src/com/intellij/framework/detection/impl/FrameworkDetectionManager.java b/platform/lang-impl/src/com/intellij/framework/detection/impl/FrameworkDetectionManager.java index b4d34918eed4..753f20e571b0 100644 --- a/platform/lang-impl/src/com/intellij/framework/detection/impl/FrameworkDetectionManager.java +++ b/platform/lang-impl/src/com/intellij/framework/detection/impl/FrameworkDetectionManager.java @@ -302,7 +302,7 @@ public class FrameworkDetectionManager extends AbstractProjectComponent implemen } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { ensureIndexIsUpToDate(myDetectors); } diff --git a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignaturePassFactory.java b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignaturePassFactory.java index 069fa045c2bc..4d0b995831e5 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignaturePassFactory.java +++ b/platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignaturePassFactory.java @@ -74,7 +74,7 @@ public class ChangeSignaturePassFactory extends AbstractProjectComponent impleme } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { myRange = null; final ChangeSignatureGestureDetector detector = ChangeSignatureGestureDetector.getInstance(myProject); final ChangeInfo changeInfo = detector.getInitialChangeInfo(myFile); diff --git a/platform/platform-api/src/com/intellij/codeHighlighting/HighlightingPass.java b/platform/platform-api/src/com/intellij/codeHighlighting/HighlightingPass.java index 9ad648783ee6..447d4f414b04 100644 --- a/platform/platform-api/src/com/intellij/codeHighlighting/HighlightingPass.java +++ b/platform/platform-api/src/com/intellij/codeHighlighting/HighlightingPass.java @@ -16,6 +16,7 @@ package com.intellij.codeHighlighting; import com.intellij.openapi.progress.ProgressIndicator; +import org.jetbrains.annotations.NotNull; public interface HighlightingPass { HighlightingPass[] EMPTY_ARRAY = new HighlightingPass[0]; @@ -27,7 +28,7 @@ public interface HighlightingPass { * @param progress to check for highlighting process is cancelled. Pass is to check progress.isCanceled() as often as possible and * throw {@link com.intellij.openapi.progress.ProcessCanceledException} if true is returned. */ - void collectInformation(ProgressIndicator progress); + void collectInformation(@NotNull ProgressIndicator progress); /** * Called to apply information collected by {@linkplain #collectInformation(com.intellij.openapi.progress.ProgressIndicator)} to the editor. diff --git a/plugins/IdeaTestAssistant/src/com/intellij/testAssistant/TestDataHighlightingPass.java b/plugins/IdeaTestAssistant/src/com/intellij/testAssistant/TestDataHighlightingPass.java index 04e4a6978641..e3d1fc96ddb3 100644 --- a/plugins/IdeaTestAssistant/src/com/intellij/testAssistant/TestDataHighlightingPass.java +++ b/plugins/IdeaTestAssistant/src/com/intellij/testAssistant/TestDataHighlightingPass.java @@ -47,7 +47,7 @@ public class TestDataHighlightingPass extends TextEditorHighlightingPass { } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { } @Override diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/local/GroovyPostHighlightingPass.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/local/GroovyPostHighlightingPass.java index 899389f03bf9..57b5ddc97398 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/local/GroovyPostHighlightingPass.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/local/GroovyPostHighlightingPass.java @@ -84,7 +84,7 @@ public class GroovyPostHighlightingPass extends TextEditorHighlightingPass { myEditor = editor; } - public void doCollectInformation(final ProgressIndicator progress) { + public void doCollectInformation(@NotNull final ProgressIndicator progress) { final InspectionProfile profile = InspectionProjectProfileManager.getInstance(myProject).getInspectionProfile(); final boolean deadCodeEnabled = profile.isToolEnabled(HighlightDisplayKey.find(GroovyUnusedDeclarationInspection.SHORT_NAME), myFile); ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex(); diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/FormHighlightingPass.java b/plugins/ui-designer/src/com/intellij/uiDesigner/FormHighlightingPass.java index e3b7c898a49b..dae49482b998 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/FormHighlightingPass.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/FormHighlightingPass.java @@ -20,6 +20,7 @@ import com.intellij.codeHighlighting.HighlightingPass; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.uiDesigner.designSurface.GuiEditor; import com.intellij.uiDesigner.propertyInspector.UIDesignerToolWindowManager; +import org.jetbrains.annotations.NotNull; /** * @author yole @@ -31,7 +32,7 @@ public class FormHighlightingPass implements HighlightingPass { myEditor = editor; } - public void collectInformation(ProgressIndicator progress) { + public void collectInformation(@NotNull ProgressIndicator progress) { ErrorAnalyzer.analyzeErrors(myEditor, myEditor.getRootContainer(), progress); } diff --git a/plugins/ui-designer/ui-designer-new/src/com/intellij/designer/inspection/DesignerHighlightingPass.java b/plugins/ui-designer/ui-designer-new/src/com/intellij/designer/inspection/DesignerHighlightingPass.java index f74c9db181ae..20ef0504d9e8 100644 --- a/plugins/ui-designer/ui-designer-new/src/com/intellij/designer/inspection/DesignerHighlightingPass.java +++ b/plugins/ui-designer/ui-designer-new/src/com/intellij/designer/inspection/DesignerHighlightingPass.java @@ -19,6 +19,7 @@ import com.intellij.codeHighlighting.HighlightingPass; import com.intellij.designer.DesignerToolWindowManager; import com.intellij.designer.designSurface.DesignerEditorPanel; import com.intellij.openapi.progress.ProgressIndicator; +import org.jetbrains.annotations.NotNull; /** * @author Alexander Lobas @@ -31,7 +32,7 @@ public final class DesignerHighlightingPass implements HighlightingPass { } @Override - public void collectInformation(ProgressIndicator progress) { + public void collectInformation(@NotNull ProgressIndicator progress) { myDesigner.loadInspections(progress); } diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPass.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPass.java index 9e3aedfa4525..6e7bc131bedd 100644 --- a/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPass.java +++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/tagTreeHighlighting/XmlTagTreeHighlightingPass.java @@ -74,7 +74,7 @@ public class XmlTagTreeHighlightingPass extends TextEditorHighlightingPass { } @Override - public void doCollectInformation(ProgressIndicator progress) { + public void doCollectInformation(@NotNull ProgressIndicator progress) { if (ApplicationManager.getApplication().isUnitTestMode()) { return; }