performance
authorAlexey Kudravtsev <cdr@intellij.com>
Wed, 7 Jul 2010 09:00:31 +0000 (13:00 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Wed, 7 Jul 2010 09:06:31 +0000 (13:06 +0400)
222 files changed:
java/compiler/impl/src/com/intellij/compiler/actions/GenerateAntBuildAction.java
java/compiler/impl/src/com/intellij/compiler/ant/GenerationOptionsImpl.java
java/compiler/impl/src/com/intellij/compiler/ant/ModuleChunkClasspath.java
java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
java/compiler/impl/src/com/intellij/compiler/impl/CompositeScope.java
java/compiler/impl/src/com/intellij/compiler/impl/TranslatingCompilerFilesMonitor.java
java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/ModuleChunk.java
java/compiler/impl/src/com/intellij/compiler/impl/rmiCompiler/RmicCompiler.java
java/compiler/impl/src/com/intellij/packaging/impl/elements/LibraryElementType.java
java/compiler/openapi/src/com/intellij/compiler/ant/ChunkBuildExtension.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointTableModel.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointTree.java
java/idea-ui/src/com/intellij/facet/impl/autodetecting/EnableAutodetectionWorker.java
java/idea-ui/src/com/intellij/facet/impl/ui/libraries/FacetLibrariesValidatorImpl.java
java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionOptionsPanel.java
java/idea-ui/src/com/intellij/facet/impl/ui/libraries/LibraryCompositionSettings.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ClasspathPanel.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModuleEditor.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ComplexElementSubstitutionParameters.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/LibraryTableEditor.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleStructureConfigurable.java
java/java-impl/src/com/intellij/analysis/JavaAnalysisScope.java
java/java-impl/src/com/intellij/codeInsight/ExpectedTypeUtil.java
java/java-impl/src/com/intellij/codeInsight/completion/ExpectedTypeBasedCompletionProvider.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionUtil.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaSmartCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/ModifierChooser.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddMethodFix.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddReturnFix.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateFromUsageUtils.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/GuessTypeParameters.java
java/java-impl/src/com/intellij/codeInsight/generation/GenerateConstructorHandler.java
java/java-impl/src/com/intellij/codeInsight/generation/GenerateEqualsHelper.java
java/java-impl/src/com/intellij/codeInsight/generation/GenerateMembersHandlerBase.java
java/java-impl/src/com/intellij/codeInsight/generation/OverrideImplementUtil.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/CreateFieldFromParameterAction.java
java/java-impl/src/com/intellij/codeInsight/template/macro/VariableOfTypeMacro.java
java/java-impl/src/com/intellij/codeInspection/canBeFinal/CanBeFinalAnnotator.java
java/java-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspection.java
java/java-impl/src/com/intellij/codeInspection/miscGenerics/GenericsInspectionToolBase.java
java/java-impl/src/com/intellij/codeInspection/unusedLibraries/UnusedLibrariesInspection.java
java/java-impl/src/com/intellij/codeInspection/unusedSymbol/UnusedSymbolLocalInspection.java
java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java
java/java-impl/src/com/intellij/ide/hierarchy/call/CallerMethodsTreeStructure.java
java/java-impl/src/com/intellij/ide/projectView/PsiClassChildrenSource.java
java/java-impl/src/com/intellij/ide/projectView/impl/nodes/PackageViewProjectNode.java
java/java-impl/src/com/intellij/ide/structureView/impl/java/JavaClassTreeElement.java
java/java-impl/src/com/intellij/ide/todo/nodes/TodoJavaTreeHelper.java
java/java-impl/src/com/intellij/ide/util/gotoByName/DefaultSymbolNavigationContributor.java
java/java-impl/src/com/intellij/openapi/options/colors/pages/JavaColorSettingsPage.java
java/java-impl/src/com/intellij/psi/NonClasspathClassFinder.java
java/java-impl/src/com/intellij/psi/impl/CompositeShortNamesCache.java
java/java-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java
java/java-impl/src/com/intellij/psi/impl/file/JavaDirectoryServiceImpl.java
java/java-impl/src/com/intellij/psi/impl/source/codeStyle/ImportHelper.java
java/java-impl/src/com/intellij/psi/impl/source/codeStyle/JavaCodeStyleManagerImpl.java
java/java-impl/src/com/intellij/psi/impl/source/javadoc/ParamDocTagInfo.java
java/java-impl/src/com/intellij/psi/impl/source/javadoc/PsiDocMethodOrFieldRef.java
java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FilePathReferenceProvider.java
java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassListReferenceProvider.java
java/java-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/JavaClassReference.java
java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiCompositeModifierList.java
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureUsageProcessor.java
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureUsageSearcher.java
java/java-impl/src/com/intellij/refactoring/extractclass/ExtractClassProcessor.java
java/java-impl/src/com/intellij/refactoring/makeStatic/MakeMethodOrClassStaticProcessor.java
java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodHandler.java
java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersProcessor.java
java/java-impl/src/com/intellij/refactoring/typeMigration/ClassTypeArgumentMigrationProcessor.java
java/java-impl/src/com/intellij/refactoring/typeMigration/TypeMigrationRules.java
java/java-tests/testSrc/com/intellij/psi/impl/compiled/ClassFileStubBuilderTest.java
java/java-tests/testSrc/com/intellij/refactoring/InheritanceToDelegationTest.java
java/java-tests/testSrc/com/intellij/roots/DirectoryIndexImplTest.java
java/openapi/src/com/intellij/ui/classFilter/ClassFilterEditor.java
platform/bootstrap/src/com/intellij/ide/ClassloaderUtil.java
platform/lang-api/src/com/intellij/openapi/roots/libraries/LibraryUtil.java
platform/lang-api/src/com/intellij/psi/search/LocalSearchScope.java
platform/lang-api/src/com/intellij/psi/util/PsiTreeUtil.java
platform/lang-api/src/com/intellij/refactoring/util/CommonRefactoringUtil.java
platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesModel.java
platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionData.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfo.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/LookupItem.java
platform/lang-impl/src/com/intellij/codeInsight/template/impl/EditVariableDialog.java
platform/lang-impl/src/com/intellij/codeInspection/ex/DescriptorProviderInspection.java
platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionToolRegistrar.java
platform/lang-impl/src/com/intellij/codeInspection/offlineViewer/OfflineInspectionRVContentProvider.java
platform/lang-impl/src/com/intellij/execution/ui/RunContentManagerImpl.java
platform/lang-impl/src/com/intellij/execution/ui/layout/impl/RunnerContentUi.java
platform/lang-impl/src/com/intellij/find/EditorSearchComponent.java
platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
platform/lang-impl/src/com/intellij/ide/actions/GotoFileAction.java
platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java
platform/lang-impl/src/com/intellij/ide/impl/dataRules/VirtualFileArrayRule.java
platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarModel.java
platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewPane.java
platform/lang-impl/src/com/intellij/ide/structureView/impl/common/PsiTreeElementBase.java
platform/lang-impl/src/com/intellij/ide/todo/nodes/TodoTreeHelper.java
platform/lang-impl/src/com/intellij/ide/util/gotoByName/ContributorsBasedGotoByModel.java
platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/JdkScope.java
platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/LibraryRuntimeClasspathScope.java
platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/ModuleRuntimeClasspathScope.java
platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/ModuleWithDependenciesScope.java
platform/lang-impl/src/com/intellij/openapi/paths/PsiDynaReference.java
platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/CompositeProjectRoot.java
platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/ProjectJdkImpl.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerImpl.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/RootModelImpl.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/storage/ClasspathStorage.java
platform/lang-impl/src/com/intellij/psi/impl/cache/impl/CompositeCacheManager.java
platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/PsiMultiReference.java
platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureProcessorBase.java
platform/lang-impl/src/com/intellij/refactoring/rename/naming/AutomaticRenamer.java
platform/lang-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteHandler.java
platform/lang-impl/src/com/intellij/util/ui/classpath/SimpleClasspathPanel.java
platform/platform-api/src/com/intellij/execution/configurations/ParametersList.java
platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java
platform/platform-api/src/com/intellij/ide/util/treeView/UpdaterTreeState.java
platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java
platform/platform-api/src/com/intellij/openapi/ui/DialogBuilder.java
platform/platform-api/src/com/intellij/ui/switcher/QuickAccessSettings.java
platform/platform-impl/src/com/intellij/diagnostic/DialogAppender.java
platform/platform-impl/src/com/intellij/ide/actions/ExportSettingsAction.java
platform/platform-impl/src/com/intellij/ide/dnd/DnDEnabler.java
platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizationUtil.java
platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java
platform/platform-impl/src/com/intellij/ide/ui/search/SearchableOptionsRegistrarImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorsSplitters.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.java
platform/platform-impl/src/com/intellij/openapi/options/ex/ProjectConfigurablesGroup.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFS.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java
platform/testFramework/src/com/intellij/testFramework/TreePrintCondition.java
platform/usageView/src/com/intellij/usages/impl/ImportUsageFilteringRuleProvider.java
platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java
platform/util/src/com/intellij/openapi/util/io/FileUtil.java
platform/util/src/com/intellij/util/containers/ContainerUtil.java
platform/util/src/com/intellij/util/containers/FilteringIterator.java
platform/util/src/com/intellij/util/io/zip/ReorderJarsMain.java
platform/util/src/com/intellij/util/xmlb/PropertyAccessor.java
platform/util/src/com/intellij/util/xmlb/TagBinding.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/RootsCalculator.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/CompoundShelfFileProcesor.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java
plugins/InspectionGadgets/src/com/siyeh/ig/portability/HardcodedFileSeparatorsInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/resources/JDBCResourceInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/ui/ListWrappingTableModel.java
plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/JavaLanguageInjectionSupport.java
plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/util/AnnotationUtilEx.java
plugins/IntelliLang/src/org/intellij/plugins/intelliLang/InjectionsSettingsUI.java
plugins/IntelliLang/src/org/intellij/plugins/intelliLang/SettingsUI.java
plugins/ant/src/com/intellij/lang/ant/config/execution/AntCommandLineBuilder.java
plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java
plugins/ant/src/com/intellij/lang/ant/config/impl/AllJarsUnderDirEntry.java
plugins/ant/src/com/intellij/lang/ant/dom/AntMultiPathStringConverter.java
plugins/ant/src/com/intellij/lang/ant/psi/impl/AntElementImpl.java
plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/AntTargetReference.java
plugins/ant/src/com/intellij/lang/ant/psi/impl/reference/providers/AntFileReferenceProvider.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/actions/ActionOnSelectedElement.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/actions/RemoveLocallyDeletedFilesAction.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvshandlers/SelectedFiles.java
plugins/devkit/src/inspections/InspectionDescriptionNotFoundInspection.java
plugins/devkit/src/inspections/IntentionDescriptionNotFoundInspection.java
plugins/eclipse/src/org/jetbrains/idea/eclipse/conversion/EclipseUserLibrariesHelper.java
plugins/git4idea/src/git4idea/GitRemote.java
plugins/git4idea/src/git4idea/checkin/GitCheckinEnvironment.java
plugins/git4idea/src/git4idea/config/GitVcsSettings.java
plugins/git4idea/src/org/jetbrains/git4idea/util/ScriptGenerator.java
plugins/groovy/src/org/jetbrains/plugins/groovy/GroovyFileTypeLoader.java
plugins/groovy/src/org/jetbrains/plugins/groovy/actions/generate/equals/GrGenerateEqualsHelper.java
plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/generator/GroovyToJavaGenerator.java
plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/filters/GroovyDebuggerClassFilterProvider.java
plugins/groovy/src/org/jetbrains/plugins/groovy/findUsages/GroovyFindUsagesHandlerFactory.java
plugins/groovy/src/org/jetbrains/plugins/groovy/gant/AntTasksProvider.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyCompletionContributor.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovySmartCompletionContributor.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyFileImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/modifiers/GrModifierListImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrNewExpressionImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrReferenceExpressionImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/path/GrMethodCallExpressionImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/typedef/bodies/GrTypeDefinitionBodyImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/stubs/GrStubUtils.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/stubs/elements/GrFieldElementType.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GrClassImplUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/surroundWith/descriptors/GroovyStmtsSurroundDescriptor.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/changeSignature/GrChageSignatureUsageSearcher.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/changeSignature/GrChangeSignatureUsageProcessor.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/GroovyInlineMethodUtil.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgRevertCommand.java
plugins/java-i18n/src/com/intellij/codeInspection/i18n/I18nInspection.java
plugins/java-i18n/src/com/intellij/codeInspection/i18n/InvalidPropertyKeyInspection.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomProjectProcessorUtils.java
plugins/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java
plugins/testng/src/com/theoryinpractice/testng/configuration/SearchingForTestsTask.java
plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java
plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java
plugins/ui-designer/src/com/intellij/uiDesigner/binding/FormReferencesSearcher.java
plugins/ui-designer/src/com/intellij/uiDesigner/projectView/FormMergerTreeStructureProvider.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/completion/CompletionLists.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/context/XsltContextProvider.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/ModeReference.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/util/XsltCodeInsightUtil.java
xml/dom-impl/src/com/intellij/util/dom/generator/ModelGen.java
xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationHolderImpl.java
xml/dom-impl/src/com/intellij/util/xml/impl/DomManagerImpl.java
xml/dom-impl/src/com/intellij/util/xml/impl/StableInvocationHandler.java
xml/dom-impl/src/com/intellij/util/xml/reflect/DomExtensionsRegistrarImpl.java
xml/dom-openapi/src/com/intellij/util/xml/DomUtil.java
xml/impl/src/com/intellij/javaee/ExternalResourceConfigurable.java
xml/impl/src/com/intellij/lang/xml/XmlFileViewProvider.java
xml/impl/src/com/intellij/lang/xml/XmlFoldingBuilder.java
xml/impl/src/com/intellij/psi/CompositeLanguageFileViewProvider.java
xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java
xml/impl/src/com/intellij/psi/impl/source/xml/XmlTagImpl.java
xml/impl/src/com/intellij/xml/impl/dtd/XmlElementDescriptorImpl.java
xml/impl/src/com/intellij/xml/util/HtmlUtil.java
xml/impl/src/com/intellij/xml/util/XmlNSDescriptorSequence.java

index 6cc8ac059f345d91d616c891cd1c86867ac02c38..291e06e2572525db03aaa02515aa425e543dec39 100644 (file)
@@ -35,6 +35,7 @@ import com.intellij.openapi.vfs.LocalFileSystem;
 import com.intellij.openapi.vfs.ReadonlyStatusHandler;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
@@ -151,7 +152,7 @@ public class GenerateAntBuildAction extends CompileActionBase {
               generated = generateMultipleFileBuild(project, genOptions, filesToRefresh);
             }
             if (generated != null) {
-              _generated.addAll(Arrays.asList(generated));
+              ContainerUtil.addAll(_generated, generated);
             }
           }
           catch (IOException e) {
index eb3d82ea1e220e33bae442105827a0a05d929089..bfa9141e1cedab788f6cdaae8202a061cfef5730 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.roots.CompilerModuleExtension;
 import com.intellij.openapi.roots.OrderRootType;
 import com.intellij.openapi.util.SystemInfo;
 import com.intellij.util.Chunk;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.graph.CachingSemiGraph;
 import com.intellij.util.graph.Graph;
 import com.intellij.util.graph.GraphGenerator;
@@ -239,13 +240,13 @@ public class GenerationOptionsImpl extends GenerationOptions {
         final Collection<ModuleChunk> nodes = moduleChunkGraph.getNodes();
         final ModuleChunk[] moduleChunks = nodes.toArray(new ModuleChunk[nodes.size()]);
         for (ModuleChunk moduleChunk : moduleChunks) {
-            final Iterator<ModuleChunk> depsIterator = moduleChunkGraph.getIn(moduleChunk);
-            List<ModuleChunk> deps = new ArrayList<ModuleChunk>();
-            while (depsIterator.hasNext()) {
-                deps.add(depsIterator.next());
-            }
-            moduleChunk.setDependentChunks(deps.toArray(new ModuleChunk[deps.size()]));
-            myCustomCompilers.addAll(Arrays.asList(moduleChunk.getCustomCompilers()));
+          final Iterator<ModuleChunk> depsIterator = moduleChunkGraph.getIn(moduleChunk);
+          List<ModuleChunk> deps = new ArrayList<ModuleChunk>();
+          while (depsIterator.hasNext()) {
+            deps.add(depsIterator.next());
+          }
+          moduleChunk.setDependentChunks(deps.toArray(new ModuleChunk[deps.size()]));
+          ContainerUtil.addAll(myCustomCompilers, moduleChunk.getCustomCompilers());
         }
         Arrays.sort(moduleChunks, new ChunksComparator());
         if (generateSingleFile) {
@@ -273,7 +274,7 @@ public class GenerationOptionsImpl extends GenerationOptions {
         final Sdk[] projectJdks = ProjectJdkTable.getInstance().getAllJdks();
         myJdkUrls = new HashSet<String>();
         for (Sdk jdk : projectJdks) {
-            myJdkUrls.addAll(Arrays.asList(jdk.getRootProvider().getUrls(OrderRootType.CLASSES)));
+          ContainerUtil.addAll(myJdkUrls, jdk.getRootProvider().getUrls(OrderRootType.CLASSES));
         }
         return myJdkUrls;
     }
index 203d7b0e9f9bcb83e4a4a21ed3f88a094c37e388..9f477c12ebf8c7f27c32da3dde24e8264a4f23b6 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.openapi.vfs.JarFileSystem;
 import com.intellij.openapi.vfs.VirtualFileManager;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.OrderedSet;
 import gnu.trove.TObjectHashingStrategy;
 
@@ -232,7 +233,7 @@ public class ModuleChunkClasspath extends Path {
     final Set<String> jdkUrls = options.getAllJdkUrls();
 
     final OrderedSet<String> urls = new OrderedSet<String>();
-    urls.addAll(Arrays.asList(extension.getOutputRootUrls(forTest)));
+    ContainerUtil.addAll(urls, extension.getOutputRootUrls(forTest));
     urls.removeAll(jdkUrls);
     return ArrayUtil.toStringArray(urls);
   }
index a5794bcb8a06f070ee19cfdde4311045d9f418ac..6f6208583b939c65976b86f469e678d5f0c9a55f 100644 (file)
@@ -1271,7 +1271,7 @@ public class CompileDriver {
     for (File outputDirectory : outputDirectories) {
       File[] files = outputDirectory.listFiles();
       if (files != null) {
-        filesToDelete.addAll(Arrays.asList(files));
+        ContainerUtil.addAll(filesToDelete, files);
       }
     }
     if (filesToDelete.size() > 0) {
index 2b8195fbe55641cae9fb9e9536ea0f8ff488e7a9..0c9c73a09761e3fd47ddee627a282b1d4432742f 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.util.Key;
 import com.intellij.openapi.util.UserDataHolderBase;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NotNull;
 
@@ -65,7 +66,7 @@ public class CompositeScope extends UserDataHolderBase implements CompileScope{
     for (CompileScope scope : myScopes) {
       final VirtualFile[] files = scope.getFiles(fileType, inSourceOnly);
       if (files.length > 0) {
-        allFiles.addAll(Arrays.asList(files));
+        ContainerUtil.addAll(allFiles, files);
       }
     }
     return VfsUtil.toVirtualFileArray(allFiles);
@@ -84,7 +85,7 @@ public class CompositeScope extends UserDataHolderBase implements CompileScope{
   public Module[] getAffectedModules() {
     Set<Module> modules = new HashSet<Module>();
     for (final CompileScope compileScope : myScopes) {
-      modules.addAll(Arrays.asList(compileScope.getAffectedModules()));
+      ContainerUtil.addAll(modules, compileScope.getAffectedModules());
     }
     return modules.toArray(new Module[modules.size()]);
   }
index a98dadb7d29d2f7fe3838496eceddd7e2296a9b4..f8d1381f21884a593f3d3dbd38c1cf92eab78c35 100644 (file)
@@ -48,6 +48,7 @@ import com.intellij.openapi.vfs.newvfs.ManagingFS;
 import com.intellij.openapi.vfs.newvfs.NewVirtualFile;
 import com.intellij.openapi.vfs.newvfs.persistent.FSRecords;
 import com.intellij.openapi.vfs.newvfs.persistent.PersistentFS;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.SLRUCache;
 import com.intellij.util.indexing.FileBasedIndex;
 import com.intellij.util.indexing.IndexInfrastructure;
@@ -1069,7 +1070,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
 
           {
             final Set<VirtualFile> newRoots = new HashSet<VirtualFile>();
-            newRoots.addAll(Arrays.asList(rootsAfter));
+            ContainerUtil.addAll(newRoots, rootsAfter);
             if (myRootsBefore != null) {
               newRoots.removeAll(Arrays.asList(myRootsBefore));
             }
@@ -1079,7 +1080,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
           {
             final Set<VirtualFile> oldRoots = new HashSet<VirtualFile>();
             if (myRootsBefore != null) {
-              oldRoots.addAll(Arrays.asList(myRootsBefore));
+              ContainerUtil.addAll(oldRoots, myRootsBefore);
             }
             if (!oldRoots.isEmpty()) {
               oldRoots.removeAll(Arrays.asList(rootsAfter));
index d507c2b13dfb425b38f16bce019c35ccc55f8a01..956a744f58ca520b1d8b868c6327e0ec9e00c224 100644 (file)
@@ -30,6 +30,7 @@ import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.pom.java.LanguageLevel;
 import com.intellij.util.*;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.OrderedSet;
 import gnu.trove.THashMap;
 import gnu.trove.TObjectHashingStrategy;
@@ -178,7 +179,7 @@ public class ModuleChunk extends Chunk<Module> {
     final Set<Module> modules = getNodes();
     Set<VirtualFile> roots = new HashSet<VirtualFile>();
     for (final Module module : modules) {
-      roots.addAll(Arrays.asList(myContext.getSourceRoots(module)));
+      ContainerUtil.addAll(roots, myContext.getSourceRoots(module));
     }
     return VfsUtil.toVirtualFileArray(roots);
   }
index 7b25a94add967300f9fa5f0917cc6c9383b2cc9f..2589933927ff4af102e04e1035ea12825c72cee8 100644 (file)
@@ -43,6 +43,7 @@ import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.PathsList;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
@@ -182,7 +183,7 @@ public class RmicCompiler implements ClassPostProcessingCompiler{
           }
           if (!dirItems.isEmpty()) {
             final RmicProcessingItem[] successfullyProcessed = invokeRmic(context, parserPool, pair.getFirst(), dirItems, pair.getSecond());
-            processed.addAll(Arrays.asList(successfullyProcessed));
+            ContainerUtil.addAll(processed, successfullyProcessed);
           }
           progressIndicator.setFraction(((double)processed.size()) / ((double)items.length));
         }
@@ -294,7 +295,7 @@ public class RmicCompiler implements ClassPostProcessingCompiler{
 
     commandLine.add("-verbose");
 
-    commandLine.addAll(Arrays.asList(RmicConfiguration.getSettings(module.getProject()).getOptions()));
+    ContainerUtil.addAll(commandLine, RmicConfiguration.getSettings(module.getProject()).getOptions());
 
     commandLine.add("-classpath");
 
index 01a8b9d93ea137fe8418b847f0dd8ce5032e3027..33860fbdef9a026d490ad3ed974fcd330a059991 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.packaging.elements.ComplexPackagingElementType;
 import com.intellij.packaging.elements.CompositePackagingElement;
 import com.intellij.packaging.ui.ArtifactEditorContext;
 import com.intellij.util.Icons;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
@@ -65,8 +66,8 @@ public class LibraryElementType extends ComplexPackagingElementType<LibraryPacka
 
   private static List<Library> getAllLibraries(ArtifactEditorContext context) {
     List<Library> libraries = new ArrayList<Library>();
-    libraries.addAll(Arrays.asList(LibraryTablesRegistrar.getInstance().getLibraryTable().getLibraries()));
-    libraries.addAll(Arrays.asList(LibraryTablesRegistrar.getInstance().getLibraryTable(context.getProject()).getLibraries()));
+    ContainerUtil.addAll(libraries, LibraryTablesRegistrar.getInstance().getLibraryTable().getLibraries());
+    ContainerUtil.addAll(libraries, LibraryTablesRegistrar.getInstance().getLibraryTable(context.getProject()).getLibraries());
     return libraries;
   }
 
index ec48ecd1c038b53e26d65b721cb8daf42710ad8f..d9ad4e52143dffe212fab157e9c7c82320c1248f 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.extensions.ExtensionPointName;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.project.Project;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
@@ -44,7 +45,7 @@ public abstract class ChunkBuildExtension {
     List<String> allTargets = new ArrayList<String>();
     final ChunkBuildExtension[] extensions = Extensions.getRootArea().getExtensionPoint(EP_NAME).getExtensions();
     for (ChunkBuildExtension extension : extensions) {
-      allTargets.addAll(Arrays.asList(extension.getTargets(chunk)));
+      ContainerUtil.addAll(allTargets, extension.getTargets(chunk));
     }
     if (allTargets.isEmpty()) {
       allTargets.add(BuildProperties.getCompileTargetName(chunk.getName()));
@@ -68,4 +69,4 @@ public abstract class ChunkBuildExtension {
       extension.generateProperties(propertyFileGenerator, project, genOptions);
     }
   }
-}
\ No newline at end of file
+}
index 544aed0ebd5b9aeb902a5af31aae609895af118a..b38a84bc96a64fcf834813d31c92ef638c819b8d 100644 (file)
@@ -23,6 +23,7 @@ package com.intellij.debugger.ui.breakpoints;
 import com.intellij.debugger.DebuggerBundle;
 import com.intellij.debugger.DebuggerManagerEx;
 import com.intellij.openapi.project.Project;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.ItemRemovable;
 
 import javax.swing.table.AbstractTableModel;
@@ -46,7 +47,7 @@ public class BreakpointTableModel extends AbstractTableModel implements ItemRemo
   public final void setBreakpoints(Breakpoint[] breakpoints) {
     myBreakpoints.clear();
     if (breakpoints != null) {
-      myBreakpoints.addAll(Arrays.asList(breakpoints));
+      ContainerUtil.addAll(myBreakpoints, breakpoints);
     }
     fireTableDataChanged();
   }
index c68625244d337c3c0dca9488c9e219c0d6c756be..397f6c37355c3ee65ee412efce567cc7c1b680ce 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.ui.*;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.Icons;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.Convertor;
 import com.intellij.util.ui.tree.TreeUtil;
 import org.jetbrains.annotations.NotNull;
@@ -468,7 +469,7 @@ public class BreakpointTree extends CheckboxTree {
 
   public void setBreakpoints(Breakpoint[] breakpoints) {
     myBreakpoints.clear();
-    myBreakpoints.addAll(Arrays.asList(breakpoints));
+    ContainerUtil.addAll(myBreakpoints, breakpoints);
     rebuildTree();
   }
 
index cf6117ba10a38530cb71a680212d1de6b384a790..4e89eadb1cbd68472bf44b0d70df230631cddb8c 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.openapi.roots.ContentIterator;
 import com.intellij.openapi.util.MultiValuesMap;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.vfs.VirtualFileManager;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -84,7 +85,7 @@ public class EnableAutodetectionWorker {
     }
 
     if (moduleElements.isEmpty()) {
-      modulesToProcess.addAll(Arrays.asList(moduleManager.getModules()));
+      ContainerUtil.addAll(modulesToProcess, moduleManager.getModules());
     }
     if (newElement != null) {
       Set<String> toRemove = new THashSet<String>();
index 9db56d737dab5f2ef14ceb1e223ab623392e5ae2..a579c34bc5d3ca61e344293cdfe65dbb50ccef09 100644 (file)
@@ -34,6 +34,7 @@ import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -115,7 +116,7 @@ public class FacetLibrariesValidatorImpl extends FacetLibrariesValidator {
       rootModel.orderEntries().using(myContext.getModulesProvider()).recursively().librariesOnly().forEachLibrary(new Processor<Library>() {
         @Override
         public boolean process(Library library) {
-          roots.addAll(Arrays.asList(myContext.getLibrariesContainer().getLibraryFiles(library, OrderRootType.CLASSES)));
+          ContainerUtil.addAll(roots, myContext.getLibrariesContainer().getLibraryFiles(library, OrderRootType.CLASSES));
           return true;
         }
       });
index d8ac377ce2d65032816c98dfd8640d1dbc617301..c83ffa19e9c68fc498dd2e7fa3f5bf7c87f4fa80 100644 (file)
@@ -34,6 +34,7 @@ import com.intellij.openapi.vfs.LocalFileSystem;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.ui.IdeBorderFactory;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.UIUtil;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.annotations.NotNull;
@@ -176,7 +177,7 @@ public class LibraryCompositionOptionsPanel {
     descriptor.setTitle(IdeBundle.message("file.chooser.select.paths.title"));
     descriptor.setDescription(IdeBundle.message("file.chooser.multiselect.description"));
     final VirtualFile[] files = FileChooser.chooseFiles(myAddJarsButton, descriptor, getBaseDirectory());
-    myAddedJars.addAll(Arrays.asList(files));
+    ContainerUtil.addAll(myAddedJars, files);
     updateAll();
   }
 
@@ -196,7 +197,7 @@ public class LibraryCompositionOptionsPanel {
     List<VirtualFile> roots = new ArrayList<VirtualFile>();
     roots.addAll(myAddedJars);
     for (Library library : myUsedLibraries) {
-      roots.addAll(Arrays.asList(myLibrariesContainer.getLibraryFiles(library, OrderRootType.CLASSES)));
+      ContainerUtil.addAll(roots, myLibrariesContainer.getLibraryFiles(library, OrderRootType.CLASSES));
     }
     RequiredLibrariesInfo.RequiredClassesNotFoundInfo info = new RequiredLibrariesInfo(myLibraryCompositionSettings.getLibraryInfos()).checkLibraries(
       VfsUtil.toVirtualFileArray(roots), false);
index 43ab025dce27aa5d46b8705165496a6de50f4999..4e9968ec4f119faf68539887e005a455142f7694 100644 (file)
@@ -24,6 +24,7 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.LibrariesContaine
 import com.intellij.openapi.roots.ui.configuration.projectRoot.LibrariesContainerFactory;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -121,7 +122,7 @@ public class LibraryCompositionSettings {
       List<VirtualFile> roots = new ArrayList<VirtualFile>();
       roots.addAll(myAddedJars);
       for (Library library : myUsedLibraries) {
-        roots.addAll(Arrays.asList(librariesContainer.getLibraryFiles(library, OrderRootType.CLASSES)));
+        ContainerUtil.addAll(roots, librariesContainer.getLibraryFiles(library, OrderRootType.CLASSES));
       }
       VirtualFile[] jars = VfsUtil.toVirtualFileArray(roots);
       RequiredLibrariesInfo.RequiredClassesNotFoundInfo info = requiredLibraries.checkLibraries(jars, all);
@@ -135,7 +136,7 @@ public class LibraryCompositionSettings {
           if (files.length != downloadingInfos.length) {
             return false;
           }
-          myAddedJars.addAll(Arrays.asList(files));
+          ContainerUtil.addAll(myAddedJars, files);
         }
       }
     }
index f04f3ebc259ea2f885d2796a11b774abc2377bfa..755b11bb7da2f4e770174e32fac107eb71fbf0aa 100644 (file)
@@ -55,6 +55,7 @@ import com.intellij.ui.*;
 import com.intellij.ui.awt.RelativePoint;
 import com.intellij.util.EventDispatcher;
 import com.intellij.util.Icons;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.ItemRemovable;
 import com.intellij.util.ui.Table;
 import org.jetbrains.annotations.NotNull;
@@ -1091,7 +1092,7 @@ public class ClasspathPanel extends JPanel {
       final Set<VirtualFile> alreadyAdded = new HashSet<VirtualFile>();
       final Library[] libraries = myLibraryTable.getLibraries();
       for (Library library : libraries) {
-        alreadyAdded.addAll(Arrays.asList(library.getFiles(OrderRootType.CLASSES)));
+        ContainerUtil.addAll(alreadyAdded, library.getFiles(OrderRootType.CLASSES));
       }
       chosenFilesSet.removeAll(alreadyAdded);
       return VfsUtil.toVirtualFileArray(chosenFilesSet);
index 583d151dcb2f66d07a6ab95fbcf3df9d20f92862..fe641f733c88e363309422e18fa7e259b02822e7 100644 (file)
@@ -37,6 +37,7 @@ import com.intellij.ui.TabbedPaneWrapper;
 import com.intellij.ui.navigation.History;
 import com.intellij.ui.navigation.Place;
 import com.intellij.util.EventDispatcher;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -187,8 +188,8 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
 
   private static ModuleConfigurationEditorProvider[] collectProviders(final Module module) {
     List<ModuleConfigurationEditorProvider> result = new ArrayList<ModuleConfigurationEditorProvider>();
-    result.addAll(Arrays.asList(module.getComponents(ModuleConfigurationEditorProvider.class)));
-    result.addAll(Arrays.asList(Extensions.getExtensions(ModuleConfigurationEditorProvider.EP_NAME, module)));
+    ContainerUtil.addAll(result, module.getComponents(ModuleConfigurationEditorProvider.class));
+    ContainerUtil.addAll(result, Extensions.getExtensions(ModuleConfigurationEditorProvider.EP_NAME, module));
     return result.toArray(new ModuleConfigurationEditorProvider[result.size()]);
   }
 
@@ -208,7 +209,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
 
   private void processEditorsProvider(final ModuleConfigurationEditorProvider provider, final ModuleConfigurationState state) {
     final ModuleConfigurationEditor[] editors = provider.createEditors(state);
-    myEditors.addAll(Arrays.asList(editors));
+    ContainerUtil.addAll(myEditors, editors);
   }
 
   private JPanel createPanel() {
index bbb0f2b401dcd8d4afd4dcb537ece00e71436fb8..1845308c5e1abca9022b438c2094970833df05ce 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.openapi.roots.ui.configuration.artifacts.nodes.ComplexPackag
 import com.intellij.packaging.elements.ComplexPackagingElement;
 import com.intellij.packaging.elements.ComplexPackagingElementType;
 import com.intellij.packaging.elements.PackagingElementFactory;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.*;
@@ -31,7 +32,7 @@ public class ComplexElementSubstitutionParameters {
   private final Set<ComplexPackagingElement<?>> mySubstituted = new HashSet<ComplexPackagingElement<?>>();
 
   public void setSubstituteAll() {
-    myTypesToSubstitute.addAll(Arrays.asList(PackagingElementFactory.getInstance().getComplexElementTypes()));
+    ContainerUtil.addAll(myTypesToSubstitute, PackagingElementFactory.getInstance().getComplexElementTypes());
     mySubstituted.clear();
   }
 
index 5b5f7c5a3397a1886ba391487ba3833c77ae3322..3fc1a0f5433b8fe7ae4f99be4eebe90310333bf1 100644 (file)
@@ -62,6 +62,7 @@ import com.intellij.ui.TreeSpeedSearch;
 import com.intellij.ui.treeStructure.Tree;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.Icons;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.UIUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -471,10 +472,11 @@ public class LibraryTableEditor implements Disposable, LibraryEditorListener {
 
     private void appendLibraryToModules(final ModuleStructureConfigurable rootConfigurable, final Library libraryToSelect) {
       final List<Module> modules = new ArrayList<Module>();
-      modules.addAll(Arrays.asList(rootConfigurable.getModules()));
+      ContainerUtil.addAll(modules, rootConfigurable.getModules());
       final ChooseModulesDialog dlg = new ChooseModulesDialog(myProject,
                                                               modules, ProjectBundle.message("choose.modules.dialog.title"),
-                                                              ProjectBundle.message("choose.modules.dialog.description", libraryToSelect.getName())); 
+                                                              ProjectBundle
+                                                                .message("choose.modules.dialog.description", libraryToSelect.getName()));
       dlg.show();
       if (dlg.isOK()) {
         final List<Module> choosenModules = dlg.getChosenElements();
@@ -596,12 +598,12 @@ public class LibraryTableEditor implements Disposable, LibraryEditorListener {
       final Library[] libraries = myTableModifiableModel.getLibraries();
       for (Library library : libraries) {
         final VirtualFile[] libraryFiles = getLibraryEditor(library).getFiles(rootType);
-        alreadyAdded.addAll(Arrays.asList(libraryFiles));
+        ContainerUtil.addAll(alreadyAdded, libraryFiles);
       }
     }
     else {
       final VirtualFile[] libraryFiles = getLibraryEditor(lib).getFiles(rootType);
-      alreadyAdded.addAll(Arrays.asList(libraryFiles));
+      ContainerUtil.addAll(alreadyAdded, libraryFiles);
     }
     chosenFilesSet.removeAll(alreadyAdded);
     return VfsUtil.toVirtualFileArray(chosenFilesSet);
index bc784b5e00a83681821bf559af04cd021fe7c9d6..bdf4e13ad907dcc23a2257d5a96d57de2b7848be 100644 (file)
@@ -63,6 +63,7 @@ import com.intellij.openapi.wm.WindowManager;
 import com.intellij.ui.navigation.Place;
 import com.intellij.util.Consumer;
 import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.tree.TreeUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -649,7 +650,7 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
           result.add(new Separator(ProjectBundle.message("add.group.facet.separator")));
         }
 
-        result.addAll(Arrays.asList(facets));
+        ContainerUtil.addAll(result, facets);
 
         return result.toArray(new AnAction[result.size()]);
       }
index 04dd2497913b962c25d107fc3d56e509a08daca5..1aa96564689967e56f89df8cb57dfefe8f91ed98 100644 (file)
@@ -30,6 +30,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.SearchScope;
 import com.intellij.psi.search.PackageScope;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Arrays;
@@ -111,7 +112,7 @@ public class JavaAnalysisScope extends AnalysisScope {
       final Set<PsiDirectory> dirs = new HashSet<PsiDirectory>();
       ApplicationManager.getApplication().runReadAction(new Runnable() {
         public void run() {
-          dirs.addAll(Arrays.asList(pack.getDirectories(GlobalSearchScope.projectScope(myElement.getProject()))));
+          ContainerUtil.addAll(dirs, pack.getDirectories(GlobalSearchScope.projectScope(myElement.getProject())));
         }
       });
       for (PsiDirectory dir : dirs) {
@@ -130,4 +131,4 @@ public class JavaAnalysisScope extends AnalysisScope {
     }
     return super.toSearchScope();
   }
-}
\ No newline at end of file
+}
index 3c2e3b9abbf21de7baf006a68b1e69470f5e15b0..3a8eeb35f779eeef6952a6d25452b2511740be12 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.codeInsight;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.psi.*;
 import com.intellij.psi.util.PsiUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
@@ -151,7 +152,7 @@ public class ExpectedTypeUtil {
       List<PsiMethod> methods = new ArrayList<PsiMethod>();
       for (PsiClass aClass : myOccurrenceClasses) {
         final PsiMethod[] occMethod = aClass.findMethodsByName(name, true);
-        methods.addAll(Arrays.asList(occMethod));
+        ContainerUtil.addAll(methods, occMethod);
       }
       return methods.toArray(new PsiMethod[methods.size()]);
     }
index 65478857ce33c2450b1cb67f5dbb22eed1601243..0553bc9744593ba3acd85c459d500c473682b736 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiLiteralExpression;
 import com.intellij.util.ProcessingContext;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NotNull;
 
@@ -42,7 +43,7 @@ public abstract class ExpectedTypeBasedCompletionProvider extends CompletionProv
     final THashSet<ExpectedTypeInfo> infos = new THashSet<ExpectedTypeInfo>();
     ApplicationManager.getApplication().runReadAction(new Runnable() {
       public void run() {
-        infos.addAll(Arrays.asList(JavaSmartCompletionContributor.getExpectedTypes(params)));
+        ContainerUtil.addAll(infos, JavaSmartCompletionContributor.getExpectedTypes(params));
       }
     });
     addCompletions(params, result, infos);
index 4eb8e5f27a30f0435d61a5ef57b94e7e8ebb6d1e..9e7513d06e6abf132b424944b5a1c41c63ced164 100644 (file)
@@ -56,6 +56,7 @@ import com.intellij.psi.xml.XmlTokenType;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.NullableFunction;
 import com.intellij.util.PairFunction;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NonNls;
@@ -267,7 +268,7 @@ public class JavaCompletionUtil {
         }
       }
 
-      result.addAll(Arrays.asList(getOverlappedNameVersions(prefix, suggestedNames, requiredSuffix)));
+      ContainerUtil.addAll(result, getOverlappedNameVersions(prefix, suggestedNames, requiredSuffix));
 
 
     }
index 672df85106a106592fa8016acf5c1b8e0b0355ea..e1c7d5cbba5d54c5a8210bf0ed16a561147bfff1 100644 (file)
@@ -369,7 +369,7 @@ public class JavaSmartCompletionContributor extends CompletionContributor {
 
         ApplicationManager.getApplication().runReadAction(new Runnable() {
           public void run() {
-            infos.addAll(Arrays.asList(getExpectedTypes(parameters)));
+            ContainerUtil.addAll(infos, getExpectedTypes(parameters));
             for (PsiType type : ExpectedTypesGetter.getExpectedTypes(identifierCopy, true)) {
               if (type instanceof PsiClassType) {
                 final PsiClassType classType = (PsiClassType)type;
index 4250ef5f1c45688075062418ddb2423b6bad8114..15a704e21bb42c786bd8dffa72a1519c599a529c 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.psi.impl.source.jsp.jspJava.JspClassLevelDeclarationStatemen
 import com.intellij.psi.javadoc.PsiDocComment;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 
 import java.util.ArrayList;
@@ -105,7 +106,7 @@ scopes:
                 }
               }
               if (!containModifierFlag) {
-                ret.addAll(Arrays.asList(keywords));
+                ContainerUtil.addAll(ret, keywords);
               }
             }
             break scopes;
index 867393fa645b950944a79704a36c0e45cc93aa8a..93ebf645028db6f6f4f38c23b25df038bb1b806e 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.psi.codeStyle.JavaCodeStyleManager;
 import com.intellij.psi.util.MethodSignatureUtil;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
@@ -51,7 +52,7 @@ public class AddMethodFix extends IntentionAndQuickFixAction {
 
   public AddMethodFix(@NonNls @NotNull String methodText, @NotNull PsiClass implClass, @NotNull String... exceptions) {
     this(createMethod(methodText, implClass), implClass);
-    myExceptions.addAll(Arrays.asList(exceptions));
+    ContainerUtil.addAll(myExceptions, exceptions);
   }
 
   private static PsiMethod createMethod(final String methodText, final PsiClass implClass) {
index 701c0d85b446c980a34fe63bb0968f17a611a2cb..c78bbb66b5793a44266e5e19e4505270accc75a9 100644 (file)
@@ -31,6 +31,7 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 public class AddReturnFix implements IntentionAction {
@@ -106,8 +107,8 @@ public class AddReturnFix implements IntentionAction {
       }
     }
     PsiParameter[] parameters = method.getParameterList().getParameters();
-    variables.addAll(Arrays.asList(parameters));
-    return (PsiVariable[]) variables.toArray(new PsiVariable[variables.size()]);
+    ContainerUtil.addAll(variables, parameters);
+    return (PsiVariable[])variables.toArray(new PsiVariable[variables.size()]);
   }
 
   public boolean startInWriteAction() {
index 17b11aebe4db7dc6e54df37d972809c5b9ac0133..2b6497b47f4d29cb15e4f70fca480eb00b3f4fdc 100644 (file)
@@ -583,7 +583,7 @@ public class CreateFromUsageUtils {
     if (expectedTypes.length == 0 && !typesList.isEmpty()) {
       List<ExpectedTypeInfo> union = new ArrayList<ExpectedTypeInfo>();
       for (ExpectedTypeInfo[] aTypesList : typesList) {
-        union.addAll(Arrays.asList((ExpectedTypeInfo[])aTypesList));
+        ContainerUtil.addAll(union, (ExpectedTypeInfo[])aTypesList);
       }
       expectedTypes = union.toArray(new ExpectedTypeInfo[union.size()]);
     }
@@ -633,7 +633,7 @@ public class CreateFromUsageUtils {
     if (expectedTypes.length == 0 && !typesList.isEmpty()) {
       List<ExpectedTypeInfo> union = new ArrayList<ExpectedTypeInfo>();
       for (ExpectedTypeInfo[] aTypesList : typesList) {
-        union.addAll(Arrays.asList((ExpectedTypeInfo[])aTypesList));
+        ContainerUtil.addAll(union, (ExpectedTypeInfo[])aTypesList);
       }
       expectedTypes = union.toArray(new ExpectedTypeInfo[union.size()]);
     }
index 4d2493a058038f009fcc37a9425f9840f66e75fd..10bf173c30e729b977871670ca4b644b40444995 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.ArrayList;
@@ -86,7 +87,7 @@ public class GuessTypeParameters {
 
       List<PsiType> types = matchingTypeParameters(vals, params, info);
       if (!types.isEmpty()) {
-        types.addAll(Arrays.asList(ExpectedTypesProvider.processExpectedTypes(infos, new MyTypeVisitor(manager, scope), project)));
+        ContainerUtil.addAll(types, ExpectedTypesProvider.processExpectedTypes(infos, new MyTypeVisitor(manager, scope), project));
         builder.replaceElement(typeElement, new TypeExpression(project, types.toArray(new PsiType[types.size()])));
         return;
       }
index 4bde9f7011e5bf02992beeb4627c1c22d1858a61..efbaf7021f02ef47a094800c4d60c6bd8fe528ed 100644 (file)
@@ -126,12 +126,12 @@ public class GenerateConstructorHandler extends GenerateMembersHandlerBase {
       members = chooseMembers(allMembers, true, false, project);
       if (members == null) return null;
     }
-    if (baseConstructors != null){
+    if (baseConstructors != null) {
       ArrayList<ClassMember> array = new ArrayList<ClassMember>();
       for (PsiMethod baseConstructor : baseConstructors) {
         array.add(new PsiMethodMember(baseConstructor));
       }
-      array.addAll(Arrays.asList(members));
+      ContainerUtil.addAll(array, members);
       members = array.toArray(new ClassMember[array.size()]);
     }
 
@@ -276,4 +276,4 @@ public class GenerateConstructorHandler extends GenerateMembersHandlerBase {
     LOG.assertTrue(false);
     return null;
   }
-}
\ No newline at end of file
+}
index dd5d4493bf95cf1b08f932eee2014032399ad2d3..485370e2aa1683980950a70e1b031ab80ef2d8bd 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.psi.util.MethodSignature;
 import com.intellij.psi.util.MethodSignatureUtil;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import org.jetbrains.annotations.NonNls;
 
@@ -73,7 +74,7 @@ public class GenerateEqualsHelper implements Runnable {
     myCheckParameterWithInstanceof = useInstanceofToCheckParameterType;
 
     myNonNullSet = new HashSet<PsiField>();
-    myNonNullSet.addAll(Arrays.asList(nonNullFields));
+    ContainerUtil.addAll(myNonNullSet, nonNullFields);
     final PsiManager manager = PsiManager.getInstance(project);
 
     myFactory = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory();
@@ -179,7 +180,7 @@ public class GenerateEqualsHelper implements Runnable {
       addClassInstance(buffer);
 
       ArrayList<PsiField> equalsFields = new ArrayList<PsiField>();
-      equalsFields.addAll(Arrays.asList(myEqualsFields));
+      ContainerUtil.addAll(equalsFields, myEqualsFields);
       Collections.sort(equalsFields, EqualsFieldsComparator.INSTANCE);
 
       for (PsiField field : equalsFields) {
index 9d9da0b9233844fe40c9185203186918d5b4c338..8f0077d617412e017790bfcd8de910ad1df1610d 100644 (file)
@@ -38,6 +38,7 @@ import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -185,7 +186,7 @@ public abstract class GenerateMembersHandlerBase implements CodeInsightActionHan
     for (ClassMember member : members) {
       GenerationInfo[] prototypes = generateMemberPrototypes(aClass, member);
       if (prototypes != null) {
-        array.addAll(Arrays.asList(prototypes));
+        ContainerUtil.addAll(array, prototypes);
       }
     }
     return array;
index 46d63d90538de7cafb7fe2b2d6c7e31c889c31c4..628e28c8bfdd12804335ebfffd377103a1b32af9 100644 (file)
@@ -248,7 +248,7 @@ public class OverrideImplementUtil {
 
     List<PsiMethod> results = new ArrayList<PsiMethod>();
     for (final MethodImplementor implementor : getImplementors()) {
-      results.addAll(Arrays.asList(implementor.createImplementationPrototypes(aClass, method)));
+      ContainerUtil.addAll(results, implementor.createImplementationPrototypes(aClass, method));
     }
     if (results.isEmpty()) {
       PsiMethod method1 = GenerateMembersUtil.substituteGenericMethod(method, substitutor);
index 2556bc2b1d9ec0b19d9a19674c9807d8759b57c0..ba20d25c2517df53700df95ff6ad369a7279bb8f 100644 (file)
@@ -41,6 +41,7 @@ import com.intellij.psi.util.TypeConversionUtil;
 import com.intellij.refactoring.util.RefactoringUtil;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -167,7 +168,7 @@ public class CreateFieldFromParameterAction implements IntentionAction {
 
     if (isInteractive) {
       List<String> namesList = new ArrayList<String>();
-      namesList.addAll(Arrays.asList(names));
+      ContainerUtil.addAll(namesList, names);
       String defaultName = styleManager.propertyNameToVariableName(propertyName, kind);
       if (namesList.contains(defaultName)) {
         Collections.swap(namesList, 0, namesList.indexOf(defaultName));
index a9ba2a0d4e15dc62a88d2b58819a0aed98e4d3f6..a35e0729bc12b745ff2f205bbff69d36dbe9f913 100644 (file)
@@ -23,6 +23,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.psi.*;
 import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -103,7 +104,7 @@ public class VariableOfTypeMacro implements Macro {
     }
 
     PsiExpression[] expressions = MacroUtil.getStandardExpressionsOfType(place, type);
-    array.addAll(Arrays.asList(expressions));
+    ContainerUtil.addAll(array, expressions);
     return array.toArray(new PsiElement[array.size()]);
   }
 }
index bb820f68ed2e55187f0991e84448dabcb8d2873e..1d044ef57c488ac63ef7c2a320e180d2ef24ed04 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.codeInsight.daemon.impl.analysis.HighlightControlFlowUtil;
 import com.intellij.codeInspection.reference.*;
 import com.intellij.psi.*;
 import com.intellij.psi.controlFlow.*;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.*;
 
@@ -115,7 +116,7 @@ class CanBeFinalAnnotator extends RefGraphAnnotatorEx {
         PsiField[] psiFields = psiClass.getFields();
 
         HashSet<PsiVariable> allFields = new HashSet<PsiVariable>();
-        allFields.addAll(Arrays.asList(psiFields));
+        ContainerUtil.addAll(allFields, psiFields);
         ArrayList<PsiVariable> instanceInitializerInitializedFields = new ArrayList<PsiVariable>();
         boolean hasInitializers = false;
         for (PsiClassInitializer initializer : psiClass.getInitializers()) {
@@ -123,7 +124,8 @@ class CanBeFinalAnnotator extends RefGraphAnnotatorEx {
           hasInitializers = true;
           ControlFlow flow;
           try {
-            flow = ControlFlowFactory.getInstance(body.getProject()).getControlFlow(body, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance(), false);
+            flow = ControlFlowFactory.getInstance(body.getProject())
+              .getControlFlow(body, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance(), false);
           }
           catch (AnalysisCanceledException e) {
             flow = ControlFlow.EMPTY;
@@ -154,7 +156,8 @@ class CanBeFinalAnnotator extends RefGraphAnnotatorEx {
               hasInitializers = true;
               ControlFlow flow;
               try {
-                flow = ControlFlowFactory.getInstance(body.getProject()).getControlFlow(body, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance(), false);
+                flow = ControlFlowFactory.getInstance(body.getProject())
+                  .getControlFlow(body, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance(), false);
               }
               catch (AnalysisCanceledException e) {
                 flow = ControlFlow.EMPTY;
index 29e43e5ec01d52e3a86ddec7ddc60168c2576656..6f6d27acc0aaff44e011ce8b4ce37f1f44a2b6fc 100644 (file)
@@ -58,6 +58,7 @@ import com.intellij.psi.util.PsiMethodUtil;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.refactoring.safeDelete.SafeDeleteHandler;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.text.CharArrayUtil;
 import org.jdom.Element;
@@ -105,7 +106,7 @@ public class UnusedDeclarationInspection extends FilteringInspectionTool {
   public final UnusedCodeExtension[] myExtensions;
 
   public UnusedDeclarationInspection() {
-    ADDITIONAL_ANNOTATIONS.addAll(Arrays.asList(ADDITIONAL_ANNOS));
+    ContainerUtil.addAll(ADDITIONAL_ANNOTATIONS, ADDITIONAL_ANNOS);
     myQuickFixActions = new QuickFixAction[]{new PermanentDeleteAction(), new CommentOutBin(), new MoveToEntries()};
     ExtensionPoint<UnusedCodeExtension> point = Extensions.getRootArea().getExtensionPoint(ExtensionPoints.DEAD_CODE_TOOL);
     final UnusedCodeExtension[] deadCodeAddins = point.getExtensions();
index d17847b123531c3107e5091ac3828dad76863b6a..a6d43911c17669deb9bec7a48bcb50e5c73c175a 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.codeInspection.InspectionManager;
 import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.ex.BaseLocalInspectionTool;
 import com.intellij.psi.*;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.ArrayList;
@@ -36,7 +37,7 @@ public abstract class GenericsInspectionToolBase extends BaseLocalInspectionTool
     for (PsiClassInitializer initializer : initializers) {
       final ProblemDescriptor[] localDescriptions = getDescriptions(initializer, manager, isOnTheFly);
       if (localDescriptions != null) {
-        descriptors.addAll(Arrays.asList(localDescriptions));
+        ContainerUtil.addAll(descriptors, localDescriptions);
       }
     }
     if (descriptors.isEmpty()) return null;
index 00f0f49ea1955a4d61afb117d341ab587b58de07..dd37141af7d2764e3e718bceee4528111a878a2b 100644 (file)
@@ -55,6 +55,7 @@ import com.intellij.psi.search.scope.packageSet.NamedScope;
 import com.intellij.psi.search.scope.packageSet.PackageSetFactory;
 import com.intellij.psi.search.scope.packageSet.ParsingException;
 import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.Nls;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -69,11 +70,12 @@ public class UnusedLibrariesInspection extends DescriptorProviderInspection {
     final Project project = getContext().getProject();
     final ArrayList<VirtualFile> libraryRoots = new ArrayList<VirtualFile>();
     if (scope.getScopeType() == AnalysisScope.PROJECT) {
-      libraryRoots.addAll(Arrays.asList(LibraryUtil.getLibraryRoots(project, false, false)));
+      ContainerUtil.addAll(libraryRoots, LibraryUtil.getLibraryRoots(project, false, false));
     } else {
       final Set<Module> modules = new HashSet<Module>();
       scope.accept(new PsiRecursiveElementVisitor() {
-        @Override public void visitFile(PsiFile file) {
+        @Override
+        public void visitFile(PsiFile file) {
           if (!(file instanceof PsiCompiledElement)) {
             final VirtualFile virtualFile = file.getVirtualFile();
             if (virtualFile != null) {
@@ -85,7 +87,7 @@ public class UnusedLibrariesInspection extends DescriptorProviderInspection {
           }
         }
       });
-      libraryRoots.addAll(Arrays.asList(LibraryUtil.getLibraryRoots(modules.toArray(new Module[modules.size()]), false, false)));
+      ContainerUtil.addAll(libraryRoots, LibraryUtil.getLibraryRoots(modules.toArray(new Module[modules.size()]), false, false));
     }
     GlobalSearchScope searchScope;
     try {
@@ -244,4 +246,4 @@ public class UnusedLibrariesInspection extends DescriptorProviderInspection {
       });
     }
   }
-}
\ No newline at end of file
+}
index 1cec7699401327488318854b13877f952bec228e..cc4be90a44aab341ebbb6b6b7031ea7399e6c829 100644 (file)
@@ -31,6 +31,7 @@ import com.intellij.openapi.util.JDOMExternalizableStringList;
 import com.intellij.psi.PsiMethod;
 import com.intellij.psi.PsiModifierListOwner;
 import com.intellij.psi.util.PropertyUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.intellij.lang.annotations.Pattern;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -171,7 +172,7 @@ public class UnusedSymbolLocalInspection extends BaseJavaLocalInspectionTool imp
       for (Object extension : Extensions.getExtensions(ExtensionPoints.DEAD_CODE_TOOL)) {
         final String[] ignoredAnnotations = ((UnusedCodeExtension)extension).getIgnoreAnnotations();
         if (ignoredAnnotations != null) {
-          annotations.addAll(Arrays.asList(ignoredAnnotations));
+          ContainerUtil.addAll(annotations, ignoredAnnotations);
         }
       }
       ANNOTATIONS = annotations;
index 90ee10cf58a36e907f7f71753f5a1e07a9ce1c45..be32c0d6304f91120e79e5c184df470bf4e3cf1e 100644 (file)
@@ -186,10 +186,10 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
           if (doSearch) {
             final List<PsiElement> elements = new ArrayList<PsiElement>();
             if (getter != null) {
-              elements.addAll(Arrays.asList(SuperMethodWarningUtil.checkSuperMethods(getter, ACTION_STRING)));
+              ContainerUtil.addAll(elements, SuperMethodWarningUtil.checkSuperMethods(getter, ACTION_STRING));
             }
             if (setter != null) {
-              elements.addAll(Arrays.asList(SuperMethodWarningUtil.checkSuperMethods(setter, ACTION_STRING)));
+              ContainerUtil.addAll(elements, SuperMethodWarningUtil.checkSuperMethods(setter, ACTION_STRING));
             }
             return elements.toArray(new PsiElement[elements.size()]);
           }
@@ -415,7 +415,7 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     ApplicationManager.getApplication().runReadAction(new Runnable() {
       public void run() {
         PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(dir);
-        array.addAll(Arrays.asList(classes));
+        ContainerUtil.addAll(array, classes);
         if (includeSubdirs) {
           PsiDirectory[] dirs = dir.getSubdirectories();
           for (PsiDirectory directory : dirs) {
index 8db99a3526b9a625e38457b68a599213fa94b999..92f02bd561b1a9dcaa154f8f6c51e172578f1e2a 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.psi.util.PsiUtil;
 import com.intellij.psi.util.TypeConversionUtil;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 
 import java.util.Arrays;
@@ -57,9 +58,9 @@ public final class CallerMethodsTreeStructure extends HierarchyTreeStructure {
     final PsiClassType originalType = JavaPsiFacade.getElementFactory(myProject).createType(originalClass);
     final Set<PsiMethod> methodsToFind = new HashSet<PsiMethod>();
     methodsToFind.add(method);
-    methodsToFind.addAll(Arrays.asList(method.findDeepestSuperMethods()));
+    ContainerUtil.addAll(methodsToFind, method.findDeepestSuperMethods());
 
-    final Map<PsiMember,CallHierarchyNodeDescriptor> methodToDescriptorMap = new HashMap<PsiMember, CallHierarchyNodeDescriptor>();
+    final Map<PsiMember, CallHierarchyNodeDescriptor> methodToDescriptorMap = new HashMap<PsiMember, CallHierarchyNodeDescriptor>();
     for (final PsiMethod methodToFind : methodsToFind) {
       MethodReferencesSearch.search(methodToFind, searchScope, true).forEach(new Processor<PsiReference>() {
         public boolean process(final PsiReference reference) {
@@ -73,7 +74,9 @@ public final class CallerMethodsTreeStructure extends HierarchyTreeStructure {
             }
             if (qualifier != null && !methodToFind.hasModifierProperty(PsiModifier.STATIC)) {
               final PsiType qualifierType = qualifier.getType();
-              if (qualifierType instanceof PsiClassType && !TypeConversionUtil.isAssignable(qualifierType, originalType) && methodToFind != method) {
+              if (qualifierType instanceof PsiClassType &&
+                  !TypeConversionUtil.isAssignable(qualifierType, originalType) &&
+                  methodToFind != method) {
                 final PsiClass psiClass = ((PsiClassType)qualifierType).resolve();
                 if (psiClass != null) {
                   final PsiMethod callee = psiClass.findMethodBySignature(methodToFind, true);
index fc22d4ee89f58757ef1375ea9af1a05c7796ebbc..88b660cc33463f0036f3a1ddeda71098717f0dc6 100644 (file)
@@ -17,6 +17,7 @@ package com.intellij.ide.projectView;
 
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.PsiElement;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.Arrays;
 import java.util.List;
@@ -30,19 +31,19 @@ public interface PsiClassChildrenSource {
 
   PsiClassChildrenSource METHODS = new PsiClassChildrenSource() {
     public void addChildren(PsiClass psiClass, List<PsiElement> children) {
-      children.addAll(Arrays.asList(psiClass.getMethods()));
+      ContainerUtil.addAll(children, psiClass.getMethods());
     }
   };
 
   PsiClassChildrenSource FIELDS = new PsiClassChildrenSource() {
     public void addChildren(PsiClass psiClass, List<PsiElement> children) {
-      children.addAll(Arrays.asList(psiClass.getFields()));
+      ContainerUtil.addAll(children, psiClass.getFields());
     }
   };
 
   PsiClassChildrenSource CLASSES = new PsiClassChildrenSource() {
     public void addChildren(PsiClass psiClass, List<PsiElement> children) {
-      children.addAll(Arrays.asList(psiClass.getInnerClasses()));
+      ContainerUtil.addAll(children, psiClass.getInnerClasses());
     }
   };
 
index 2c882b11ad420340dbe8659c8dbff935048c86a3..f96b1ec5772c2b16ff572c6eacf0d1727b8d0bbf 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.psi.JavaDirectoryService;
 import com.intellij.psi.PsiDirectory;
 import com.intellij.psi.PsiManager;
 import com.intellij.psi.PsiPackage;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.lang.reflect.InvocationTargetException;
@@ -55,7 +56,7 @@ public class PackageViewProjectNode extends AbstractProjectNode {
     else {
       final List<VirtualFile> sourceRoots = new ArrayList<VirtualFile>();
       final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(myProject);
-      sourceRoots.addAll(Arrays.asList(projectRootManager.getContentSourceRoots()));
+      ContainerUtil.addAll(sourceRoots, projectRootManager.getContentSourceRoots());
 
       final PsiManager psiManager = PsiManager.getInstance(myProject);
       final List<AbstractTreeNode> children = new ArrayList<AbstractTreeNode>();
index bf0c6916becacdb183ef906f28afc17bce46e498..b97433a98ca35dac434021dfa690ec48505a0617 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.ide.structureView.impl.java;
 import com.intellij.ide.structureView.StructureViewTreeElement;
 import com.intellij.ide.structureView.impl.AddAllMembersProcessor;
 import com.intellij.psi.*;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NotNull;
 
@@ -41,10 +42,10 @@ public class JavaClassTreeElement extends JavaClassTreeElementBase<PsiClass> {
 
     List<PsiElement> children = Arrays.asList(aClass.getChildren());
     Collection<PsiElement> ownChildren = new THashSet<PsiElement>();
-    ownChildren.addAll(Arrays.asList(aClass.getFields()));
-    ownChildren.addAll(Arrays.asList(aClass.getMethods()));
-    ownChildren.addAll(Arrays.asList(aClass.getInnerClasses()));
-    ownChildren.addAll(Arrays.asList(aClass.getInitializers()));
+    ContainerUtil.addAll(ownChildren, aClass.getFields());
+    ContainerUtil.addAll(ownChildren, aClass.getMethods());
+    ContainerUtil.addAll(ownChildren, aClass.getInnerClasses());
+    ContainerUtil.addAll(ownChildren, aClass.getInitializers());
     Collection<PsiElement> inherited = new LinkedHashSet<PsiElement>(children);
 
     aClass.processDeclarations(new AddAllMembersProcessor(inherited, aClass), ResolveState.initial(), null, aClass);
index 82dc5ca09ee9225687b3ede423684cd44031f7b9..940fe5796060a0d5bc67cb9756b6173bc13bcb12 100644 (file)
@@ -31,6 +31,7 @@ import com.intellij.openapi.roots.ProjectRootManager;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.*;
 import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
@@ -59,12 +60,12 @@ public class TodoJavaTreeHelper extends TodoTreeHelper {
   public void addPackagesToChildren(final ArrayList<AbstractTreeNode> children, final Module module, final TodoTreeBuilder builder) {
     final PsiManager psiManager = PsiManager.getInstance(getProject());
     final List<VirtualFile> sourceRoots = new ArrayList<VirtualFile>();
-    if (module == null){
+    if (module == null) {
       final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(getProject());
-      sourceRoots.addAll(Arrays.asList(projectRootManager.getContentSourceRoots()));
+      ContainerUtil.addAll(sourceRoots, projectRootManager.getContentSourceRoots());
     } else {
       ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);
-      sourceRoots.addAll(Arrays.asList(moduleRootManager.getSourceRoots()));
+      ContainerUtil.addAll(sourceRoots, moduleRootManager.getSourceRoots());
     }
     final Set<PsiPackage> topLevelPackages = new HashSet<PsiPackage>();
     for (final VirtualFile root : sourceRoots) {
@@ -187,4 +188,4 @@ public class TodoJavaTreeHelper extends TodoTreeHelper {
     }
     return isEmpty;
   }
-}
\ No newline at end of file
+}
index beba42382ee0032b792d968356adc1ec27696e46..5e9a65aef891dddf7411e2aae162091332c43fe7 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.PsiShortNamesCache;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 
 import java.util.*;
@@ -52,9 +53,9 @@ public class DefaultSymbolNavigationContributor implements ChooseByNameContribut
     PsiClass[] classes = cache.getClassesByName(name, scope);
 
     List<PsiMember> result = new ArrayList<PsiMember>();
-    result.addAll(Arrays.asList(methods));
-    result.addAll(Arrays.asList(fields));
-    result.addAll(Arrays.asList(classes));
+    ContainerUtil.addAll(result, methods);
+    ContainerUtil.addAll(result, fields);
+    ContainerUtil.addAll(result, classes);
     filterOutNonOpenable(result);
     PsiMember[] array = result.toArray(new PsiMember[result.size()]);
     Arrays.sort(array, MyComparator.INSTANCE);
index d1dfb59d57af9421be3c317191de7e91adff7456..0d385daa40b1888f858032c6326d833c6562b31d 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.options.colors.AttributesDescriptor;
 import com.intellij.openapi.options.colors.ColorDescriptor;
 import com.intellij.openapi.options.colors.ColorSettingsPage;
 import com.intellij.pom.java.LanguageLevel;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
@@ -124,10 +125,13 @@ public class JavaColorSettingsPage implements ColorSettingsPage, InspectionColor
   @NotNull
   public AttributesDescriptor[] getAttributeDescriptors() {
     List<AttributesDescriptor> descriptors = new ArrayList<AttributesDescriptor>();
-    descriptors.addAll(Arrays.asList(ourDescriptors));
-    descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.full.coverage"), CodeInsightColors.LINE_FULL_COVERAGE));
-    descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.partial.coverage"), CodeInsightColors.LINE_PARTIAL_COVERAGE));
-    descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.none.coverage"), CodeInsightColors.LINE_NONE_COVERAGE));
+    ContainerUtil.addAll(descriptors, ourDescriptors);
+    descriptors.add(
+      new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.full.coverage"), CodeInsightColors.LINE_FULL_COVERAGE));
+    descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.partial.coverage"),
+                                             CodeInsightColors.LINE_PARTIAL_COVERAGE));
+    descriptors.add(
+      new AttributesDescriptor(OptionsBundle.message("options.java.color.descriptor.none.coverage"), CodeInsightColors.LINE_NONE_COVERAGE));
     return descriptors.toArray(new AttributesDescriptor[descriptors.size()]);
   }
 
index 8e2b5cddb8100d07f512a9dbc33b2cd4ee34ad93..70574ed584f91abf22cd333b4072b8d95aef5b4e 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.psi.impl.file.PsiPackageImpl;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.NonClasspathDirectoryScope;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.*;
@@ -86,7 +87,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder {
             if (!file.isDirectory()) {
               final PsiFile psi = PsiManager.getInstance(myProject).findFile(file);
               if (psi instanceof PsiClassOwner) {
-                result.addAll(Arrays.asList(((PsiClassOwner)psi).getClasses()));
+                ContainerUtil.addAll(result, ((PsiClassOwner)psi).getClasses());
               }
             }
           }
index 2b1c1fee6ac6f0a54e2b0e0e37f0509a691dfa2a..40c5af792b87bf62cdc55a2c69fa86633e17876d 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.psi.PsiMethod;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.PsiShortNamesCache;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NonNls;
@@ -188,7 +189,7 @@ public class CompositeShortNamesCache extends PsiShortNamesCache {
       if (myAllItems == null) {
         myAllItems = new THashSet<T>(Arrays.asList(mySingleItem));
       }
-      myAllItems.addAll(Arrays.asList(items));
+      ContainerUtil.addAll(myAllItems, items);
     }
 
     public T[] getResult() {
@@ -202,4 +203,4 @@ public class CompositeShortNamesCache extends PsiShortNamesCache {
   public String toString() {
     return "Composite cache: " + myCaches;
   }
-}
\ No newline at end of file
+}
index b08d11e023e5c851c095b0a2aa48aad4ba3cfa99..19e95aa46b7b1b6e5e696eeb95f0153d1a4ff7ef 100644 (file)
@@ -60,6 +60,7 @@ import com.intellij.util.ConcurrencyUtil;
 import com.intellij.util.Processor;
 import com.intellij.util.SmartList;
 import com.intellij.util.containers.ConcurrentHashMap;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.messages.MessageBus;
 import org.jetbrains.annotations.NotNull;
@@ -100,7 +101,7 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx implements Disposable {
 
     List<PsiElementFinder> elementFinders = new ArrayList<PsiElementFinder>();
     elementFinders.add(new PsiElementFinderImpl());
-    elementFinders.addAll(Arrays.asList(myProject.getExtensions(PsiElementFinder.EP_NAME)));
+    ContainerUtil.addAll(elementFinders, myProject.getExtensions(PsiElementFinder.EP_NAME));
     myElementFinders = elementFinders.toArray(new PsiElementFinder[elementFinders.size()]);
 
     myPackagePrefixIndex = new PackagePrefixIndex(myProject);
@@ -109,7 +110,8 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx implements Disposable {
 
     if (isProjectDefault) {
       myShortNamesCache = new EmptyShortNamesCacheImpl();
-    } else {
+    }
+    else {
       myShortNamesCache = new PsiShortNamesCacheImpl((PsiManagerEx)PsiManager.getInstance(project));
       for (final PsiShortNamesCache cache : project.getExtensions(PsiShortNamesCache.EP_NAME)) {
         _registerShortNamesCache(cache);
@@ -118,11 +120,12 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx implements Disposable {
 
     myFileManager = new JavaFileManagerImpl(psiManager, projectRootManagerEx, psiManager.getFileManager(), bus);
 
-    final PsiModificationTrackerImpl modificationTracker = (PsiModificationTrackerImpl) psiManager.getModificationTracker();
+    final PsiModificationTrackerImpl modificationTracker = (PsiModificationTrackerImpl)psiManager.getModificationTracker();
     psiManager.addTreeChangePreprocessor(new JavaCodeBlockModificationListener(modificationTracker));
 
     bus.connect().subscribe(ProjectTopics.MODIFICATION_TRACKER, new PsiModificationTracker.Listener() {
       private long lastTimeSeen = -1L;
+
       public void modificationCountChanged() {
         final long now = modificationTracker.getJavaStructureModificationCount();
         if (lastTimeSeen != now) {
@@ -224,7 +227,7 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx implements Disposable {
     List<PsiClass> classes = new SmartList<PsiClass>();
     for (PsiElementFinder finder : myElementFinders) {
       PsiClass[] finderClasses = finder.findClasses(qualifiedName, scope);
-      classes.addAll(Arrays.asList(finderClasses));
+      ContainerUtil.addAll(classes, finderClasses);
     }
 
     return classes.toArray(new PsiClass[classes.size()]);
@@ -322,7 +325,7 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx implements Disposable {
       PsiClass[] classes = finder.getClasses(psiPackage, scope);
       if (classes.length == 0) continue;
       if (result == null) result = new ArrayList<PsiClass>();
-      result.addAll(Arrays.asList(classes));
+      ContainerUtil.addAll(result, classes);
     }
 
     return result == null ? PsiClass.EMPTY_ARRAY : result.toArray(new PsiClass[result.size()]);
@@ -341,7 +344,7 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx implements Disposable {
     List<PsiPackage> result = new ArrayList<PsiPackage>();
     for (PsiElementFinder finder : myElementFinders) {
       PsiPackage[] packages = finder.getSubPackages(psiPackage, scope);
-      result.addAll(Arrays.asList(packages));
+      ContainerUtil.addAll(result, packages);
     }
 
     return result.toArray(new PsiPackage[result.size()]);
index 9ad79c328ef77d696cdfc4a370b4af4c440beee2..100037aa9bc82a66716230415eb7837e8dee56a1 100644 (file)
@@ -38,6 +38,7 @@ import com.intellij.pom.java.LanguageLevel;
 import com.intellij.psi.*;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.ArrayList;
@@ -65,7 +66,7 @@ public class JavaDirectoryServiceImpl extends JavaDirectoryService {
         PsiClass[] psiClasses = ((PsiClassOwner)file).getClasses();
         if (psiClasses.length == 0) continue;
         if (classes == null) classes = new ArrayList<PsiClass>();
-        classes.addAll(Arrays.asList(psiClasses));
+        ContainerUtil.addAll(classes, psiClasses);
       }
     }
     return classes == null ? PsiClass.EMPTY_ARRAY : classes.toArray(new PsiClass[classes.size()]);
index e262972b78ba740b0ca1cacac369804a344d9f3e..e92b5e4830b60dc7baf58e17995e4dce8e87389f 100644 (file)
@@ -38,6 +38,7 @@ import com.intellij.psi.search.LocalSearchScope;
 import com.intellij.psi.search.searches.ReferencesSearch;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashMap;
 import gnu.trove.THashSet;
 import gnu.trove.TObjectIntHashMap;
@@ -645,9 +646,9 @@ public class ImportHelper{
       final PsiElement child = stack.removeFirst();
       if (child instanceof PsiImportList) continue;
       if (child instanceof PsiLiteralExpression) continue;
-      stack.addAll(Arrays.asList(child.getChildren()));
+      ContainerUtil.addAll(stack, child.getChildren());
 
-      for(final PsiReference reference : child.getReferences()){
+      for (final PsiReference reference : child.getReferences()) {
         if (!(reference instanceof PsiJavaReference)) continue;
         final PsiJavaReference javaReference = (PsiJavaReference)reference;
         if (javaReference instanceof JavaClassReference && ((JavaClassReference)javaReference).getContextReference() != null) continue;
@@ -674,8 +675,8 @@ public class ImportHelper{
         if (!(currentFileResolveScope instanceof PsiImportStatementBase)) continue;
         if (context != null &&
             (!currentFileResolveScope.isValid() ||
-            currentFileResolveScope instanceof JspxImportStatement &&
-            context != ((JspxImportStatement)currentFileResolveScope).getDeclarationFile())) {
+             currentFileResolveScope instanceof JspxImportStatement &&
+             context != ((JspxImportStatement)currentFileResolveScope).getDeclarationFile())) {
           continue;
         }
 
index 59576163721dc9d64bd3ecb17819d85d9351bc16..34d4227181b3b56a52bb939ad3ff6c7a2de96336 100644 (file)
@@ -37,6 +37,7 @@ import com.intellij.psi.util.PsiUtil;
 import com.intellij.psi.util.TypeConversionUtil;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 import gnu.trove.THashSet;
 import gnu.trove.TObjectHashingStrategy;
@@ -135,7 +136,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
     if (JspPsiUtil.isInJspFile(file)) {
       // remove only duplicate imports
       redundants = new THashSet<PsiImportStatementBase>(TObjectHashingStrategy.IDENTITY);
-      redundants.addAll(Arrays.asList(imports));
+      ContainerUtil.addAll(redundants, imports);
       redundants.removeAll(allImports);
       for (PsiImportStatementBase importStatement : imports) {
         if (importStatement instanceof JspxImportStatement && ((JspxImportStatement)importStatement).isForeignFileImport()) {
@@ -231,7 +232,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
     if (propertyName != null) {
       String[] namesByName = getSuggestionsByName(propertyName, kind, false);
       sortVariableNameSuggestions(namesByName, kind, propertyName, null);
-      names.addAll(Arrays.asList(namesByName));
+      ContainerUtil.addAll(names, namesByName);
     }
 
     final NamesByExprInfo namesByExpr;
@@ -240,7 +241,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
       if (namesByExpr.propertyName != null) {
         sortVariableNameSuggestions(namesByExpr.names, kind, namesByExpr.propertyName, null);
       }
-      names.addAll(Arrays.asList(namesByExpr.names));
+      ContainerUtil.addAll(names, namesByExpr.names);
     }
     else {
       namesByExpr = null;
@@ -249,7 +250,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
     if (type != null) {
       String[] namesByType = suggestVariableNameByType(type, kind);
       sortVariableNameSuggestions(namesByType, kind, null, type);
-      names.addAll(Arrays.asList(namesByType));
+      ContainerUtil.addAll(names, namesByType);
     }
 
     final String _propertyName;
@@ -327,7 +328,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
 
     String typeName = normalizeTypeName(getTypeName(type));
     if (typeName != null) {
-      suggestions.addAll(Arrays.asList(getSuggestionsByName(typeName, variableKind, type instanceof PsiArrayType)));
+      ContainerUtil.addAll(suggestions, getSuggestionsByName(typeName, variableKind, type instanceof PsiArrayType));
     }
 
     return ArrayUtil.toStringArray(suggestions);
@@ -352,7 +353,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
     String baseName = normalizeTypeName(getTypeName(type));
     if (baseName != null) {
       fullNameBuilder.append(baseName);
-      suggestions.addAll(Arrays.asList(getSuggestionsByName(fullNameBuilder.toString(), variableKind, false)));
+      ContainerUtil.addAll(suggestions, getSuggestionsByName(fullNameBuilder.toString(), variableKind, false));
     }
   }
 
@@ -411,7 +412,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
             }
             String typeName = normalizeTypeName(getTypeName(componentType));
             if (typeName != null) {
-              suggestions.addAll(Arrays.asList(getSuggestionsByName(typeName, variableKind, true)));
+              ContainerUtil.addAll(suggestions, getSuggestionsByName(typeName, variableKind, true));
             }
           }
         }
@@ -561,10 +562,10 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
     }
 
     LinkedHashSet<String> names = new LinkedHashSet<String>();
-    names.addAll(Arrays.asList(names1.names));
-    names.addAll(Arrays.asList(names2.names));
+    ContainerUtil.addAll(names, names1.names);
+    ContainerUtil.addAll(names, names2.names);
     if (names3 != null) {
-      names.addAll(Arrays.asList(names3));
+      ContainerUtil.addAll(names, names3);
     }
     String[] namesArray = ArrayUtil.toStringArray(names);
     String propertyName = names1.propertyName != null ? names1.propertyName : names2.propertyName;
index 4bd8be483631ddbadf866df33f995159c6b18d9d..d7cb5d811554cba4f91c48b4d20a36a2b29a6766 100644 (file)
@@ -23,6 +23,7 @@ import com.intellij.psi.util.PsiUtil;
 import com.intellij.psi.javadoc.JavadocTagInfo;
 import com.intellij.psi.javadoc.PsiDocTagValue;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -47,7 +48,7 @@ class ParamDocTagInfo implements JavadocTagInfo {
 
       if ((PsiTypeParameterListOwner)context instanceof PsiMethod) {
         PsiMethod method = (PsiMethod)context;
-        result.addAll(Arrays.asList(method.getParameterList().getParameters()));
+        ContainerUtil.addAll(result, method.getParameterList().getParameters());
       }
 
       return result.toArray(new PsiNamedElement[result.size()]);
index b6902af7d931ff044890115352b85774bc8ad73d..5dc1fc850453f5d6c87b992fe1206079436bd135 100644 (file)
@@ -36,6 +36,7 @@ import com.intellij.util.ArrayUtil;
 import com.intellij.util.CharTable;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -257,8 +258,8 @@ public class PsiDocMethodOrFieldRef extends CompositePsiElement implements PsiDo
       final List<PsiModifierListOwner> vars = new ArrayList<PsiModifierListOwner>();
       final PsiElement scope = getScope();
       if (scope != null) {
-        vars.addAll(Arrays.asList(getAllMethods(scope, PsiDocMethodOrFieldRef.this)));
-        vars.addAll(Arrays.asList(getAllVariables(scope, PsiDocMethodOrFieldRef.this)));
+        ContainerUtil.addAll(vars, getAllMethods(scope, PsiDocMethodOrFieldRef.this));
+        ContainerUtil.addAll(vars, getAllVariables(scope, PsiDocMethodOrFieldRef.this));
       }
       return vars.toArray(new PsiModifierListOwner[vars.size()]);
     }
index 8e4d9613e170be22cd489b9835c2ad21fe19c748..20a161681a0bc2995384acf7d901b1140f28b076 100644 (file)
@@ -23,6 +23,7 @@ import com.intellij.openapi.util.TextRange;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.*;
 import com.intellij.util.ProcessingContext;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.*;
@@ -109,7 +110,7 @@ public class FilePathReferenceProvider extends PsiReferenceProvider {
     List<Module> modules = new ArrayList<Module>();
     modules.add(thisModule);
     ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(thisModule);
-    modules.addAll(Arrays.asList(moduleRootManager.getDependencies()));
+    ContainerUtil.addAll(modules, moduleRootManager.getDependencies());
 
     List<PsiFileSystemItem> result = new ArrayList<PsiFileSystemItem>();
     final PsiManager psiManager = PsiManager.getInstance(thisModule.getProject());
index d2ab61beac96eb8ef9aa2106f80cdcfd95666c11..e32df206a0ba0ca1ce4259a49748f3a3d1419132 100644 (file)
@@ -95,11 +95,11 @@ public class JavaClassListReferenceProvider extends JavaClassReferenceProvider {
           }
         }
         String s = str.substring(start, end + 1);
-        results.addAll(Arrays.asList(new JavaClassReferenceSet(s, position, offsetInPosition + start, false, this){
-          public boolean isSoft(){
+        ContainerUtil.addAll(results, new JavaClassReferenceSet(s, position, offsetInPosition + start, false, this) {
+          public boolean isSoft() {
             return true;
           }
-        }.getAllReferences()));
+        }.getAllReferences());
         ProgressManager.checkCanceled();
       }
     }
index 8e8890f27c511ed869f803c05991436ed81d8b79..972167c8716c50fc2dafa638e5088b29daa3f48a 100644 (file)
@@ -275,7 +275,7 @@ public class JavaClassReference extends GenericReference implements PsiJavaRefer
       }
     }
     else {
-      list.addAll(Arrays.asList(classes));
+      ContainerUtil.addAll(list, classes);
     }
     return list.toArray();
   }
index a53b0ccdfd29eaee3d685f189abb4ab7799edf58..dc40a808c6159f63851541b996a9d86664623c52 100644 (file)
@@ -23,6 +23,7 @@ import com.intellij.psi.PsiAnnotation;
 import com.intellij.psi.PsiManager;
 import com.intellij.psi.PsiModifierList;
 import com.intellij.psi.impl.light.LightModifierList;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.ArrayList;
@@ -41,7 +42,7 @@ public class PsiCompositeModifierList extends LightModifierList {
   public PsiAnnotation[] getAnnotations() {
     List<PsiAnnotation> annotations = new ArrayList<PsiAnnotation>();
     for (PsiModifierList list : mySublists) {
-      annotations.addAll(Arrays.asList(list.getAnnotations()));
+      ContainerUtil.addAll(annotations, list.getAnnotations());
     }
     return annotations.toArray(new PsiAnnotation[annotations.size()]);
   }
@@ -68,4 +69,4 @@ public class PsiCompositeModifierList extends LightModifierList {
     }
     return false;
   }
-}
\ No newline at end of file
+}
index e0e6f39cf9130ea4b7c0272e4e1149537c95f505..cd8ff0b67273bdebd95b2ad8305000a2568e012e 100644 (file)
@@ -38,6 +38,7 @@ import com.intellij.refactoring.util.usageInfo.NoConstructorClassUsageInfo;
 import com.intellij.usageView.UsageInfo;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.VisibilityUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 import com.intellij.util.containers.MultiMap;
 import org.jetbrains.annotations.Nullable;
@@ -662,7 +663,7 @@ public class JavaChangeSignatureUsageProcessor implements ChangeSignatureUsagePr
     LOG.assertTrue(toInsertParams || toInsertThrows);
     if (toInsertParams) {
       List<PsiParameter> newParameters = new ArrayList<PsiParameter>();
-      newParameters.addAll(Arrays.asList(caller.getParameterList().getParameters()));
+      ContainerUtil.addAll(newParameters, caller.getParameterList().getParameters());
       final JavaParameterInfo[] primaryNewParms = changeInfo.getNewParameters();
       PsiSubstitutor substitutor =
         baseMethod == null ? PsiSubstitutor.EMPTY : ChangeSignatureProcessor.calculateSubstitutor(caller, baseMethod);
@@ -678,7 +679,7 @@ public class JavaChangeSignatureUsageProcessor implements ChangeSignatureUsagePr
     if (toInsertThrows) {
       List<PsiJavaCodeReferenceElement> newThrowns = new ArrayList<PsiJavaCodeReferenceElement>();
       final PsiReferenceList throwsList = caller.getThrowsList();
-      newThrowns.addAll(Arrays.asList(throwsList.getReferenceElements()));
+      ContainerUtil.addAll(newThrowns, throwsList.getReferenceElements());
       final ThrownExceptionInfo[] primaryNewExns = changeInfo.getNewExceptions();
       for (ThrownExceptionInfo thrownExceptionInfo : primaryNewExns) {
         if (thrownExceptionInfo.getOldIndex() < 0) {
index 0ec986ef9178210c85ec62708ec749bb046b0d24..e4fa01f147d33b48d1a5b82a375bc9353250e57f 100644 (file)
@@ -35,6 +35,7 @@ import com.intellij.refactoring.util.usageInfo.DefaultConstructorImplicitUsageIn
 import com.intellij.refactoring.util.usageInfo.NoConstructorClassUsageInfo;
 import com.intellij.usageView.UsageInfo;
 import com.intellij.usageView.UsageViewUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 
 import java.util.ArrayList;
@@ -101,7 +102,7 @@ class JavaChangeSignatureUsageSearcher {
     final PsiParameter[] parameters = method.getParameterList().getParameters();
     final Set<PsiParameter> deletedOrRenamedParameters = new HashSet<PsiParameter>();
     if (isOriginal) {
-      deletedOrRenamedParameters.addAll(Arrays.asList(parameters));
+      ContainerUtil.addAll(deletedOrRenamedParameters, parameters);
       for (ParameterInfo parameterInfo : myChangeInfo.getNewParameters()) {
         if (parameterInfo.getOldIndex() >= 0 && parameterInfo.getOldIndex() < parameters.length) {
           final PsiParameter parameter = parameters[parameterInfo.getOldIndex()];
index 912b44ab088ab1354f522fb4edf428ad8e9f69e4..3fc2c91f2998538b4f366a2954c4414b699df5fc 100644 (file)
@@ -51,6 +51,7 @@ import com.intellij.usageView.UsageInfo;
 import com.intellij.usageView.UsageViewDescriptor;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.VisibilityUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.MultiMap;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -110,7 +111,7 @@ public class ExtractClassProcessor extends FixableUsagesRefactoringProcessor {
     delegateFieldName = calculateDelegateFieldName();
     requiresBackpointer = new BackpointerUsageVisitor(fields, innerClasses, methods, sourceClass).backpointerRequired();
     if (requiresBackpointer) {
-      typeParams.addAll(Arrays.asList(sourceClass.getTypeParameters()));
+      ContainerUtil.addAll(typeParams, sourceClass.getTypeParameters());
     }
     else {
       final Set<PsiTypeParameter> typeParamSet = new HashSet<PsiTypeParameter>();
index 5c5036683675e1678e46f9a8eec435652157b7e2..8251c894ac99fed55925ca5ce8a28887b1bfa562 100644 (file)
@@ -44,6 +44,7 @@ import com.intellij.usageView.UsageInfo;
 import com.intellij.usageView.UsageViewDescriptor;
 import com.intellij.usageView.UsageViewUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.MultiMap;
 import org.jetbrains.annotations.NotNull;
 
@@ -200,7 +201,7 @@ public abstract class MakeMethodOrClassStaticProcessor<T extends PsiTypeParamete
   protected UsageInfo[] findUsages() {
     ArrayList<UsageInfo> result = new ArrayList<UsageInfo>();
 
-    result.addAll(Arrays.asList(MakeStaticUtil.findClassRefsInMember(myMember, true)));
+    ContainerUtil.addAll(result, MakeStaticUtil.findClassRefsInMember(myMember, true));
 
     if (mySettings.isReplaceUsages()) {
       findExternalUsages(result);
index 1430da9bea022d59d7222b85e2dd7046e9d41c8b..ed51d5326147af5020d20b07703116d5aaf8f303 100644 (file)
@@ -37,6 +37,7 @@ import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.makeStatic.MakeStaticHandler;
 import com.intellij.refactoring.move.MoveInstanceMembersUtil;
 import com.intellij.refactoring.util.CommonRefactoringUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -131,8 +132,8 @@ public class MoveInstanceMethodHandler implements RefactoringActionHandler {
   @Nullable
   private static String collectSuitableVariables(final PsiMethod method, final List<PsiVariable> suitableVariables) {
     final List<PsiVariable> allVariables = new ArrayList<PsiVariable>();
-    allVariables.addAll(Arrays.asList(method.getParameterList().getParameters()));
-    allVariables.addAll(Arrays.asList(method.getContainingClass().getFields()));
+    ContainerUtil.addAll(allVariables, method.getParameterList().getParameters());
+    ContainerUtil.addAll(allVariables, method.getContainingClass().getFields());
     boolean classTypesFound = false;
     boolean resolvableClassesFound = false;
     boolean classesInProjectFound = false;
index 2852d5b6144c82ba0534d42d5a652361eef940de..6ddce912fa95669fc05bf69a25dee8072f7200da 100644 (file)
@@ -45,6 +45,7 @@ import com.intellij.usageView.UsageViewDescriptor;
 import com.intellij.usageView.UsageViewUtil;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.VisibilityUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.containers.MultiMap;
 import org.jetbrains.annotations.NotNull;
@@ -80,7 +81,7 @@ public class MoveMembersProcessor extends BaseRefactoringProcessor {
     myOptions = dialog;
     PsiMember[] members = dialog.getSelectedMembers();
     myMembersToMove.clear();
-    myMembersToMove.addAll(Arrays.asList(members));
+    ContainerUtil.addAll(myMembersToMove, members);
 
     setCommandName(members);
 
index 9f78f9d47e37e9bf7c3a00d6e29dd678ce1ad12c..2bbdaaf7862d6cf0b3e03a086aac915eb1670585 100644 (file)
@@ -13,6 +13,7 @@ import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.MethodSignatureUtil;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.refactoring.typeMigration.usageInfo.TypeMigrationUsageInfo;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.*;
 
@@ -153,7 +154,7 @@ public class ClassTypeArgumentMigrationProcessor {
     private final Set<PsiTypeParameter> myTypeParams = new HashSet<PsiTypeParameter>();
 
     private TypeParameterSearcher(final PsiTypeParameter[] set) {
-      myTypeParams.addAll(Arrays.asList(set));
+      ContainerUtil.addAll(myTypeParams, set);
     }
 
     public Boolean visitType(final PsiType type) {
index da6f08d8bd3be837368e4d39cadfd70784439ec8..ebe534526fb399691a6e250301dca5d50536875d 100644 (file)
@@ -6,6 +6,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.search.SearchScope;
 import com.intellij.psi.util.TypeConversionUtil;
 import com.intellij.refactoring.typeMigration.rules.*;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.Nullable;
 
@@ -29,7 +30,7 @@ public class TypeMigrationRules {
   public TypeMigrationRules(final PsiType root) {
     myRootType = root;
     myConversionRules.add(new RootTypeConversionRule());
-    myConversionRules.addAll(Arrays.asList(Extensions.getExtensions(TypeConversionRule.EP_NAME)));
+    ContainerUtil.addAll(myConversionRules, Extensions.getExtensions(TypeConversionRule.EP_NAME));
   }
 
   public void setMigrationRootType(PsiType migrationRootType) {
index b5e9fa54880f3e76fe91ceb08ad12a5b9ffcbf29..04f3686b1f354211b71d359af9a02b74d48a20b4 100644 (file)
@@ -1,5 +1,6 @@
 package com.intellij.psi.impl.compiled;
 
+import com.intellij.util.containers.ContainerUtil;
 import junit.framework.TestCase;
 
 import java.util.*;
@@ -123,7 +124,7 @@ public class ClassFileStubBuilderTest extends TestCase {
 
   private static boolean isInner(String name, String... files) {
     Set<String> all = new HashSet<String>();
-    all.addAll(Arrays.asList(files));
+    ContainerUtil.addAll(all, files);
     all.add(name);
     return ClassFileStubBuilder.isInner(name, new DirectoryMock(all));
   }
@@ -140,4 +141,4 @@ public class ClassFileStubBuilderTest extends TestCase {
       return myFiles.contains(name);
     }
   }
-}
\ No newline at end of file
+}
index 9d93d39a8288daf3f34ef307f382473d00cfdcc6..8553a9634ff5e061a938c8381aec69c72a1be399 100644 (file)
@@ -9,6 +9,7 @@ import com.intellij.psi.PsiMethod;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.refactoring.inheritanceToDelegation.InheritanceToDelegationProcessor;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -167,7 +168,7 @@ public class InheritanceToDelegationTest extends MultiFileTestCase {
         final List<PsiMethod> methodsList = new ArrayList<PsiMethod>();
         for (String name : methodNames) {
           final PsiMethod[] methodsByName = baseClass.findMethodsByName(name, false);
-          methodsList.addAll(Arrays.asList(methodsByName));
+          ContainerUtil.addAll(methodsList, methodsByName);
         }
         delegatedMethods = methodsList.toArray(new PsiMethod[methodsList.size()]);
 
index a7dc32a7cfaa76e778546f6f9ef0a47e478411f5..7c5fdc002d4baa14b3297ccea0d7a969a3392d71 100644 (file)
@@ -16,6 +16,7 @@ import com.intellij.openapi.util.EmptyRunnable;
 import com.intellij.openapi.util.io.FileUtil;
 import com.intellij.openapi.vfs.*;
 import com.intellij.testFramework.IdeaTestCase;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.io.File;
 import java.io.IOException;
@@ -516,9 +517,9 @@ public class DirectoryIndexImplTest extends IdeaTestCase {
     VirtualFile[] actualDirs = myIndex.getDirectoriesByPackageName(packageName, true).toArray(VirtualFile.EMPTY_ARRAY);
     assertNotNull(actualDirs);
     HashSet<VirtualFile> set1 = new HashSet<VirtualFile>();
-    set1.addAll(Arrays.asList(expectedDirs));
+    ContainerUtil.addAll(set1, expectedDirs);
     HashSet<VirtualFile> set2 = new HashSet<VirtualFile>();
-    set2.addAll(Arrays.asList(actualDirs));
+    ContainerUtil.addAll(set2, actualDirs);
     assertEquals(set1, set2);
   }
 }
index cb964f5b21c3714fd12af8dc568db5da5e304d58..6c93c225d4a210963eba86c3ddabb1cec89b0c65 100644 (file)
@@ -29,6 +29,7 @@ import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.ui.ScrollPaneFactory;
 import com.intellij.ui.TableUtil;
 import com.intellij.ui.UIBundle;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.ItemRemovable;
 import com.intellij.util.ui.Table;
 import com.intellij.util.ui.UIUtil;
@@ -177,7 +178,7 @@ public class ClassFilterEditor extends JPanel {
     public final void setFilters(ClassFilter[] filters) {
       myFilters.clear();
       if (filters != null) {
-        myFilters.addAll(Arrays.asList(filters));
+        ContainerUtil.addAll(myFilters, filters);
       }
       fireTableDataChanged();
     }
index ca799298e9952a0f28580038288f7ee444701b08..ed2577ac1e1ca9444f145b2086679891756fdbd2 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.openapi.application.PathManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.lang.UrlClassLoader;
 import com.intellij.util.text.StringTokenizer;
 import org.jetbrains.annotations.NonNls;
@@ -167,7 +168,7 @@ public class ClassloaderUtil {
     final ClassLoader loader = ClassloaderUtil.class.getClassLoader();
     if (loader instanceof URLClassLoader) {
       URLClassLoader urlClassLoader = (URLClassLoader)loader;
-      aClasspathElements.addAll(Arrays.asList(urlClassLoader.getURLs()));
+      ContainerUtil.addAll(aClasspathElements, urlClassLoader.getURLs());
     }
     else {
       try {
index 7cccb7aa5a321f524c052c15a6e6410be341da20..bf62371697faf19b37468efb435d6745ba9ff05c 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.openapi.util.Ref;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 import com.intellij.util.text.StringTokenizer;
 import org.jetbrains.annotations.NonNls;
@@ -113,17 +114,17 @@ public class LibraryUtil {
           final Library library = ((LibraryOrderEntry)entry).getLibrary();
           if (library != null) {
             VirtualFile[] files = includeSourceFiles ? library.getFiles(OrderRootType.SOURCES) : null;
-            if (files == null || files.length == 0){
+            if (files == null || files.length == 0) {
               files = library.getFiles(OrderRootType.CLASSES);
             }
-            roots.addAll(Arrays.asList(files));
+            ContainerUtil.addAll(roots, files);
           }
-        } else if (includeJdk && entry instanceof JdkOrderEntry){
+        } else if (includeJdk && entry instanceof JdkOrderEntry) {
           VirtualFile[] files = includeSourceFiles ? entry.getFiles(OrderRootType.SOURCES) : null;
-          if (files == null || files.length == 0){
+          if (files == null || files.length == 0) {
             files = entry.getFiles(OrderRootType.CLASSES);
           }
-          roots.addAll(Arrays.asList(files));
+          ContainerUtil.addAll(roots, files);
         }
       }
     }
@@ -156,4 +157,4 @@ public class LibraryUtil {
     }
     return null;
   }
-}
\ No newline at end of file
+}
index 79436963175e1037efe6794aa2aef27350a4cc56..dc86c0ce2677d7f75db2f391b7281495b189295f 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -60,7 +61,7 @@ public class LocalSearchScope extends SearchScope {
     for (final PsiElement element : scope) {
       LOG.assertTrue(element.getContainingFile() != null);
       if (element instanceof PsiFile) {
-        localScope.addAll(Arrays.asList(((PsiFile)element).getPsiRoots()));
+        ContainerUtil.addAll(localScope, ((PsiFile)element).getPsiRoots());
       }
       else {
         localScope.add(element);
index 1a839157ef20b8f0af2deaaffbe395e7ac062c24..fa6182e6679f9768e9beb55d786a86bd26ddf7b6 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.psi.search.PsiElementProcessor;
 import com.intellij.psi.stubs.StubBase;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -608,7 +609,7 @@ public class PsiTreeUtil {
     }
 
     ArrayList<PsiElement> filteredElements = new ArrayList<PsiElement>();
-    filteredElements.addAll(Arrays.asList(elements));
+    ContainerUtil.addAll(filteredElements, elements);
 
     int previousSize;
     do {
@@ -626,7 +627,8 @@ public class PsiTreeUtil {
           }
         }
       }
-    } while (filteredElements.size() != previousSize);
+    }
+    while (filteredElements.size() != previousSize);
 
     if (LOG.isDebugEnabled()) {
       for (PsiElement element : filteredElements) {
index 6e9dd404fb05e806199790eb88c048469b537a62..056f2b9509638f40d42949b91041efbaa78d1181 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.codeInsight.hint.HintManager;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -178,7 +179,7 @@ public class CommonRefactoringUtil {
 
     final ReadonlyStatusHandler.OperationStatus status = ReadonlyStatusHandler.getInstance(project)
       .ensureFilesWritable(VfsUtil.toVirtualFileArray(readonly));
-    failed.addAll(Arrays.asList(status.getReadonlyFiles()));
+    ContainerUtil.addAll(failed, status.getReadonlyFiles());
     if (notifyOnFail && (!failed.isEmpty() || seenNonWritablePsiFilesWithoutVirtualFile && readonly.isEmpty())) {
       StringBuilder message = new StringBuilder(messagePrefix);
       message.append('\n');
index d4c77c9d89d77e0f6fdaeea3951ee76c279f0f25..bd2dc717e7e6e6399be4f232af3511da3fc1b44b 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
 import com.intellij.psi.impl.source.codeStyle.CodeStyleSchemeImpl;
 import com.intellij.psi.impl.source.codeStyle.CodeStyleSchemesImpl;
 import com.intellij.util.EventDispatcher;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.*;
 
@@ -99,7 +100,7 @@ public class CodeStyleSchemesModel {
     CodeStyleScheme[] allSchemes = CodeStyleSchemes.getInstance().getSchemes();
     mySettingsToClone.clear();
     mySchemes.clear();
-    mySchemes.addAll(Arrays.asList(allSchemes));
+    ContainerUtil.addAll(mySchemes, allSchemes);
     myGlobalSelected = CodeStyleSchemes.getInstance().getCurrentScheme();
 
     CodeStyleSettings perProjectSettings = getProjectSettings().PER_PROJECT_SETTINGS;
index 01513ecbabcea79c5adb1185299402295bc885a4..fc8e266060f692b12154eba2eaf91fd57eb4ae2d 100644 (file)
@@ -121,8 +121,8 @@ public class CompletionData {
     });
   }
 
-  public void addKeywordVariants(Set<CompletionVariant> set, PsiElement position, final PsiFile file){
-    set.addAll(Arrays.asList(findVariants(position, file)));
+  public void addKeywordVariants(Set<CompletionVariant> set, PsiElement position, final PsiFile file) {
+    ContainerUtil.addAll(set, findVariants(position, file));
   }
 
   public void completeKeywordsBySet(final Set<LookupElement> set, Set<CompletionVariant> variants, final PsiElement position,
index 62d4b1760b1ea079cdb2b00369ef19a20752ebea..b2135c4244c8671c0e07f22457fb29ca1b0aa0fd 100644 (file)
@@ -45,6 +45,7 @@ import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.impl.source.SourceTreeToPsiMap;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.xml.util.XmlStringUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -435,7 +436,7 @@ public class HighlightInfo {
         if (localInspectionTool instanceof CustomSuppressableInspectionTool) {
           final IntentionAction[] suppressActions = ((CustomSuppressableInspectionTool)localInspectionTool).getSuppressActions(element);
           if (suppressActions != null) {
-            newOptions.addAll(Arrays.asList(suppressActions));
+            ContainerUtil.addAll(newOptions, suppressActions);
           }
         }
       }
index 821337b7d68c3eb4ecaceda42d0a145949842614..2d4a3ba141f491d8003d8995135ae14b91ac691a 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.Key;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NonNls;
@@ -348,7 +349,7 @@ public class LookupItem<T> extends MutableLookupElement<T> implements Comparable
   }
 
   public LookupItem<T> addLookupStrings(@NonNls final String... additionalLookupStrings) {
-    myAllLookupStrings.addAll(Arrays.asList(additionalLookupStrings));
+    ContainerUtil.addAll(myAllLookupStrings, additionalLookupStrings);
     return this;
   }
 
index 6b6b196e1f5bdddfdd77cfb6ea6e7794d39c877c..cf8e0a83710fe5897baa17a69d916df3fb6c9d3a 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.help.HelpManager;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.ui.IdeBorderFactory;
 import com.intellij.ui.ScrollPaneFactory;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.Table;
 
 import javax.swing.*;
@@ -228,8 +229,8 @@ class EditVariableDialog extends DialogWrapper {
 
     if (additionalMacros!=null) {
       ArrayList<Macro> list = new ArrayList<Macro>(macros.length + additionalMacros.size());
-      list.addAll( Arrays.asList(macros) );
-      list.addAll( additionalMacros );
+      ContainerUtil.addAll(list, macros);
+      list.addAll(additionalMacros);
       macros = list.toArray(new Macro[0]);
     }
 
index a6f434de965cc27fee413600987958ace3219b43..5c345cccc60182ef33fae85cb0eb18906b7360ff 100644 (file)
@@ -31,6 +31,7 @@ import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vcs.FileStatus;
 import com.intellij.psi.PsiElement;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.containers.HashSet;
 import gnu.trove.THashMap;
@@ -137,7 +138,7 @@ public abstract class DescriptorProviderInspection extends InspectionTool implem
         localQuickFixes = new HashSet<QuickFix>();
         getQuickFixActions().put(refEntity, localQuickFixes);
       }
-      localQuickFixes.addAll(Arrays.asList(fixes));
+      ContainerUtil.addAll(localQuickFixes, fixes);
     }
   }
 
@@ -454,7 +455,7 @@ public abstract class DescriptorProviderInspection extends InspectionTool implem
         final Set<CommonProblemDescriptor> allAvailable = new HashSet<CommonProblemDescriptor>();
         for (CommonProblemDescriptor[] descriptors : myOldProblemElements.values()) {
           if (descriptors != null) {
-            allAvailable.addAll(Arrays.asList(descriptors));
+            ContainerUtil.addAll(allAvailable, descriptors);
           }
         }
         final boolean old = contains(descriptor, allAvailable);
index bf513ae44682c9b2a0cf815596ad9cb6823bcaf7..6ff301d55d0bc28b2f6671843e7df55127ef13fa 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.util.Factory;
 import com.intellij.profile.codeInspection.ui.InspectionToolsConfigurable;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -62,8 +63,8 @@ public class InspectionToolRegistrar {
   public void ensureInitialized() {
     if (!myInspectionComponentsLoaded.getAndSet(true)) {
       Set<InspectionToolProvider> providers = new THashSet<InspectionToolProvider>();
-      providers.addAll(Arrays.asList(ApplicationManager.getApplication().getComponents(InspectionToolProvider.class)));
-      providers.addAll(Arrays.asList(Extensions.getExtensions(InspectionToolProvider.EXTENSION_POINT_NAME)));
+      ContainerUtil.addAll(providers, ApplicationManager.getApplication().getComponents(InspectionToolProvider.class));
+      ContainerUtil.addAll(providers, Extensions.getExtensions(InspectionToolProvider.EXTENSION_POINT_NAME));
       registerTools(providers.toArray(new InspectionToolProvider[providers.size()]));
       for (InspectionToolsFactory factory : Extensions.getExtensions(InspectionToolsFactory.EXTENSION_POINT_NAME)) {
         for (final InspectionProfileEntry profileEntry : factory.createTools()) {
@@ -71,7 +72,8 @@ public class InspectionToolRegistrar {
             public InspectionTool create() {
               if (profileEntry instanceof LocalInspectionTool) {
                 return new LocalInspectionToolWrapper((LocalInspectionTool)profileEntry);
-              } else if (profileEntry instanceof GlobalInspectionTool) {
+              }
+              else if (profileEntry instanceof GlobalInspectionTool) {
                 return new GlobalInspectionToolWrapper((GlobalInspectionTool)profileEntry);
               }
               return (InspectionTool)profileEntry;
index 21fffcea23c6b9059208df141660844621faae4a..87c0cdf61fe06b37e1e0b728fced8d3db756c4fc 100644 (file)
@@ -34,6 +34,7 @@ import com.intellij.codeInspection.ui.*;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 import com.intellij.util.ui.tree.TreeUtil;
 import org.jetbrains.annotations.Nullable;
@@ -78,7 +79,7 @@ public class OfflineInspectionRVContentProvider extends InspectionRVContentProvi
             if (descriptor != null) {
               final QuickFix[] fixes = descriptor.getFixes();
               if (fixes != null) {
-                quickFixes.addAll(Arrays.asList(fixes));
+                ContainerUtil.addAll(quickFixes, fixes);
               }
             }
           }
index 9b3c4fa34f377d5285d32edb582515555b8fe8e0..c25ffbe95ebaa33e84df2cae85a2e856291865ce 100644 (file)
@@ -49,6 +49,7 @@ import com.intellij.openapi.wm.ex.ToolWindowManagerEx;
 import com.intellij.ui.content.*;
 import com.intellij.util.EventDispatcher;
 import com.intellij.util.concurrency.Semaphore;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -93,7 +94,7 @@ public class RunContentManagerImpl implements RunContentManager, Disposable {
             Set<String> currentWindows = new HashSet<String>();
             String[] toolWindowIds = toolWindowManager.getToolWindowIds();
 
-            currentWindows.addAll(Arrays.asList(toolWindowIds));
+            ContainerUtil.addAll(currentWindows, toolWindowIds);
             myToolwindowIdZbuffer.retainAll(currentWindows);
 
             final String activeToolWindowId = toolWindowManager.getActiveToolWindowId();
index 1a387f0ea8783b8e4f7f57d0b725bae83df92e10..93bc1668187401e05847c202ec74fa45023df1c7 100644 (file)
@@ -41,6 +41,7 @@ import com.intellij.ui.tabs.TabInfo;
 import com.intellij.ui.tabs.TabsListener;
 import com.intellij.ui.tabs.UiDecorator;
 import com.intellij.ui.tabs.impl.JBTabsImpl;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.AbstractLayoutManager;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -1137,7 +1138,7 @@ public class RunnerContentUi implements ContentUI, Disposable, CellTransform.Fac
     ArrayList<AnAction> result = new ArrayList<AnAction>();
     if (myLeftToolbarActions != null) {
       AnAction[] kids = myLeftToolbarActions.getChildren(null);
-      result.addAll(Arrays.asList(kids));
+      ContainerUtil.addAll(result, kids);
     }
     return result;
   }
index 5a23064d76225959a5545ab38491e7fdffa646cf..174a53bdfda56922526e60bd6a97ffdb3bb3c65e 100644 (file)
@@ -54,6 +54,7 @@ import com.intellij.ui.NonFocusableCheckBox;
 import com.intellij.ui.components.JBList;
 import com.intellij.ui.components.panels.NonOpaquePanel;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.Nullable;
 
@@ -576,8 +577,10 @@ public class EditorSearchComponent extends JPanel implements DataProvider {
       copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_PREVIOUS_OCCURENCE));
 
       ArrayList<Shortcut> shortcuts = new ArrayList<Shortcut>();
-      shortcuts.addAll(Arrays.asList(ActionManager.getInstance().getAction(IdeActions.ACTION_FIND_PREVIOUS).getShortcutSet().getShortcuts()));
-      shortcuts.addAll(Arrays.asList(ActionManager.getInstance().getAction(IdeActions.ACTION_EDITOR_MOVE_CARET_UP).getShortcutSet().getShortcuts()));
+      ContainerUtil
+        .addAll(shortcuts, ActionManager.getInstance().getAction(IdeActions.ACTION_FIND_PREVIOUS).getShortcutSet().getShortcuts());
+      ContainerUtil
+        .addAll(shortcuts, ActionManager.getInstance().getAction(IdeActions.ACTION_EDITOR_MOVE_CARET_UP).getShortcutSet().getShortcuts());
       shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_DOWN_MASK), null));
 
       registerCustomShortcutSet(
@@ -602,8 +605,9 @@ public class EditorSearchComponent extends JPanel implements DataProvider {
     public NextOccurenceAction() {
       copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_NEXT_OCCURENCE));
       ArrayList<Shortcut> shortcuts = new ArrayList<Shortcut>();
-      shortcuts.addAll(Arrays.asList(ActionManager.getInstance().getAction(IdeActions.ACTION_FIND_NEXT).getShortcutSet().getShortcuts()));
-      shortcuts.addAll(Arrays.asList(ActionManager.getInstance().getAction(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN).getShortcutSet().getShortcuts()));
+      ContainerUtil.addAll(shortcuts, ActionManager.getInstance().getAction(IdeActions.ACTION_FIND_NEXT).getShortcutSet().getShortcuts());
+      ContainerUtil
+        .addAll(shortcuts, ActionManager.getInstance().getAction(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN).getShortcutSet().getShortcuts());
       shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), null));
 
       registerCustomShortcutSet(
@@ -627,9 +631,9 @@ public class EditorSearchComponent extends JPanel implements DataProvider {
       getTemplatePresentation().setText("Search History");
 
       ArrayList<Shortcut> shortcuts = new ArrayList<Shortcut>();
-      shortcuts.addAll(Arrays.asList(ActionManager.getInstance().getAction(IdeActions.ACTION_FIND).getShortcutSet().getShortcuts()));
+      ContainerUtil.addAll(shortcuts, ActionManager.getInstance().getAction(IdeActions.ACTION_FIND).getShortcutSet().getShortcuts());
       shortcuts.add(new KeyboardShortcut(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_DOWN_MASK), null));
-      shortcuts.addAll(Arrays.asList(ActionManager.getInstance().getAction("IncrementalSearch").getShortcutSet().getShortcuts()));
+      ContainerUtil.addAll(shortcuts, ActionManager.getInstance().getAction("IncrementalSearch").getShortcutSet().getShortcuts());
 
       registerCustomShortcutSet(
         new CustomShortcutSet(shortcuts.toArray(new Shortcut[shortcuts.size()])),
index 21108288998c3a1e168581ff87aae0386498fd80..ad6002473a98244995053e6c5b500ab7b3dcca7b 100644 (file)
@@ -70,6 +70,7 @@ import com.intellij.util.CommonProcessors;
 import com.intellij.util.Function;
 import com.intellij.util.PatternUtil;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.indexing.FileBasedIndex;
 import gnu.trove.THashSet;
 import gnu.trove.TIntHashSet;
@@ -562,7 +563,7 @@ public class FindInProjectUtil {
     // in case our word splitting is incorrect
     PsiFile[] allWordsFiles =
       cacheManager.getFilesWithWord(findModel.getStringToFind(), UsageSearchContext.ANY, scope, findModel.isCaseSensitive());
-    resultFiles.addAll(Arrays.asList(allWordsFiles));
+    ContainerUtil.addAll(resultFiles, allWordsFiles);
 
     filterMaskedFiles(resultFiles, fileMaskRegExp);
 
index 8670d90ba00fb9d77d1dbd6a4acead0ee968c433..cc77cad1656dbe1c8b958958de2e888470c221a2 100644 (file)
@@ -37,6 +37,7 @@ import com.intellij.openapi.ui.popup.JBPopupListener;
 import com.intellij.openapi.ui.popup.LightweightWindowEvent;
 import com.intellij.openapi.util.IconLoader;
 import com.intellij.psi.PsiFile;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
@@ -195,7 +196,7 @@ public class GotoFileAction extends GotoActionBase implements DumbAware {
      */
     private ElementsChooser<FileType> createFileTypeChooser(final GotoFileModel gotoFileModel) {
       List<FileType> elements = new ArrayList<FileType>();
-      elements.addAll(Arrays.asList(FileTypeManager.getInstance().getRegisteredFileTypes()));
+      ContainerUtil.addAll(elements, FileTypeManager.getInstance().getRegisteredFileTypes());
       Collections.sort(elements, FileTypeComparator.INSTANCE);
       final ElementsChooser<FileType> chooser = new ElementsChooser<FileType>(elements, true) {
         @Override
@@ -304,4 +305,4 @@ public class GotoFileAction extends GotoActionBase implements DumbAware {
       }
     }
   }
-}
\ No newline at end of file
+}
index 9d01929f3a179e254b9a899930d11e55dcb0b315..3bf724a442ed3573d537d728b6b02399ef487773 100644 (file)
@@ -187,8 +187,8 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable {
     List<FileTemplateTab> allTabs = new ArrayList<FileTemplateTab>(Arrays.asList(myTemplatesList, myIncludesList, myCodeTemplatesList));
 
     final Set<FileTemplateGroupDescriptorFactory> factories = new THashSet<FileTemplateGroupDescriptorFactory>();
-    factories.addAll(Arrays.asList(ApplicationManager.getApplication().getComponents(FileTemplateGroupDescriptorFactory.class)));
-    factories.addAll(Arrays.asList(Extensions.getExtensions(FileTemplateGroupDescriptorFactory.EXTENSION_POINT_NAME)));
+    ContainerUtil.addAll(factories, ApplicationManager.getApplication().getComponents(FileTemplateGroupDescriptorFactory.class));
+    ContainerUtil.addAll(factories, Extensions.getExtensions(FileTemplateGroupDescriptorFactory.EXTENSION_POINT_NAME));
 
     if (!factories.isEmpty()) {
       myJ2eeTemplatesList = new FileTemplateTabAsTree(J2EE_TITLE) {
@@ -197,11 +197,12 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable {
         }
 
         protected FileTemplateNode initModel() {
-          SortedSet<FileTemplateGroupDescriptor> categories = new TreeSet<FileTemplateGroupDescriptor>(new Comparator<FileTemplateGroupDescriptor>() {
-            public int compare(FileTemplateGroupDescriptor o1, FileTemplateGroupDescriptor o2) {
-              return o1.getTitle().compareTo(o2.getTitle());
-            }
-          });
+          SortedSet<FileTemplateGroupDescriptor> categories =
+            new TreeSet<FileTemplateGroupDescriptor>(new Comparator<FileTemplateGroupDescriptor>() {
+              public int compare(FileTemplateGroupDescriptor o1, FileTemplateGroupDescriptor o2) {
+                return o1.getTitle().compareTo(o2.getTitle());
+              }
+            });
 
 
           for (FileTemplateGroupDescriptorFactory templateGroupFactory : factories) {
@@ -209,11 +210,12 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable {
           }
 
           //noinspection HardCodedStringLiteral
-          return new FileTemplateNode("ROOT", null, ContainerUtil.map2List(categories, new Function<FileTemplateGroupDescriptor, FileTemplateNode>() {
-            public FileTemplateNode fun(FileTemplateGroupDescriptor s) {
-              return new FileTemplateNode(s);
-            }
-          }));
+          return new FileTemplateNode("ROOT", null,
+                                      ContainerUtil.map2List(categories, new Function<FileTemplateGroupDescriptor, FileTemplateNode>() {
+                                        public FileTemplateNode fun(FileTemplateGroupDescriptor s) {
+                                          return new FileTemplateNode(s);
+                                        }
+                                      }));
         }
       };
       allTabs.add(myJ2eeTemplatesList);
@@ -561,27 +563,27 @@ public class AllFileTemplatesConfigurable implements SearchableConfigurable {
     // Apply templates
     ArrayList<FileTemplate> newModifiedItems = new ArrayList<FileTemplate>();
     FileTemplate[] templates = myTemplatesList.getTemplates();
-    newModifiedItems.addAll(Arrays.asList(templates));
+    ContainerUtil.addAll(newModifiedItems, templates);
     FileTemplateManager templatesManager = FileTemplateManager.getInstance();
     apply(newModifiedItems, myTemplatesList.savedTemplates, TEMPLATE_ID, templatesManager.getAllTemplates());
 
     // Apply patterns
     newModifiedItems = new ArrayList<FileTemplate>();
     templates = myIncludesList.getTemplates();
-    newModifiedItems.addAll(Arrays.asList(templates));
+    ContainerUtil.addAll(newModifiedItems, templates);
     apply(newModifiedItems, myIncludesList.savedTemplates, PATTERN_ID, templatesManager.getAllPatterns());
 
     //Apply code templates
     newModifiedItems = new ArrayList<FileTemplate>();
     templates = myCodeTemplatesList.getTemplates();
-    newModifiedItems.addAll(Arrays.asList(templates));
+    ContainerUtil.addAll(newModifiedItems, templates);
     apply(newModifiedItems, myCodeTemplatesList.savedTemplates, CODE_ID, templatesManager.getAllCodeTemplates());
 
     //Apply J2EE templates
     if (myJ2eeTemplatesList != null) {
       newModifiedItems = new ArrayList<FileTemplate>();
       templates = myJ2eeTemplatesList.getTemplates();
-      newModifiedItems.addAll(Arrays.asList(templates));
+      ContainerUtil.addAll(newModifiedItems, templates);
       apply(newModifiedItems, myJ2eeTemplatesList.savedTemplates, J2EE_ID, templatesManager.getAllJ2eeTemplates());
     }
 
index f124f54e4491374910474adf0bb1b17c1d0f3cdc..4840cfa0d704121a6da5fc43532e9a2b98634e05 100644 (file)
@@ -34,6 +34,7 @@ import com.intellij.usages.UsageTarget;
 import com.intellij.usages.UsageView;
 import com.intellij.usages.rules.UsageInFile;
 import com.intellij.usages.rules.UsageInFiles;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -105,7 +106,7 @@ public class VirtualFileArrayRule implements GetDataRule {
 
         if (usage instanceof UsageInFiles) {
           UsageInFiles usageInFiles = (UsageInFiles)usage;
-          result.addAll(Arrays.asList(usageInFiles.getFiles()));
+          ContainerUtil.addAll(result, usageInFiles.getFiles());
         }
       }
     }
@@ -115,7 +116,7 @@ public class VirtualFileArrayRule implements GetDataRule {
         if (!usageTarget.isValid()) continue;
         VirtualFile[] files = usageTarget.getFiles();
         if (files != null) {
-          result.addAll(Arrays.asList(files));
+          ContainerUtil.addAll(result, files);
         }
       }
     }
@@ -173,7 +174,7 @@ public class VirtualFileArrayRule implements GetDataRule {
   private static Object getFilesFromModules(Module[] selectedModules) {
     ArrayList<VirtualFile> result = new ArrayList<VirtualFile>();
     for (Module selectedModule : selectedModules) {
-      result.addAll(Arrays.asList(ModuleRootManager.getInstance(selectedModule).getContentRoots()));
+      ContainerUtil.addAll(result, ModuleRootManager.getInstance(selectedModule).getContentRoots());
     }
     return VfsUtil.toVirtualFileArray(result);
   }
index 1fd6bb33313133eb2a8cc745e0d1b2ccfe8607de..cdcefe560cfe90a20c9f13610ee66c0de100cae4 100644 (file)
@@ -46,6 +46,7 @@ import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.util.PsiUtilBase;
 import com.intellij.ui.SimpleTextAttributes;
 import com.intellij.util.PathUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -371,13 +372,13 @@ public class NavBarModel {
     if (!(object instanceof Project) && rootElement instanceof Module && ((Module)rootElement).isDisposed()) return result;
     final PsiManager psiManager = PsiManager.getInstance(myProject);
     if (object instanceof Project) {
-      result.addAll(Arrays.asList(ApplicationManager.getApplication().runReadAction(
-          new Computable<Module[]>() {
-            public Module[] compute() {
-              return ModuleManager.getInstance((Project)object).getModules();
-            }
+      ContainerUtil.addAll(result, ApplicationManager.getApplication().runReadAction(
+        new Computable<Module[]>() {
+          public Module[] compute() {
+            return ModuleManager.getInstance((Project)object).getModules();
           }
-      )));
+        }
+      ));
     }
     else if (object instanceof Module) {
       Module module = (Module)object;
index a3c20ee4ec22679ee07564a1940e5ffc9a5e4e33..cbcf79a9f302882ad550b265c6b0f82eac3559ea 100644 (file)
@@ -41,6 +41,7 @@ import com.intellij.psi.search.scope.packageSet.PackageSet;
 import com.intellij.ui.PopupHandler;
 import com.intellij.util.Alarm;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
@@ -151,8 +152,8 @@ public class ScopeViewPane extends AbstractProjectViewPane {
     if (!(element instanceof PsiElement)) return;
 
     List<NamedScope> allScopes = new ArrayList<NamedScope>();
-    allScopes.addAll(Arrays.asList(myDependencyValidationManager.getScopes()));
-    allScopes.addAll(Arrays.asList(myNamedScopeManager.getScopes()));
+    ContainerUtil.addAll(allScopes, myDependencyValidationManager.getScopes());
+    ContainerUtil.addAll(allScopes, myNamedScopeManager.getScopes());
     for (int i = 0; i < allScopes.size(); i++) {
       final NamedScope scope = allScopes.get(i);
       String name = scope.getName();
index 87f4845486c9cf4e7c9a14dc8cb35464300ebebb..7a8c4dbe7284f0a9b89b43e95bae5b13efc6d087 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.openapi.util.Iconable;
 import com.intellij.pom.Navigatable;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -102,7 +103,7 @@ public abstract class PsiTreeElementBase <T extends PsiElement> implements Struc
     for (StructureViewExtension extension : structureViewFactory.getAllExtensions(aClass)) {
       StructureViewTreeElement[] children = extension.getChildren(element);
       if (children != null) {
-        result.addAll(Arrays.asList(children));
+        ContainerUtil.addAll(result, children);
       }
     }
     return result.toArray(new StructureViewTreeElement[result.size()]);
index 7807198aba1ff932c59ac6883cdc08aab510de51..63d9c8dc697b64bd6315991c9c464cb5138a04b3 100644 (file)
@@ -30,6 +30,7 @@ import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.PsiManager;
 import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
@@ -55,14 +56,14 @@ public class TodoTreeHelper {
     final PsiManager psiManager = PsiManager.getInstance(myProject);
     final List<VirtualFile> roots = new ArrayList<VirtualFile>();
     final List<VirtualFile> sourceRoots = new ArrayList<VirtualFile>();
-    if (module == null){
+    if (module == null) {
       final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(myProject);
-      roots.addAll(Arrays.asList(projectRootManager.getContentRoots()));
-      sourceRoots.addAll(Arrays.asList(projectRootManager.getContentSourceRoots()));
+      ContainerUtil.addAll(roots, projectRootManager.getContentRoots());
+      ContainerUtil.addAll(sourceRoots, projectRootManager.getContentSourceRoots());
     } else {
       ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module);
-      roots.addAll(Arrays.asList(moduleRootManager.getContentRoots()));
-      sourceRoots.addAll(Arrays.asList(moduleRootManager.getSourceRoots()));
+      ContainerUtil.addAll(roots, moduleRootManager.getContentRoots());
+      ContainerUtil.addAll(sourceRoots, moduleRootManager.getSourceRoots());
     }
     roots.removeAll(sourceRoots);
     for (VirtualFile dir : roots) {
index 403116e9aea5394bf6bd7a50bad8c671ff3ac349..f976b779ff7d13d8953647e2529389c280195d03 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.DumbService;
 import com.intellij.openapi.project.DumbAware;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 
 import javax.swing.*;
 import java.util.*;
@@ -51,7 +52,7 @@ public abstract class ContributorsBasedGotoByModel implements ChooseByNameModel
     Set<String> names = new HashSet<String>();
     for (ChooseByNameContributor contributor : myContributors) {
       try {
-        names.addAll(Arrays.asList(contributor.getNames(myProject, checkBoxState)));
+        ContainerUtil.addAll(names, contributor.getNames(myProject, checkBoxState));
       }
       catch(ProcessCanceledException ex) {
         // index corruption detected, ignore
@@ -127,4 +128,4 @@ public abstract class ContributorsBasedGotoByModel implements ChooseByNameModel
   protected boolean acceptItem(NavigationItem item) {
     return true;
   }
-}
\ No newline at end of file
+}
index 258f50da60a376a451b8aff23700d2541a3cb900..227d5e4fff76ef42feec704cf3ca2642a1cbee5f 100644 (file)
@@ -24,6 +24,7 @@ import com.intellij.openapi.roots.ProjectFileIndex;
 import com.intellij.openapi.roots.ProjectRootManager;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Arrays;
@@ -41,7 +42,7 @@ public class JdkScope extends GlobalSearchScope {
     super(project);
     myIndex = ProjectRootManager.getInstance(project).getFileIndex();
     myJdkName = jdk.getJdkName();
-    myEntries.addAll(Arrays.asList(jdk.getFiles(OrderRootType.CLASSES)));
+    ContainerUtil.addAll(myEntries, jdk.getFiles(OrderRootType.CLASSES));
   }
 
   public int hashCode() {
index 7c47c75feda8dfe6d786b1521bb9ba57d3a80271..9cb591bb1ef8e746043944ea1411475685492693 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.openapi.roots.*;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -63,19 +64,19 @@ public class LibraryRuntimeClasspathScope extends GlobalSearchScope {
     ModuleRootManager.getInstance(module).orderEntries().recursively().process(new RootPolicy<LinkedHashSet<VirtualFile>>() {
       public LinkedHashSet<VirtualFile> visitLibraryOrderEntry(final LibraryOrderEntry libraryOrderEntry,
                                                                final LinkedHashSet<VirtualFile> value) {
-        value.addAll(Arrays.asList(libraryOrderEntry.getFiles(OrderRootType.CLASSES)));
+        ContainerUtil.addAll(value, libraryOrderEntry.getFiles(OrderRootType.CLASSES));
         return value;
       }
 
       public LinkedHashSet<VirtualFile> visitModuleSourceOrderEntry(final ModuleSourceOrderEntry moduleSourceOrderEntry,
                                                                     final LinkedHashSet<VirtualFile> value) {
-        value.addAll(Arrays.asList(moduleSourceOrderEntry.getFiles(OrderRootType.SOURCES)));
+        ContainerUtil.addAll(value, moduleSourceOrderEntry.getFiles(OrderRootType.SOURCES));
         return value;
       }
 
       public LinkedHashSet<VirtualFile> visitJdkOrderEntry(final JdkOrderEntry jdkOrderEntry, final LinkedHashSet<VirtualFile> value) {
         if (!myJDKProcessed.add(jdkOrderEntry.getJdk())) return value;
-        value.addAll(Arrays.asList(jdkOrderEntry.getFiles(OrderRootType.CLASSES)));
+        ContainerUtil.addAll(value, jdkOrderEntry.getFiles(OrderRootType.CLASSES));
         return value;
       }
     }, myEntries);
index a2b4f83744782f68783ada1a678fdbe79fdaaadf..e70e7e166cf7c50f40ab46f2dd023e0af1aa793d 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.openapi.roots.*;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiBundle;
 import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.Arrays;
@@ -60,20 +61,20 @@ public class ModuleRuntimeClasspathScope extends GlobalSearchScope {
 
       public LinkedHashSet<VirtualFile> visitModuleSourceOrderEntry(final ModuleSourceOrderEntry moduleSourceOrderEntry,
                                                                     final LinkedHashSet<VirtualFile> value) {
-        value.addAll(Arrays.asList(moduleSourceOrderEntry.getFiles(OrderRootType.SOURCES)));
+        ContainerUtil.addAll(value, moduleSourceOrderEntry.getFiles(OrderRootType.SOURCES));
         return value;
       }
 
       public LinkedHashSet<VirtualFile> visitLibraryOrderEntry(final LibraryOrderEntry libraryOrderEntry,
                                                                final LinkedHashSet<VirtualFile> value) {
-        value.addAll(Arrays.asList(libraryOrderEntry.getFiles(OrderRootType.CLASSES)));
+        ContainerUtil.addAll(value, libraryOrderEntry.getFiles(OrderRootType.CLASSES));
         return value;
       }
 
       public LinkedHashSet<VirtualFile> visitJdkOrderEntry(final JdkOrderEntry jdkOrderEntry, final LinkedHashSet<VirtualFile> value) {
         if (myJDKProcessed) return value;
         myJDKProcessed = true;
-        value.addAll(Arrays.asList(jdkOrderEntry.getFiles(OrderRootType.CLASSES)));
+        ContainerUtil.addAll(value, jdkOrderEntry.getFiles(OrderRootType.CLASSES));
         return value;
       }
     }, myEntries);
index 788dd7ff3cd66d808f0352c821eed369741a0c2c..6ab0be7833eaf56bf1d03b36705a998e905df112 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.roots.*;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiBundle;
 import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 
@@ -58,7 +59,7 @@ public class ModuleWithDependenciesScope extends GlobalSearchScope {
       myModules = new LinkedHashSet<Module>();
       myModules.add(myModule);
       Module[] dependencies = ModuleRootManager.getInstance(myModule).getDependencies(myIncludeTests);
-      myModules.addAll(Arrays.asList(dependencies));
+      ContainerUtil.addAll(myModules, dependencies);
       for (Module dependency : dependencies) {
         addExportedModules(dependency);
       }
index 46b156bc6888590752650a181d583fdae53ffdd6..e2d040f4147338d151eeb8856914bf5b1a434326 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferen
 import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceOwner;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -211,7 +212,7 @@ public class PsiDynaReference<T extends PsiElement> extends PsiReferenceBase<T>
     final ArrayList<LocalQuickFix> list = new ArrayList<LocalQuickFix>();
     for (Object ref: myReferences) {
       if (ref instanceof LocalQuickFixProvider) {
-        list.addAll(Arrays.asList(((LocalQuickFixProvider)ref).getQuickFixes()));
+        ContainerUtil.addAll(list, ((LocalQuickFixProvider)ref).getQuickFixes());
       }
     }
     return list.toArray(new LocalQuickFix[list.size()]);
index 65ebc7db7e56262c238e5d0c75a591b38d63d30c..8ce9223922d5bf0024312ba7140c3763dc3db5d8 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.util.WriteExternalException;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jdom.Element;
 import org.jetbrains.annotations.NotNull;
 
@@ -48,7 +49,7 @@ class CompositeProjectRoot implements ProjectRoot {
   public VirtualFile[] getVirtualFiles() {
     List<VirtualFile> result = new ArrayList<VirtualFile>();
     for (ProjectRoot root : myRoots) {
-      result.addAll(Arrays.asList(root.getVirtualFiles()));
+      ContainerUtil.addAll(result, root.getVirtualFiles());
     }
 
     return VfsUtil.toVirtualFileArray(result);
@@ -57,7 +58,7 @@ class CompositeProjectRoot implements ProjectRoot {
   public String[] getUrls() {
     final List<String> result = new ArrayList<String>();
     for (ProjectRoot root : myRoots) {
-      result.addAll(Arrays.asList(root.getUrls()));
+      ContainerUtil.addAll(result, root.getUrls());
     }
     return ArrayUtil.toStringArray(result);
   }
index b58d7672ca56e007e81e25d75df4d80e1b5a9c42..39b859acae1c4a8e450c39c3450d18734e4fe8d7 100644 (file)
@@ -31,6 +31,7 @@ import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.vfs.VirtualFileManager;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jdom.Element;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -241,7 +242,7 @@ public class ProjectJdkImpl extends UserDataHolderBase implements JDOMExternaliz
       final ProjectRoot[] rootFiles = myRootContainer.getRoots(rootType);
       final ArrayList<String> result = new ArrayList<String>();
       for (ProjectRoot rootFile : rootFiles) {
-        result.addAll(Arrays.asList(rootFile.getUrls()));
+        ContainerUtil.addAll(result, rootFile.getUrls());
       }
       return ArrayUtil.toStringArray(result);
     }
@@ -318,7 +319,7 @@ public class ProjectJdkImpl extends UserDataHolderBase implements JDOMExternaliz
     final ProjectRoot[] roots = myRootContainer.getRoots(rootType); // use getRoots() cause the data is most up-to-date there
     final List<VirtualFile> files = new ArrayList<VirtualFile>(roots.length);
     for (ProjectRoot root : roots) {
-      files.addAll(Arrays.asList(root.getVirtualFiles()));
+      ContainerUtil.addAll(files, root.getVirtualFiles());
     }
     return VfsUtil.toVirtualFileArray(files);
   }
index 109f1fbcf3412e233dc1e21e2c86da8269d4f254..39d89a5f576e027f01a0d236a3ec49bde6859961 100644 (file)
@@ -56,6 +56,7 @@ import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.util.EventDispatcher;
 import com.intellij.util.containers.ConcurrentHashMap;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.containers.HashSet;
 import com.intellij.util.messages.MessageBusConnection;
@@ -280,7 +281,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Proj
     final Module[] modules = getModuleManager().getModules();
     for (Module module : modules) {
       final VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots();
-      result.addAll(Arrays.asList(contentRoots));
+      ContainerUtil.addAll(result, contentRoots);
     }
     return VfsUtil.toVirtualFileArray(result);
   }
@@ -290,7 +291,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Proj
     final Module[] modules = getModuleManager().getModules();
     for (Module module : modules) {
       final VirtualFile[] sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots();
-      result.addAll(Arrays.asList(sourceRoots));
+      ContainerUtil.addAll(result, sourceRoots);
     }
     return VfsUtil.toVirtualFileArray(result);
   }
@@ -300,7 +301,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Proj
     final Module[] modules = getModuleManager().getSortedModules();
     for (Module module : modules) {
       final VirtualFile[] files = ModuleRootManager.getInstance(module).getFiles(type);
-      result.addAll(Arrays.asList(files));
+      ContainerUtil.addAll(result, files);
     }
     return VfsUtil.toVirtualFileArray(result);
   }
@@ -315,7 +316,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Proj
     final Module[] modules = getModuleManager().getSortedModules();
     for (Module module : modules) {
       final VirtualFile[] files = ModuleRootManager.getInstance(module).getContentRoots();
-      result.addAll(Arrays.asList(files));
+      ContainerUtil.addAll(result, files);
     }
     result.add(myProject.getBaseDir());
     return VfsUtil.toVirtualFileArray(result);
index 8fc6eb058f813604e299b2239385c0100c9ca504..7f7fe69047d7f1ac7d9768e0b5ad38366ce00682 100644 (file)
@@ -256,7 +256,7 @@ public class RootModelImpl implements ModifiableRootModel {
     final ArrayList<VirtualFile> result = new ArrayList<VirtualFile>();
 
     for (OrderEntry orderEntry : getOrderEntries()) {
-      result.addAll(Arrays.asList(orderEntry.getFiles(type)));
+      ContainerUtil.addAll(result, orderEntry.getFiles(type));
     }
     return ContainerUtil.toArray(result, new VirtualFile[result.size()]);
   }
@@ -266,7 +266,7 @@ public class RootModelImpl implements ModifiableRootModel {
     final ArrayList<String> result = new ArrayList<String>();
 
     for (OrderEntry orderEntry : getOrderEntries()) {
-      result.addAll(Arrays.asList(orderEntry.getUrls(type)));
+      ContainerUtil.addAll(result, orderEntry.getUrls(type));
     }
     return ContainerUtil.toArray(result, new String[result.size()]);
   }
@@ -434,7 +434,7 @@ public class RootModelImpl implements ModifiableRootModel {
     assertWritable();
     assertValidRearrangement(newEntries);
     myOrderEntries.clear();
-    myOrderEntries.addAll(Arrays.asList(newEntries));
+    ContainerUtil.addAll(myOrderEntries, newEntries);
   }
 
   private void assertValidRearrangement(OrderEntry[] newEntries) {
index 71db64c4e063994cf9d03dc34f2994efbec37114..382e73aa40c60e1ad594f7a45f3091af6e407834 100644 (file)
@@ -40,6 +40,7 @@ import com.intellij.openapi.vfs.VirtualFileAdapter;
 import com.intellij.openapi.vfs.VirtualFileEvent;
 import com.intellij.openapi.vfs.tracker.VirtualFileTracker;
 import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.io.fs.FileSystem;
 import com.intellij.util.io.fs.IFile;
 import com.intellij.util.messages.MessageBus;
@@ -264,7 +265,7 @@ public class ClasspathStorage implements StateStorage {
   public static List<ClasspathStorageProvider> getProviders() {
     final List<ClasspathStorageProvider> list = new ArrayList<ClasspathStorageProvider>();
     list.add(new DefaultStorageProvider());
-    list.addAll(Arrays.asList(Extensions.getExtensions(ClasspathStorageProvider.EXTENSION_POINT_NAME)));
+    ContainerUtil.addAll(list, Extensions.getExtensions(ClasspathStorageProvider.EXTENSION_POINT_NAME));
     return list;
   }
 
index cc35eab4fc07f81a65850be051dee4cbfad93fcc..49b7ee48d519bc53b982d8554b786867064dc374 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.psi.search.IndexPattern;
 import com.intellij.psi.search.IndexPatternProvider;
 import com.intellij.util.CommonProcessors;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.ArrayList;
@@ -57,7 +58,7 @@ public class CompositeCacheManager implements CacheManager{
   public CacheUpdater[] getCacheUpdaters() {
     List<CacheUpdater> updaters = new ArrayList<CacheUpdater>();
     for (CacheManager cacheManager : myManagers) {
-      updaters.addAll(Arrays.asList(cacheManager.getCacheUpdaters()));
+      ContainerUtil.addAll(updaters, cacheManager.getCacheUpdaters());
     }
     return updaters.toArray(new CacheUpdater[updaters.size()]);
   }
@@ -83,7 +84,7 @@ public class CompositeCacheManager implements CacheManager{
       PsiFile[] items = cacheManager.getFilesWithTodoItems();
       if (items.length != 0 && files == null) {
         files = new ArrayList<PsiFile>();
-        files.addAll(Arrays.asList(items));
+        ContainerUtil.addAll(files, items);
       }
     }
     return files == null ? PsiFile.EMPTY_ARRAY : files.toArray(new PsiFile[files.size()]);
index f8b5c7f8f6bcb36cf5364e68816d1865ec4a3edb..3927eab81cf14bbdc8839d58be2dfb000b8f13a0 100644 (file)
@@ -19,6 +19,7 @@ package com.intellij.psi.impl.source.resolve.reference.impl;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.psi.*;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 import org.jetbrains.annotations.NotNull;
 
@@ -133,7 +134,7 @@ public class PsiMultiReference implements PsiPolyVariantReference {
     Set<Object> variants = new HashSet<Object>();
     for(PsiReference ref: myReferences) {
       Object[] refVariants = ref.getVariants();
-      variants.addAll(Arrays.asList(refVariants));
+      ContainerUtil.addAll(variants, refVariants);
     }
     return variants.toArray();
   }
@@ -149,7 +150,7 @@ public class PsiMultiReference implements PsiPolyVariantReference {
     PsiElementResolveResult selfReference = null;
     for (PsiReference reference : refs) {
       if (reference instanceof PsiPolyVariantReference) {
-        result.addAll(Arrays.asList(((PsiPolyVariantReference)reference).multiResolve(incompleteCode)));
+        ContainerUtil.addAll(result, ((PsiPolyVariantReference)reference).multiResolve(incompleteCode));
       }
       else {
         final PsiElement resolved = reference.resolve();
index 0cb5e42d89ca4910ed89cbf09c8b24afd472ef35..19da85e8789423ed4d6b17a2d4248c3d5939f679 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.refactoring.util.MoveRenameUsageInfo;
 import com.intellij.usageView.UsageInfo;
 import com.intellij.usageView.UsageViewUtil;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.hash.HashMap;
 import com.intellij.util.containers.hash.HashSet;
 import org.jetbrains.annotations.NotNull;
@@ -60,7 +61,7 @@ public abstract class ChangeSignatureProcessorBase extends BaseRefactoringProces
 
     final ChangeSignatureUsageProcessor[] processors = ChangeSignatureUsageProcessor.EP_NAME.getExtensions();
     for (ChangeSignatureUsageProcessor processor : processors) {
-      infos.addAll(Arrays.asList(processor.findUsages(myChangeInfo)));
+      ContainerUtil.addAll(infos, processor.findUsages(myChangeInfo));
     }
     infos = filterUsages(infos);
     return infos.toArray(new UsageInfo[infos.size()]);
index 655afe2866c6c47e489f208552a1d8a0262046f0..f1c73f546ebdfede541863d81ab6823128708cec 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.psi.PsiNamedElement;
 import com.intellij.refactoring.rename.RenameUtil;
 import com.intellij.refactoring.rename.UnresolvableCollisionUsageInfo;
 import com.intellij.usageView.UsageInfo;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 
 import java.util.*;
@@ -65,7 +66,7 @@ public abstract class AutomaticRenamer {
       for (final UsageInfo usage : usages) {
         if (usage instanceof UnresolvableCollisionUsageInfo) return false;
       }
-      result.addAll(Arrays.asList(usages));
+      ContainerUtil.addAll(result, usages);
     }
     return true;
   }
index a25d7116fae3aae18cbb682acdb16b1bcd4580fd..995f4c148897af70b1d500ac81b0c17816762430 100644 (file)
@@ -29,6 +29,7 @@ import com.intellij.psi.PsiFile;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.refactoring.*;
 import com.intellij.refactoring.util.CommonRefactoringUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -89,7 +90,7 @@ public class SafeDeleteHandler implements RefactoringActionHandler {
         }
       }
     } else {
-      fullElementsSet.addAll(Arrays.asList(temptoDelete));
+      ContainerUtil.addAll(fullElementsSet, temptoDelete);
     }
 
     if (!CommonRefactoringUtil.checkReadOnlyStatusRecursively(project, fullElementsSet)) return;
index 53b5e0b1b6748d029bc8f8c82cd3cc00bc64bc5b..71564a9bede7fe452b91883ec018de6d26d02a5a 100644 (file)
@@ -35,6 +35,7 @@ import com.intellij.ui.ScrollPaneFactory;
 import com.intellij.ui.components.JBList;
 import com.intellij.util.Icons;
 import com.intellij.util.PathUtil;
+import com.intellij.util.containers.ContainerUtil;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NotNull;
 
@@ -135,7 +136,7 @@ public class SimpleClasspathPanel extends JPanel {
     final THashSet<VirtualFile> result = new THashSet<VirtualFile>();
     for (final Enumeration<?> enumeration = myListModel.elements(); enumeration.hasMoreElements(); ) {
       final Library library = (Library)enumeration.nextElement();
-      result.addAll(Arrays.asList(library.getFiles(OrderRootType.CLASSES)));
+      ContainerUtil.addAll(result, library.getFiles(OrderRootType.CLASSES));
     }
     return result;
   }
index 341ca561f258ab007ec7f93a1ed09290a09d6349..08b873b12410df12ca08f083506dcc0da63932a0 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.EnvironmentUtil;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -131,7 +132,7 @@ public class ParametersList implements Cloneable{
   }
 
   public void addAll(final String[] parameters) {
-    myParameters.addAll(Arrays.asList(parameters));
+    ContainerUtil.addAll(myParameters, parameters);
   }
 
   public void addAll(final List<String> parameters) {
index c7f6639bb911e348b118ba37ddef4a268a93bab2..589755218b464b8a7d507d0c2f0a4a1d2e9f5ba5 100644 (file)
@@ -30,6 +30,7 @@ import com.intellij.util.Alarm;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.Time;
 import com.intellij.util.concurrency.WorkerThread;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashSet;
 import com.intellij.util.enumeration.EnumerationCopy;
 import com.intellij.util.ui.UIUtil;
@@ -3526,7 +3527,7 @@ public class AbstractTreeUi {
 
         Set<Object> toSelect = new HashSet<Object>();
         myTree.clearSelection();
-        toSelect.addAll(Arrays.asList(elements));
+        ContainerUtil.addAll(toSelect, elements);
         if (addToSelection) {
           toSelect.addAll(currentElements);
         }
index f90fe1534054f03c5f117df2f9d14204569e674e..d3a56c0fb51da7cf90fed6cb11f98e03da5fbdeb 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.openapi.util.ActionCallback;
 import com.intellij.openapi.util.Condition;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.Function;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
@@ -62,7 +63,7 @@ public class UpdaterTreeState {
   private Set<Object> addPaths(Object[] elements) {
     Set<Object> set = new HashSet<Object>();
     if (elements != null) {
-      set.addAll(Arrays.asList(elements));
+      ContainerUtil.addAll(set, elements);
     }
 
     return addPaths(set);
@@ -221,7 +222,7 @@ public class UpdaterTreeState {
     boolean wasFullyRejected = false;
     if (toSelect.length > 0 && selected.size() > 0 && !originallySelected.containsAll(selected)) {
       final Set<Object> successfulSelections = new HashSet<Object>();
-      successfulSelections.addAll(Arrays.asList(toSelect));
+      ContainerUtil.addAll(successfulSelections, toSelect);
 
       successfulSelections.retainAll(selected);
       wasFullyRejected = successfulSelections.size() == 0;
index 1fedc010c035e3f6e6ca9a71dd31225bb07e9a75..5af34c7b32feadcb00468ac87a3ed725f1eacd74 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.ui.components.panels.NonOpaquePanel;
 import com.intellij.ui.components.panels.Wrapper;
 import com.intellij.ui.treeStructure.Tree;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.UIUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -192,11 +193,11 @@ public class DetailsComponent {
   public void update() {
     ArrayList<String> strings = new ArrayList<String>();
     if (myPrefix != null) {
-      strings.addAll(Arrays.asList(myPrefix));
+      ContainerUtil.addAll(strings, myPrefix);
     }
 
     if (myText != null) {
-      strings.addAll(Arrays.asList(myText));
+      ContainerUtil.addAll(strings, myText);
     }
 
     myBannerText = ArrayUtil.toStringArray(strings);
index 57bfaf1072519c73f0767863ee559601c3a1ae47..68469f1ea6ef03a93bfe69cd7a8f793f75feef5a 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.help.HelpManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Disposer;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 
 import javax.swing.*;
@@ -93,7 +94,7 @@ public class DialogBuilder {
 
   public void setActionDescriptors(ActionDescriptor[] descriptors) {
     removeAllActions();
-    myActions.addAll(Arrays.asList(descriptors));
+    ContainerUtil.addAll(myActions, descriptors);
   }
 
   public void removeAllActions() {
index e0a1a65147b128f841f95d18a7c950582382b346..95814fd3a3dc30fd46bdf7bd57f034d493105e82 100644 (file)
@@ -37,6 +37,7 @@ import com.intellij.openapi.util.registry.RegistryValueListener;
 import com.intellij.ui.DocumentAdapter;
 import com.intellij.ui.SeparatorWithText;
 import com.intellij.ui.components.panels.VerticalBox;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.AwtVisitor;
 import org.jetbrains.annotations.Nls;
 import org.jetbrains.annotations.NonNls;
@@ -142,7 +143,7 @@ public class QuickAccessSettings implements ApplicationComponent, SearchableConf
     String[] vks = text.split(" ");
 
     HashSet<String> vksSet = new HashSet<String>();
-    vksSet.addAll(Arrays.asList(vks));
+    ContainerUtil.addAll(vksSet, vks);
     myModifierVks.clear();
     int mask = getModiferMask(vksSet);
     myModifierVks.addAll(getModifiersVKs(mask));
index d27bc542ce175b55320ae07ca36092fd6aa13b3e..de842f4a04f08f9ad07fc668d347d77d9a6b346d 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.openapi.application.Application;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.ErrorLogger;
 import com.intellij.openapi.diagnostic.IdeaLoggingEvent;
+import com.intellij.util.containers.ContainerUtil;
 import org.apache.log4j.AppenderSkeleton;
 import org.apache.log4j.Priority;
 import org.apache.log4j.spi.LoggingEvent;
@@ -48,7 +49,7 @@ public class DialogAppender extends AppenderSkeleton {
         Application application = ApplicationManager.getApplication();
         if (application != null) {
           if (application.isHeadlessEnvironment() || application.isDisposed()) return;
-          loggers.addAll(Arrays.asList(application.getComponents(ErrorLogger.class)));
+          ContainerUtil.addAll(loggers, application.getComponents(ErrorLogger.class));
         }
 
         appendToLoggers(event, loggers.toArray(new ErrorLogger[loggers.size()]));
index c806dec90f8ac15826a1159d6a92796090ce7e31..64e183d051bb6f28b3a0d9b609335f2b589f22ed 100644 (file)
@@ -31,6 +31,7 @@ import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.io.ZipUtil;
 
 import java.io.BufferedOutputStream;
@@ -58,7 +59,7 @@ public class ExportSettingsAction extends AnAction implements DumbAware {
     Set<File> exportFiles = new HashSet<File>();
     for (final ExportableComponent markedComponent : markedComponents) {
       final File[] files = markedComponent.getExportFiles();
-      exportFiles.addAll(Arrays.asList(files));
+      ContainerUtil.addAll(exportFiles, files);
     }
 
     ApplicationManager.getApplication().saveSettings();
index 23a0334f13e8876edc802c33cf6cd3206c2a5f9f..f5165ef3ccc6d55ba4fdbdb24f3c5f4b11ac2250 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.ide.ui.LafManager;
 import com.intellij.ide.ui.LafManagerListener;
 import com.intellij.openapi.Disposable;
 import com.intellij.openapi.util.Disposer;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.AwtVisitor;
 import com.intellij.util.ui.update.Activatable;
 import com.intellij.util.ui.update.UiNotifyConnector;
@@ -95,7 +96,7 @@ public class DnDEnabler implements Activatable, Disposable {
       public boolean visit(Component component) {
         EventListener[] mouseListeners = component.getListeners(MouseListener.class);
         if (mouseListeners.length > 0) {
-          myMouseListeners.addAll(Arrays.asList(mouseListeners));
+          ContainerUtil.addAll(myMouseListeners, mouseListeners);
           for (EventListener each : mouseListeners) {
             if (each instanceof MouseDragGestureRecognizer) {
               myOriginalDragGestureRecognizer = (MouseListener)each;
index 05a7b3512f6a88d0e28700a188a9e15010f66a43..d10cd17f6e302fe5b2e014ddb8ec5e871455b073 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.keymap.impl.ui.Group;
 import com.intellij.openapi.util.Pair;
 import com.intellij.ui.PopupHandler;
 import com.intellij.ui.treeStructure.Tree;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.diff.Diff;
 import com.intellij.util.ui.tree.TreeUtil;
 import org.jetbrains.annotations.NotNull;
@@ -64,47 +65,49 @@ public class CustomizationUtil {
 
 
   private static AnAction [] getReordableChildren(ActionGroup group, CustomActionsSchema schema, String defaultGroupName, AnActionEvent e) {
-     String text = group.getTemplatePresentation().getText();
-     ActionManager actionManager = ActionManager.getInstance();
-     final ArrayList<AnAction> reordableChildren = new ArrayList<AnAction>();
-     reordableChildren.addAll(Arrays.asList(group.getChildren(e)));
-     final List<ActionUrl> actions = schema.getActions();
-     for (Iterator<ActionUrl> iterator = actions.iterator(); iterator.hasNext();) {
-       ActionUrl actionUrl = iterator.next();
-       if ((actionUrl.getParentGroup().equals(text) ||
-            actionUrl.getParentGroup().equals(defaultGroupName) ||
-            actionUrl.getParentGroup().equals(actionManager.getId(group))) ) {
-         AnAction componentAction = actionUrl.getComponentAction();
-         if (componentAction != null) {
-           if (actionUrl.getActionType() == ActionUrl.ADDED) {
-             if (reordableChildren.size() > actionUrl.getAbsolutePosition()){
-               reordableChildren.add(actionUrl.getAbsolutePosition(), componentAction);
-             } else {
-               reordableChildren.add(componentAction);
-             }
-           }
-           else if (actionUrl.getActionType() == ActionUrl.DELETED && reordableChildren.size() > actionUrl.getAbsolutePosition()) {
-             final AnAction anAction = reordableChildren.get(actionUrl.getAbsolutePosition());
-             if (anAction.getTemplatePresentation().getText() == null
-                 ? (componentAction.getTemplatePresentation().getText() != null && componentAction.getTemplatePresentation().getText().length() > 0)
-                 : !anAction.getTemplatePresentation().getText().equals(componentAction.getTemplatePresentation().getText())) {
-               continue;
-             }
-             reordableChildren.remove(actionUrl.getAbsolutePosition());
-           }
-         }
-       }
-     }
-     for (int i = 0; i < reordableChildren.size(); i++) {
-       if (reordableChildren.get(i) instanceof ActionGroup) {
-         final ActionGroup groupToCorrect = (ActionGroup)reordableChildren.get(i);
-         final AnAction correctedAction = correctActionGroup(groupToCorrect, schema, "");
-         reordableChildren.set(i, correctedAction);
-       }
-     }
+    String text = group.getTemplatePresentation().getText();
+    ActionManager actionManager = ActionManager.getInstance();
+    final ArrayList<AnAction> reordableChildren = new ArrayList<AnAction>();
+    ContainerUtil.addAll(reordableChildren, group.getChildren(e));
+    final List<ActionUrl> actions = schema.getActions();
+    for (Iterator<ActionUrl> iterator = actions.iterator(); iterator.hasNext();) {
+      ActionUrl actionUrl = iterator.next();
+      if ((actionUrl.getParentGroup().equals(text) ||
+           actionUrl.getParentGroup().equals(defaultGroupName) ||
+           actionUrl.getParentGroup().equals(actionManager.getId(group)))) {
+        AnAction componentAction = actionUrl.getComponentAction();
+        if (componentAction != null) {
+          if (actionUrl.getActionType() == ActionUrl.ADDED) {
+            if (reordableChildren.size() > actionUrl.getAbsolutePosition()) {
+              reordableChildren.add(actionUrl.getAbsolutePosition(), componentAction);
+            }
+            else {
+              reordableChildren.add(componentAction);
+            }
+          }
+          else if (actionUrl.getActionType() == ActionUrl.DELETED && reordableChildren.size() > actionUrl.getAbsolutePosition()) {
+            final AnAction anAction = reordableChildren.get(actionUrl.getAbsolutePosition());
+            if (anAction.getTemplatePresentation().getText() == null
+                ? (componentAction.getTemplatePresentation().getText() != null &&
+                   componentAction.getTemplatePresentation().getText().length() > 0)
+                : !anAction.getTemplatePresentation().getText().equals(componentAction.getTemplatePresentation().getText())) {
+              continue;
+            }
+            reordableChildren.remove(actionUrl.getAbsolutePosition());
+          }
+        }
+      }
+    }
+    for (int i = 0; i < reordableChildren.size(); i++) {
+      if (reordableChildren.get(i) instanceof ActionGroup) {
+        final ActionGroup groupToCorrect = (ActionGroup)reordableChildren.get(i);
+        final AnAction correctedAction = correctActionGroup(groupToCorrect, schema, "");
+        reordableChildren.set(i, correctedAction);
+      }
+    }
 
-     return reordableChildren.toArray(new AnAction[reordableChildren.size()]);
-   }
+    return reordableChildren.toArray(new AnAction[reordableChildren.size()]);
+  }
 
   private static class CachedAction extends ActionGroup {
     private boolean myForceUpdate;
index a38d00bdb13762a539a88a49c805bce3cb8aa49e..5d21a20cd18cda8afae057e7f93f4e0b819497f7 100644 (file)
@@ -31,6 +31,7 @@ import com.intellij.ui.*;
 import com.intellij.ui.components.JBList;
 import com.intellij.util.Alarm;
 import com.intellij.util.Consumer;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.UIUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -659,7 +660,7 @@ public class SearchUtil {
   public static List<Configurable> expandGroup(final ConfigurableGroup group) {
     final Configurable[] configurables = group.getConfigurables();
     ArrayList<Configurable> result = new ArrayList<Configurable>();
-    result.addAll(Arrays.asList(configurables));
+    ContainerUtil.addAll(result, configurables);
     for (Configurable each : configurables) {
       addChildren(each, result);
     }
index 6f18ae4acceea2545bad9db4df32f30a5cab54ac..ca968e0d4dfc1a8931a201023425febd1a71cf58 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.util.JDOMUtil;
 import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.util.ResourceUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.StringInterner;
 import gnu.trove.THashMap;
 import gnu.trove.THashSet;
@@ -73,7 +74,7 @@ public class SearchableOptionsRegistrarImpl extends SearchableOptionsRegistrar {
       //stop words
       final String text = ResourceUtil.loadText(ResourceUtil.getResource(SearchableOptionsRegistrarImpl.class, "/search/", "ignore.txt"));
       final String[] stopWords = text.split("[\\W]");
-      myStopWords.addAll(Arrays.asList(stopWords));
+      ContainerUtil.addAll(myStopWords, stopWords);
 
       //index
       Document document =
index f429cbcbcc9362a2e409275f40eedb50b30442a6..5c1eed0ba99dca7e09225be3a171125cd618e4e4 100644 (file)
@@ -159,7 +159,7 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
       if (nearestMarkSpots.isEmpty()) return false;
       Set<RangeHighlighter> highlighters = new THashSet<RangeHighlighter>(nearestMarkSpots.size() + 4);
       for (MarkSpot markSpot : nearestMarkSpots) {
-        highlighters.addAll(Arrays.asList(markSpot.highlighters));
+        ContainerUtil.addAll(highlighters, markSpot.highlighters);
       }
       TooltipRenderer bigRenderer = myTooltipRendererProvider.calcTooltipRenderer(highlighters);
       if (bigRenderer != null) {
index 312de2a367a9c72750cac36267d19d0f50f34dd4..3780227dd82f40a8d684cc0de72fe616f2ba8d8f 100644 (file)
@@ -34,6 +34,7 @@ import com.intellij.ui.tabs.JBTabs;
 import com.intellij.util.Alarm;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.containers.ArrayListSet;
+import com.intellij.util.containers.ContainerUtil;
 import org.jdom.Element;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -521,7 +522,7 @@ public final class EditorsSplitters extends JPanel {
 
     for (final EditorWindow myWindow : myWindows) {
       final EditorWithProviderComposite[] editors = myWindow.getEditors();
-      res.addAll(Arrays.asList(editors));
+      ContainerUtil.addAll(res, editors);
     }
     return res.toArray(new EditorWithProviderComposite[res.size()]);
   }
index d3a690c854d660aad643f015d691d386880d0ffe..06493cbc0f5db4e01b6409b33ced8f808fbbb97b 100644 (file)
@@ -695,12 +695,13 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
       public void run() {
         VirtualFile file = descriptor.getFile();
         final FileEditor[] editors = openFile(file, focusEditor);
-        result.addAll(Arrays.asList(editors));
+        ContainerUtil.addAll(result, editors);
 
         boolean navigated = false;
         for (final FileEditor editor : editors) {
-          if (editor instanceof NavigatableFileEditor && getSelectedEditor(descriptor.getFile()) == editor) { // try to navigate opened editor
-            navigated = navigateAndSelectEditor((NavigatableFileEditor) editor,  descriptor);
+          if (editor instanceof NavigatableFileEditor &&
+              getSelectedEditor(descriptor.getFile()) == editor) { // try to navigate opened editor
+            navigated = navigateAndSelectEditor((NavigatableFileEditor)editor, descriptor);
             if (navigated) break;
           }
         }
@@ -708,7 +709,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
         if (!navigated) {
           for (final FileEditor editor : editors) {
             if (editor instanceof NavigatableFileEditor && getSelectedEditor(descriptor.getFile()) != editor) { // try other editors
-              if (navigateAndSelectEditor((NavigatableFileEditor) editor, descriptor)) {
+              if (navigateAndSelectEditor((NavigatableFileEditor)editor, descriptor)) {
                 break;
               }
             }
@@ -882,7 +883,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
     List<EditorWithProviderComposite> editorComposites = getEditorComposites(file);
     List<FileEditor> editors = new ArrayList<FileEditor>();
     for (EditorWithProviderComposite composite : editorComposites) {
-      editors.addAll(Arrays.asList(composite.getEditors()));
+      ContainerUtil.addAll(editors, composite.getEditors());
     }
     return editors.toArray(new FileEditor[editors.size()]);
   }
@@ -908,7 +909,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
     final EditorWithProviderComposite[] editorsComposites = getSplitters().getEditorsComposites();
     for (EditorWithProviderComposite editorsComposite : editorsComposites) {
       final FileEditor[] editors = editorsComposite.getEditors();
-      result.addAll(Arrays.asList(editors));
+      ContainerUtil.addAll(result, editors);
     }
     return result.toArray(new FileEditor[result.size()]);
   }
index 1991b02eb89ebfb681b6070313f3f8cee49c19fd..70d3745a00b9b9156887175e479659ee9dea6b81 100644 (file)
@@ -217,7 +217,7 @@ public class KeymapImpl implements Keymap, ExternalizableScheme {
         // copy parent shortcuts for this actionId
         Shortcut[] shortcuts = getParentShortcuts(actionId);
         // shortcuts are immutables
-        list.addAll(Arrays.asList(shortcuts));
+        ContainerUtil.addAll(list, shortcuts);
       }
     }
     list.add(shortcut);
@@ -829,7 +829,7 @@ public class KeymapImpl implements Keymap, ExternalizableScheme {
     ArrayList<String> ids = new ArrayList<String>();
     if (myParent != null) {
       String[] parentIds = getParentActionIds();
-      ids.addAll(Arrays.asList(parentIds));
+      ContainerUtil.addAll(ids, parentIds);
     }
     String[] ownActionIds = getOwnActionIds();
     for (String id : ownActionIds) {
index 9cadef712ded1a39d6a7c76ac65f600fcf4b5b4b..c8ff36fcf9ad9416242d9d90f9b85539a6c2c8d4 100644 (file)
@@ -17,6 +17,7 @@ package com.intellij.openapi.options.ex;
 
 import com.intellij.openapi.options.*;
 import com.intellij.openapi.project.Project;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.ArrayList;
@@ -88,8 +89,8 @@ public class ProjectConfigurablesGroup implements ConfigurableGroup {
 
   static List<Configurable> buildConfigurablesList(final Configurable[] extensions, final Configurable[] components, ConfigurableFilter filter) {
     List<Configurable> result = new ArrayList<Configurable>();
-    result.addAll(Arrays.asList(extensions));
-    result.addAll(Arrays.asList(components));
+    ContainerUtil.addAll(result, extensions);
+    ContainerUtil.addAll(result, components);
 
     final Iterator<Configurable> iterator = result.iterator();
     while (iterator.hasNext()) {
index c1645cdf3f26392743e8c3acecef20497c4a3f42..c60c6767f431bb8efc6ec2da4d15e144cf8c5f95 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.IconLoader;
 import com.intellij.ui.ListUtil;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.MappingListCellRenderer;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.Nullable;
@@ -126,7 +127,7 @@ public class UpdateSettingsConfigurable extends BaseConfigurable implements Sear
     }
     final String pluginHosts = System.getProperty("idea.plugin.hosts");
     if (pluginHosts != null) {
-      hosts.addAll(Arrays.asList(pluginHosts.split(";")));
+      ContainerUtil.addAll(hosts, pluginHosts.split(";"));
     }
     return hosts;
   }
index 77a057d2a7927391258f192a62704e685841ab97..827ced1fc84057334977ae5d6a335b8b04a1c720 100644 (file)
@@ -159,8 +159,8 @@ public class PersistentFS extends ManagingFS implements ApplicationComponent {
     }
     else {
       Set<String> allNamesSet = new LinkedHashSet<String>((currentNames.length + delegateNames.length) * 2);
-      allNamesSet.addAll(Arrays.asList(currentNames));
-      allNamesSet.addAll(Arrays.asList(delegateNames));
+      ContainerUtil.addAll(allNamesSet, currentNames);
+      ContainerUtil.addAll(allNamesSet, delegateNames);
       names = ArrayUtil.toStringArray(allNamesSet);
     }
 
index 0ff89fa00856ad660b75a66e9784b91567159b20..7b32bd5772ba94d7302c59a4808f27d2bccd5a90 100644 (file)
@@ -43,6 +43,7 @@ import com.intellij.openapi.wm.impl.status.IdeStatusBarImpl;
 import com.intellij.openapi.wm.impl.status.MemoryUsagePanel;
 import com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreen;
 import com.intellij.ui.PopupHandler;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -275,7 +276,7 @@ public class IdeRootPane extends JRootPane implements UISettingsListener {
   }
 
   public void installNorthComponents(final Project project) {
-    myNorthComponents.addAll(Arrays.asList(Extensions.getExtensions(IdeRootPaneNorthExtension.EP_NAME, project)));
+    ContainerUtil.addAll(myNorthComponents, Extensions.getExtensions(IdeRootPaneNorthExtension.EP_NAME, project));
     for (IdeRootPaneNorthExtension northComponent : myNorthComponents) {
       myNorthPanel.add(northComponent.getComponent());
       northComponent.uiSettingsChanged(myUISettings);
index 40e9298520e1cd99cd1f3bd92d363d9ff0418048..429a554833a53cdc19768459c56fda73214b6184 100644 (file)
@@ -16,6 +16,7 @@
 package com.intellij.testFramework;
 
 import com.intellij.openapi.util.Condition;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.Arrays;
 import java.util.HashSet;
@@ -28,7 +29,7 @@ public abstract class TreePrintCondition implements Condition<String> {
     protected Set<String> mySet = new HashSet<String>();
 
     public SetBased(String... elements) {
-      mySet.addAll(Arrays.asList(elements));
+      ContainerUtil.addAll(mySet, elements);
     }
   }
 
index 3920bdf28cff2dee2910cf5b511a26193aedb8e6..04cfd85f5a11b7edbfcc3415242fe0f99d9bdd40 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.usages.rules.ImportFilteringRule;
 import com.intellij.usages.UsageView;
 import com.intellij.usages.rules.UsageFilteringRule;
 import com.intellij.usages.rules.UsageFilteringRuleProvider;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
@@ -43,7 +44,7 @@ public class ImportUsageFilteringRuleProvider implements UsageFilteringRuleProvi
   public UsageFilteringRule[] getActiveRules(@NotNull final Project project) {
     final List<UsageFilteringRule> rules = new ArrayList<UsageFilteringRule>();
     if (!ImportFilteringUsageViewSetting.getInstance().SHOW_IMPORTS) {
-      rules.addAll(Arrays.asList(Extensions.getExtensions(ImportFilteringRule.EP_NAME)));
+      ContainerUtil.addAll(rules, Extensions.getExtensions(ImportFilteringRule.EP_NAME));
     }
     return rules.toArray(new UsageFilteringRule[rules.size()]);
   }
index dc533ee437732177425b20bfcba1b202d3ab8ef5..d6b6903e98c21dcaa53ecf4c4c60084046141744 100644 (file)
@@ -51,6 +51,7 @@ import com.intellij.util.Alarm;
 import com.intellij.util.EditSourceOnDoubleClickHandler;
 import com.intellij.util.Processor;
 import com.intellij.util.containers.ConcurrentHashSet;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.messages.MessageBusConnection;
 import com.intellij.util.ui.DialogUtil;
 import com.intellij.util.ui.UIUtil;
@@ -253,7 +254,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
     final UsageFilteringRuleProvider[] providers = Extensions.getExtensions(UsageFilteringRuleProvider.EP_NAME);
     List<UsageFilteringRule> list = new ArrayList<UsageFilteringRule>(providers.length);
     for (UsageFilteringRuleProvider provider : providers) {
-      list.addAll(Arrays.asList(provider.getActiveRules(project)));
+      ContainerUtil.addAll(list, provider.getActiveRules(project));
     }
     return list.toArray(new UsageFilteringRule[list.size()]);
   }
@@ -262,7 +263,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
     final UsageGroupingRuleProvider[] providers = Extensions.getExtensions(UsageGroupingRuleProvider.EP_NAME);
     List<UsageGroupingRule> list = new ArrayList<UsageGroupingRule>(providers.length);
     for (UsageGroupingRuleProvider provider : providers) {
-      list.addAll(Arrays.asList(provider.getActiveRules(project)));
+      ContainerUtil.addAll(list, provider.getActiveRules(project));
     }
 
     Collections.sort(list, new Comparator<UsageGroupingRule>() {
@@ -448,7 +449,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
     final UsageGroupingRuleProvider[] providers = Extensions.getExtensions(UsageGroupingRuleProvider.EP_NAME);
     List<AnAction> list = new ArrayList<AnAction>(providers.length);
     for (UsageGroupingRuleProvider provider : providers) {
-      list.addAll(Arrays.asList(provider.createGroupingActions(this)));
+      ContainerUtil.addAll(list, provider.createGroupingActions(this));
     }
     return list.toArray(new AnAction[list.size()]);
   }
@@ -900,13 +901,13 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
 
       if (usage instanceof UsageInFiles) {
         UsageInFiles usageInFiles = (UsageInFiles)usage;
-        result.addAll(Arrays.asList(usageInFiles.getFiles()));
+        ContainerUtil.addAll(result, usageInFiles.getFiles());
       }
     }
     for (UsageTarget target : myTargets) {
       VirtualFile[] files = target.getFiles();
       if (files == null) continue;
-      result.addAll(Arrays.asList(files));
+      ContainerUtil.addAll(result, files);
     }
     return result;
   }
@@ -1168,7 +1169,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
             }
 
             if (usage instanceof UsageInFiles) {
-              result.addAll(Arrays.asList(((UsageInFiles)usage).getFiles()));
+              ContainerUtil.addAll(result, ((UsageInFiles)usage).getFiles());
             }
           }
         }
@@ -1179,7 +1180,7 @@ public class UsageViewImpl implements UsageView, UsageModelTracker.UsageModelTra
           if (usageTarget.isValid()) {
             final VirtualFile[] files = usageTarget.getFiles();
             if (files != null) {
-              result.addAll(Arrays.asList(files));
+              ContainerUtil.addAll(result, files);
             }
           }
         }
index 237287c9bf1f76e6162b531cd4b9b6c28e4cf898..660e29a741cd9f5532609455a4234c7d7c24be04 100644 (file)
@@ -23,6 +23,7 @@ import com.intellij.openapi.util.ShutDownTracker;
 import com.intellij.openapi.util.SystemInfo;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.io.URLUtil;
 import org.intellij.lang.annotations.RegExp;
 import org.jetbrains.annotations.NonNls;
@@ -1023,7 +1024,7 @@ public class FileUtil {
       if (file.isDirectory()) {
         final File[] children = file.listFiles();
         if (children != null) {
-          queue.addAll(Arrays.asList(children));
+          ContainerUtil.addAll(queue, children);
         }
       }
     }
index 784c11060dffcbddaa7b3226d08266f21960a1bf..99c8b10ffd4d24c669de28932b2408c792c6ab49 100644 (file)
@@ -422,17 +422,24 @@ public class ContainerUtil {
     list.set(index2, e1);
   }
 
-  public static <T> ArrayList<T> collect(Iterator<?> iterator, FilteringIterator.InstanceOf<T> instanceOf) {
-    return collect(FilteringIterator.create(iterator, instanceOf));
+  public static <T> ArrayList<T> collect(@NotNull Iterator<?> iterator, @NotNull FilteringIterator.InstanceOf<T> instanceOf) {
+    return collect(FilteringIterator.create((Iterator<T>)iterator, instanceOf));
   }
 
-  public static <T> void addAll(Collection<T> collection, Enumeration<T> enumeration) {
+  public static <T> void addAll(@NotNull Collection<T> collection, @NotNull Enumeration<T> enumeration) {
     while (enumeration.hasMoreElements()) {
       T element = enumeration.nextElement();
       collection.add(element);
     }
   }
 
+  public static <T> void addAll(@NotNull Collection<T> collection, @NotNull T... elements) {
+    //noinspection ManualArrayToCollectionCopy
+    for (T element : elements) {
+      collection.add(element);
+    }
+  }
+
   public static <T, U extends T> U findInstance(Iterable<T> iterable, Class<U> aClass) {
     return findInstance(iterable.iterator(), aClass);
   }
index a89d66f67d56faef2b7d3e6bed13f785cb3f63b4..cba282ca88b7283e184c5a989400bf6483fa7fda 100644 (file)
@@ -111,7 +111,7 @@ public class FilteringIterator<Dom, E extends Dom> implements Iterator<E> {
   }
 
   public static <T> Iterator<T> createInstanceOf(Iterator<?> iterator, Class<T> aClass) {
-    return create(iterator, instanceOf(aClass));
+    return create((Iterator<T>)iterator, instanceOf(aClass));
   }
 
   public static class InstanceOf<T> implements Condition {
index 7acb1acb23ba2c4e108c8fe7f65ebd0c206f1ed7..9df7a6854fdbf2f4bec722f5754786fd279d6ed2 100644 (file)
@@ -22,6 +22,7 @@ package com.intellij.util.io.zip;
 
 import com.intellij.openapi.util.io.FileUtil;
 import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 
 import java.io.File;
@@ -90,7 +91,7 @@ public class ReorderJarsMain {
   private static Set<String> loadIgnoredJars(String libPath) throws IOException {
     final File ignoredJarsFile = new File(libPath, "required_for_dist.txt");
     final Set<String> ignoredJars = new HashSet<String>();
-    ignoredJars.addAll(Arrays.asList(new String(FileUtil.loadFileText(ignoredJarsFile)).split("\r\n")));
+    ContainerUtil.addAll(ignoredJars, new String(FileUtil.loadFileText(ignoredJarsFile)).split("\r\n"));
     return ignoredJars;
   }
 
@@ -113,4 +114,4 @@ public class ReorderJarsMain {
     return entriesOrder;
   }
 
-}
\ No newline at end of file
+}
index 120795956c94673a02600e4203338caf69b53b00..2f49e21998f3449ca2c372bf912c3885bfbac56c 100644 (file)
@@ -16,6 +16,7 @@
 
 package com.intellij.util.xmlb;
 
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NonNls;
 
 import java.beans.PropertyDescriptor;
@@ -63,11 +64,11 @@ class PropertyAccessor implements Accessor {
     List<Annotation> result = new ArrayList<Annotation>();
 
     if (myPropertyDescriptor.getReadMethod() != null) {
-      result.addAll(Arrays.asList(myPropertyDescriptor.getReadMethod().getAnnotations()));
+      ContainerUtil.addAll(result, myPropertyDescriptor.getReadMethod().getAnnotations());
     }
 
     if (myPropertyDescriptor.getWriteMethod() != null) {
-      result.addAll(Arrays.asList(myPropertyDescriptor.getWriteMethod().getAnnotations()));
+      ContainerUtil.addAll(result, myPropertyDescriptor.getWriteMethod().getAnnotations());
     }
 
     return result.toArray(new Annotation[result.size()]);
index 0fe20a815db228df0fc33af3124dbd65e3849f72..dfa08a67fe9f20334b7732da4c56947b05f37d73 100644 (file)
@@ -17,6 +17,7 @@
 package com.intellij.util.xmlb;
 
 import com.intellij.openapi.util.JDOMUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.xmlb.annotations.Tag;
 import com.intellij.util.ArrayUtil;
 import org.jdom.Element;
@@ -64,7 +65,7 @@ class TagBinding implements Binding {
       List<Object> childrenList = new ArrayList<Object>();
       for (Object node : nodes) {
         assert ((Element)node).getName().equals(name);
-        childrenList.addAll(Arrays.asList(JDOMUtil.getContent((Element)node)));
+        ContainerUtil.addAll(childrenList, JDOMUtil.getContent((Element)node));
       }
 
       children = ArrayUtil.toObjectArray(childrenList);
index c8ab525847fdc0308d75deb7035804a05974177b..6980065ba41d96369064129ade5386f67275e93b 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.vcs.*;
 import com.intellij.openapi.vfs.LocalFileSystem;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.util.*;
 
@@ -49,26 +50,29 @@ public class RootsCalculator {
         if (myVcs.equals(myPlManager.getVcsFor(myProject.getBaseDir()))) {
           roots.add(myProject.getBaseDir());
         }
-      } else {
+      }
+      else {
         VirtualFile newFile = LocalFileSystem.getInstance().findFileByPath(mapping.getDirectory());
         if (newFile == null) {
           newFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(mapping.getDirectory());
         }
         if (newFile != null) {
           roots.add(newFile);
-        } else {
+        }
+        else {
           LOG.info("Can not file virtual file for root: " + mapping.getDirectory());
         }
       }
     }
-    roots.addAll(Arrays.asList(myContentRoots));
+    ContainerUtil.addAll(roots, myContentRoots);
     final Map<VirtualFile, RepositoryLocation> result = new HashMap<VirtualFile, RepositoryLocation>();
     for (Iterator<VirtualFile> iterator = roots.iterator(); iterator.hasNext();) {
       final VirtualFile vf = iterator.next();
       final RepositoryLocation location = myLocationCache.getLocation(myVcs, new FilePathImpl(vf), false);
       if (location != null) {
         result.put(vf, location);
-      } else {
+      }
+      else {
         iterator.remove();
       }
     }
index 9d563b3d0370d596a1904a55cf74af26b0609cdd..2d552793b0c3f55f3523565835bf54256d01bd91 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.components.RoamingType;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.options.StreamProvider;
 import com.intellij.openapi.util.io.FileUtil;
+import com.intellij.util.containers.ContainerUtil;
 
 import java.io.*;
 import java.util.*;
@@ -96,7 +97,7 @@ public class CompoundShelfFileProcesor {
     for (StreamProvider serverStreamProvider : myServerStreamProviders) {
       if (serverStreamProvider.isEnabled()) {
         String[] subFiles = serverStreamProvider.listSubFiles(FILE_SPEC);
-        result.addAll(Arrays.asList(subFiles));
+        ContainerUtil.addAll(result, subFiles);
       }
     }
     return new ArrayList<String>(result);
index 51cc15f71306b4690ac577185aea56b49e0bedf6..6fe1ab181cffb41a22fca63fc7623735b361ca2d 100644 (file)
@@ -48,6 +48,7 @@ import com.intellij.ui.*;
 import com.intellij.ui.content.Content;
 import com.intellij.ui.content.ContentFactory;
 import com.intellij.ui.treeStructure.Tree;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.Convertor;
 import com.intellij.util.messages.MessageBus;
 import com.intellij.util.ui.tree.TreeUtil;
@@ -452,10 +453,10 @@ public class ShelvedChangesViewManager implements ProjectComponent {
       final List<ShelvedChangeList> shelvedChangeLists = (shelved == null && recycled == null) ?
                                                          Collections.<ShelvedChangeList>emptyList() : new ArrayList<ShelvedChangeList>();
       if (shelved != null) {
-        shelvedChangeLists.addAll(Arrays.asList(shelved));
+        ContainerUtil.addAll(shelvedChangeLists, shelved);
       }
       if (recycled != null) {
-        shelvedChangeLists.addAll(Arrays.asList(recycled));
+        ContainerUtil.addAll(shelvedChangeLists, recycled);
       }
       return shelvedChangeLists;
     }
index a667f4d6f5d1d29ddcac50275a2e8f872f776dd6..97d2ae73e0f3b9b791a0c0ac376e0fd368d07af0 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiLiteralExpression;
 import com.intellij.psi.PsiMethodCallExpression;
 import com.intellij.psi.PsiType;
+import com.intellij.util.containers.ContainerUtil;
 import com.siyeh.InspectionGadgetsBundle;
 import com.siyeh.ig.BaseInspection;
 import com.siyeh.ig.BaseInspectionVisitor;
@@ -100,7 +101,7 @@ public class HardcodedFileSeparatorsInspection extends BaseInspection {
      */
     private static final Set<String> timeZoneIds = new HashSet();
     static {
-        timeZoneIds.addAll(Arrays.asList(TimeZone.getAvailableIDs()));
+      ContainerUtil.addAll(timeZoneIds, TimeZone.getAvailableIDs());
     }
 
     /**
@@ -310,4 +311,4 @@ public class HardcodedFileSeparatorsInspection extends BaseInspection {
             return timeZoneIds.contains(string);
         }
     }
-}
\ No newline at end of file
+}
index 268eef5c4d7326b48812ad9eb475a33141226d5d..5841cd2ff2be0100df1702613f07034e61c22543 100644 (file)
@@ -16,6 +16,7 @@
 package com.siyeh.ig.resources;
 
 import com.intellij.psi.*;
+import com.intellij.util.containers.ContainerUtil;
 import com.siyeh.InspectionGadgetsBundle;
 import com.siyeh.ig.BaseInspectionVisitor;
 import org.jetbrains.annotations.NonNls;
@@ -58,8 +59,8 @@ public class JDBCResourceInspection extends ResourceInspection{
     private static final Set<String> creationMethodNameSet =
             new HashSet<String>(9);
 
-    static{
-        creationMethodNameSet.addAll(Arrays.asList(creationMethodName));
+    static {
+      ContainerUtil.addAll(creationMethodNameSet, creationMethodName);
     }
 
     @NotNull
@@ -143,4 +144,4 @@ public class JDBCResourceInspection extends ResourceInspection{
             return false;
         }
     }
-}
\ No newline at end of file
+}
index b929557e4cb9c110eb69898842d99a4ddb1d3cd6..e030f816c680cbf3397bdc1138d85e21cda8d3bd 100644 (file)
@@ -15,6 +15,8 @@
  */
 package com.siyeh.ig.ui;
 
+import com.intellij.util.containers.ContainerUtil;
+
 import javax.swing.table.AbstractTableModel;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -27,14 +29,14 @@ public class ListWrappingTableModel extends AbstractTableModel {
 
     public ListWrappingTableModel(List<List<String>> list,
                                   String... columnNames) {
-        if (list == null) {
-            throw new NullPointerException("list");
-        }
-        if (columnNames == null) {
-            throw new NullPointerException("columnNames");
-        }
-        this.list = list;
-        this.columnNames.addAll(Arrays.asList(columnNames));
+      if (list == null) {
+        throw new NullPointerException("list");
+      }
+      if (columnNames == null) {
+        throw new NullPointerException("columnNames");
+      }
+      this.list = list;
+      ContainerUtil.addAll(this.columnNames, columnNames);
     }
 
     /**
@@ -124,4 +126,4 @@ public class ListWrappingTableModel extends AbstractTableModel {
     public void setValueAt(Object value, int rowIndex, int columnIndex) {
         list.get(columnIndex).set(rowIndex, String.valueOf(value));
     }
-}
\ No newline at end of file
+}