From b82a61d7b72c0d470071f0feec3960efc2aafcb1 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 25 Sep 2018 16:25:50 +0200 Subject: [PATCH] deprecate Extensions.getExtensions(ExtensionPointName, AreaInstance) in favour of ExtensionPointName.getExtensionList(AreaInstance) --- .../compiler/CompilerConfigurationImpl.java | 7 ++--- .../compiler/CompilerManagerImpl.java | 3 +-- .../options/CompilerConfigurable.java | 19 ++----------- .../intellij/openapi/compiler/Compiler.java | 24 ++++------------- .../debugger/engine/DebugProcessEvents.java | 3 +-- .../application/ApplicationConfiguration.java | 1 - .../roots/ui/configuration/ModuleEditor.java | 9 +++---- .../JavaFindUsagesHandlerFactory.java | 19 ++----------- .../psi/NonClasspathResolveScopeEnlarger.java | 4 +-- .../psi/impl/PackagePrefixElementFinder.java | 3 +-- .../intellij/psi/NonClasspathClassFinder.java | 23 +++------------- .../source/javadoc/JavadocManagerImpl.java | 3 +-- .../java/psi/PsiConcurrencyStressTest.java | 3 +-- .../packageSet/CustomScopesProviderEx.java | 19 ++----------- .../daemon/impl/DefaultHighlightVisitor.java | 3 +-- .../daemon/impl/GeneralHighlightingPass.java | 5 ++-- .../openapi/vfs/WritingAccessProvider.java | 19 ++----------- .../com/intellij/psi/FileContextProvider.java | 19 ++----------- .../com/intellij/psi/impl/PsiManagerImpl.java | 23 +++------------- .../src/com/intellij/dvcs/DvcsUtil.java | 19 ++----------- .../dvcs/cherrypick/VcsCherryPickManager.java | 24 +++++------------ .../dvcs/repo/VcsRepositoryManager.java | 3 +-- .../openapi/extensions/Extensions.java | 19 ++++++------- .../RunConfigurationsSettings.java | 20 +++----------- .../daemon/impl/HectorComponent.java | 19 ++----------- .../problems/WolfTheProblemSolverImpl.java | 7 ++--- .../execution/impl/RunConfigurable.kt | 3 +-- .../find/findUsages/FindUsagesManager.java | 7 +++-- .../favoritesTreeView/FavoritesManager.java | 27 +++++-------------- .../FavoritesTreeNodeDescriptor.java | 19 ++----------- .../FavoritesTreeStructure.java | 19 ++----------- .../FavoritesTreeViewPanel.java | 9 +++---- .../actions/AddToFavoritesAction.java | 21 +++------------ .../ide/impl/ProjectViewSelectInTarget.java | 3 +-- .../ProjectAbstractTreeStructureBase.java | 19 ++----------- .../ide/projectView/impl/ProjectViewImpl.java | 5 ++-- .../ide/scopeView/ScopeTreeViewPanel.java | 3 +-- .../performance/TypingLatencyReportDialog.kt | 4 +-- .../impl/ProjectRootManagerComponent.java | 19 ++----------- .../PredefinedSearchScopeProviderImpl.java | 5 ++-- .../impl/RefactoringListenerManagerImpl.java | 19 ++----------- .../unscramble/AnalyzeStacktraceUtil.java | 23 +++------------- .../src/com/intellij/ide/SelectInManager.java | 3 +-- .../NonProjectFileWritingAccessProvider.java | 5 ++-- .../fileEditor/impl/text/FileDropHandler.java | 26 +++++------------- .../vcs/impl/FileStatusManagerImpl.java | 3 +-- .../openapi/vcs/readOnlyHandler/FileInfo.java | 19 ++----------- .../intellij/openapi/wm/impl/IdeRootPane.java | 3 +-- .../openapi/roots/impl/ContentEntryImpl.java | 21 +++------------ .../impl/DirectoryIndexExcludePolicy.java | 19 ++----------- .../roots/impl/ProjectRootManagerImpl.java | 7 +++-- .../openapi/roots/impl/RootIndex.java | 3 +-- .../openapi/roots/impl/RootModelImpl.java | 3 +-- .../impl/module/content/JpsContentEntry.java | 22 +++------------ .../context/ProjectViewContextProvider.java | 19 ++----------- .../tasks/context/WorkingContextManager.java | 23 +++------------- .../intellij/usages/impl/UsageViewImpl.java | 3 +-- .../diff/impl/patch/UnifiedDiffWriter.java | 21 +++------------ .../patch/ApplyPatchDefaultExecutor.java | 19 ++----------- .../vcs/changes/patch/PatchWriter.java | 19 ++----------- .../changes/ui/CommitChangeListDialog.java | 3 +-- .../changes/ui/NewEditChangelistPanel.java | 3 +-- .../vcs/impl/projectlevelman/AllVcses.java | 3 +-- .../vcs/log/history/FileHistoryUi.java | 19 ++----------- .../intellij/vcs/log/impl/VcsLogManager.java | 3 +-- .../statistics/VcsLogFeaturesCollector.java | 3 +-- .../com/intellij/vcs/log/ui/VcsLogUiImpl.java | 4 +-- .../ui/actions/HighlightersActionGroup.java | 19 ++----------- .../ig/style/BoundedWildcardInspection.java | 3 +-- .../coverage/CoverageOptionsConfigurable.java | 19 ++----------- .../tests/git4idea/test/GitTestUtil.kt | 23 +++------------- .../service/GradleBuildClasspathManager.java | 7 ++--- .../hg4idea/test/log/HgUserFilterTest.java | 3 +-- .../idea/svn/dialogs/ShareDialog.java | 3 +-- .../ide/palette/impl/PaletteWindow.java | 3 +-- .../edu/PyCharmEduInitialConfigurator.java | 4 +-- .../testing/PyRerunFailedTestsAction.java | 17 +----------- .../breadcrumbs/BreadcrumbsXmlWrapper.java | 3 +-- 78 files changed, 171 insertions(+), 734 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java b/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java index 867a0c882ed6..309d6d462595 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java @@ -1,6 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.compiler; import com.intellij.CommonBundle; @@ -24,7 +22,6 @@ import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; @@ -453,7 +450,7 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements } final Set types = new HashSet<>(); - for (BackendCompiler compiler : Extensions.getExtensions(BackendCompiler.EP_NAME, myProject)) { + for (BackendCompiler compiler : BackendCompiler.EP_NAME.getExtensions(myProject)) { myRegisteredCompilers.add(compiler); types.addAll(compiler.getCompilableFileTypes()); } diff --git a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java index 7bee3526813e..e2a20c46b6b8 100644 --- a/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java @@ -11,7 +11,6 @@ import com.intellij.openapi.compiler.*; import com.intellij.openapi.compiler.util.InspectionValidator; import com.intellij.openapi.compiler.util.InspectionValidatorWrapper; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileTypes.FileType; import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.module.Module; @@ -72,7 +71,7 @@ public class CompilerManagerImpl extends CompilerManager { myEventPublisher = messageBus.syncPublisher(CompilerTopics.COMPILATION_STATUS); // predefined compilers - for(Compiler compiler: Extensions.getExtensions(Compiler.EP_NAME, myProject)) { + for(Compiler compiler: Compiler.EP_NAME.getExtensions(myProject)) { addCompiler(compiler); } for (CompilerFactory factory : CompilerFactory.EP_NAME.getExtensionList(project)) { diff --git a/java/compiler/impl/src/com/intellij/compiler/options/CompilerConfigurable.java b/java/compiler/impl/src/com/intellij/compiler/options/CompilerConfigurable.java index 0ae2e9e07c63..f9815f9a9b8f 100644 --- a/java/compiler/impl/src/com/intellij/compiler/options/CompilerConfigurable.java +++ b/java/compiler/impl/src/com/intellij/compiler/options/CompilerConfigurable.java @@ -1,23 +1,8 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.compiler.options; import com.intellij.compiler.CompilerSettingsFactory; import com.intellij.openapi.compiler.CompilerBundle; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; @@ -89,7 +74,7 @@ public class CompilerConfigurable implements SearchableConfigurable.Parent, Conf @Override public Configurable[] getConfigurables() { if (myKids == null) { - final CompilerSettingsFactory[] factories = Extensions.getExtensions(CompilerSettingsFactory.EP_NAME, myProject); + final CompilerSettingsFactory[] factories = CompilerSettingsFactory.EP_NAME.getExtensions(myProject); myKids = ContainerUtil.mapNotNull(factories, (NullableFunction)factory -> factory.create(myProject), new Configurable[0]); } diff --git a/java/compiler/openapi/src/com/intellij/openapi/compiler/Compiler.java b/java/compiler/openapi/src/com/intellij/openapi/compiler/Compiler.java index 77f77f40b657..f41faff2b13f 100644 --- a/java/compiler/openapi/src/com/intellij/openapi/compiler/Compiler.java +++ b/java/compiler/openapi/src/com/intellij/openapi/compiler/Compiler.java @@ -1,22 +1,8 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.compiler; +import com.intellij.openapi.extensions.ProjectExtensionPointName; import org.jetbrains.annotations.NotNull; -import com.intellij.openapi.extensions.ExtensionPointName; /** * Base interface for a custom compiler which participates in the IDEA build process. @@ -25,8 +11,8 @@ import com.intellij.openapi.extensions.ExtensionPointName; * @see CompilerManager#removeCompiler(Compiler) */ public interface Compiler { - ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.compiler"); - + ProjectExtensionPointName EP_NAME = new ProjectExtensionPointName<>("com.intellij.compiler"); + /** * Returns the description of the compiler. All registered compilers should have unique description. * @@ -37,7 +23,7 @@ public interface Compiler { /** * Called before compilation starts. If at least one of registered compilers returned false, compilation won't start. - * + * * @param scope the scope on which the compilation is started. * @return true if everything is ok, false otherwise */ diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessEvents.java b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessEvents.java index 8a3dd3092fc0..ec5009051bcf 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessEvents.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessEvents.java @@ -24,7 +24,6 @@ import com.intellij.debugger.ui.overhead.OverheadTimings; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; @@ -349,7 +348,7 @@ public class DebugProcessEvents extends DebugProcessImpl { .map(factory -> factory.fun(this)) .filter(Objects::nonNull) .forEach(this::appendPositionManager); - Stream.of(Extensions.getExtensions(PositionManagerFactory.EP_NAME, getProject())) + Stream.of(PositionManagerFactory.EP_NAME.getExtensions(getProject())) .map(factory -> factory.createPositionManager(this)) .filter(Objects::nonNull) .forEach(this::appendPositionManager); diff --git a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java index d3623a93ef56..77f1e5dd0cce 100644 --- a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java +++ b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java @@ -34,7 +34,6 @@ import java.util.Objects; public class ApplicationConfiguration extends ModuleBasedConfiguration implements CommonJavaRunConfigurationParameters, ConfigurationWithCommandLineShortener, SingleClassConfiguration, RefactoringListenerProvider, InputRedirectAware { - /* deprecated, but 3rd-party used variables */ @SuppressWarnings("DeprecatedIsStillUsed") @Deprecated public String MAIN_CLASS_NAME; diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModuleEditor.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModuleEditor.java index f0f3bc2fb23c..1920f1c0c7ee 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModuleEditor.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModuleEditor.java @@ -1,6 +1,4 @@ -/* - * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.roots.ui.configuration; import com.intellij.facet.impl.ProjectFacetsConfigurator; @@ -10,7 +8,6 @@ import com.intellij.openapi.actionSystem.LangDataKeys; import com.intellij.openapi.components.ServiceKt; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.ExtensionPointName; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleConfigurationEditor; import com.intellij.openapi.module.impl.ModuleConfigurationStateImpl; @@ -39,8 +36,8 @@ import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; -import java.util.*; import java.util.List; +import java.util.*; /** * @author Eugene Zhuravlev @@ -224,7 +221,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable { for (ModuleConfigurationEditorProvider component : result) { reportDeprecatedModuleEditor(component.getClass()); } - ContainerUtil.addAll(result, Extensions.getExtensions(ModuleConfigurationEditorProvider.EP_NAME, module)); + ContainerUtil.addAll(result, ModuleConfigurationEditorProvider.EP_NAME.getExtensions(module)); return result.toArray(new ModuleConfigurationEditorProvider[0]); } diff --git a/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandlerFactory.java b/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandlerFactory.java index 2842b8368406..a70807a1d10f 100644 --- a/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandlerFactory.java +++ b/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandlerFactory.java @@ -1,23 +1,8 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.find.findUsages; import com.intellij.ide.util.SuperMethodWarningUtil; import com.intellij.lang.java.JavaFindUsagesProvider; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.psi.*; import com.intellij.util.containers.ContainerUtil; @@ -34,7 +19,7 @@ public class JavaFindUsagesHandlerFactory extends FindUsagesHandlerFactory { private final JavaVariableFindUsagesOptions myFindVariableOptions; public static JavaFindUsagesHandlerFactory getInstance(@NotNull Project project) { - return ContainerUtil.findInstance(Extensions.getExtensions(EP_NAME, project), JavaFindUsagesHandlerFactory.class); + return ContainerUtil.findInstance(EP_NAME.getExtensions(project), JavaFindUsagesHandlerFactory.class); } public JavaFindUsagesHandlerFactory(Project project) { diff --git a/java/java-impl/src/com/intellij/psi/NonClasspathResolveScopeEnlarger.java b/java/java-impl/src/com/intellij/psi/NonClasspathResolveScopeEnlarger.java index 97bd53c03e7b..a0ae04339bfe 100644 --- a/java/java-impl/src/com/intellij/psi/NonClasspathResolveScopeEnlarger.java +++ b/java/java-impl/src/com/intellij/psi/NonClasspathResolveScopeEnlarger.java @@ -1,7 +1,7 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi; import com.intellij.ide.highlighter.JavaFileType; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.ProjectFileIndex; import com.intellij.openapi.vfs.VfsUtilCore; @@ -26,7 +26,7 @@ public class NonClasspathResolveScopeEnlarger extends ResolveScopeEnlarger { String fileExtension = file.getExtension(); if ("class".equals(fileExtension) || JavaFileType.DEFAULT_EXTENSION.equals(fileExtension)) { - for (PsiElementFinder finder : Extensions.getExtensions(PsiElementFinder.EP_NAME, project)) { + for (PsiElementFinder finder : PsiElementFinder.EP_NAME.getExtensions(project)) { if (finder instanceof NonClasspathClassFinder) { final List roots = ((NonClasspathClassFinder)finder).getClassRoots(); for (VirtualFile root : roots) { diff --git a/java/java-impl/src/com/intellij/psi/impl/PackagePrefixElementFinder.java b/java/java-impl/src/com/intellij/psi/impl/PackagePrefixElementFinder.java index 14f87a072529..d48598cee1ea 100644 --- a/java/java-impl/src/com/intellij/psi/impl/PackagePrefixElementFinder.java +++ b/java/java-impl/src/com/intellij/psi/impl/PackagePrefixElementFinder.java @@ -1,7 +1,6 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi.impl; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; @@ -78,7 +77,7 @@ public class PackagePrefixElementFinder extends PsiElementFinder implements Dumb } public static PackagePrefixElementFinder getInstance(Project project) { - for (PsiElementFinder o : Extensions.getExtensions(PsiElementFinder.EP_NAME, project)) { + for (PsiElementFinder o : PsiElementFinder.EP_NAME.getExtensions(project)) { if (o instanceof PackagePrefixElementFinder) { return (PackagePrefixElementFinder) o; } diff --git a/java/java-psi-impl/src/com/intellij/psi/NonClasspathClassFinder.java b/java/java-psi-impl/src/com/intellij/psi/NonClasspathClassFinder.java index 1e71dc1d745d..3676a46a013f 100644 --- a/java/java-psi-impl/src/com/intellij/psi/NonClasspathClassFinder.java +++ b/java/java-psi-impl/src/com/intellij/psi/NonClasspathClassFinder.java @@ -1,22 +1,7 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.roots.impl.PackageDirectoryCache; import com.intellij.openapi.util.LowMemoryWatcher; @@ -70,7 +55,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder { LowMemoryWatcher.register(() -> clearCache(), project); } - @NotNull + @NotNull protected PackageDirectoryCache getCache(@Nullable GlobalSearchScope scope) { PackageDirectoryCache cache = myCache; if (cache == null) { @@ -95,7 +80,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder { public void clearCache() { myCache = null; } - + protected List getClassRoots(@Nullable GlobalSearchScope scope) { return getCache(scope).getDirectoriesByPackageName(""); } @@ -213,7 +198,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder { @NotNull public static GlobalSearchScope addNonClasspathScope(@NotNull Project project, @NotNull GlobalSearchScope base) { List nonClasspathScopes = new SmartList<>(); - for (PsiElementFinder finder : Extensions.getExtensions(EP_NAME, project)) { + for (PsiElementFinder finder : EP_NAME.getExtensions(project)) { if (finder instanceof NonClasspathClassFinder) { nonClasspathScopes.add(NonClasspathDirectoriesScope.compose(((NonClasspathClassFinder)finder).getClassRoots())); } diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/javadoc/JavadocManagerImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/javadoc/JavadocManagerImpl.java index fac55b29f360..84df23f38066 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/javadoc/JavadocManagerImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/javadoc/JavadocManagerImpl.java @@ -2,7 +2,6 @@ package com.intellij.psi.impl.source.javadoc; import com.intellij.codeInspection.SuppressionUtilCore; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.*; @@ -58,7 +57,7 @@ public class JavadocManagerImpl implements JavadocManager { myInfos.add(new ServiceReferenceTagInfo("uses")); myInfos.add(new ValueDocTagInfo()); - Collections.addAll(myInfos, Extensions.getExtensions(JavadocTagInfo.EP_NAME, project)); + Collections.addAll(myInfos, JavadocTagInfo.EP_NAME.getExtensions(project)); for (CustomJavadocTagProvider extension : CustomJavadocTagProvider.EP_NAME.getExtensionList()) { myInfos.addAll(extension.getSupportedTags()); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/PsiConcurrencyStressTest.java b/java/java-tests/testSrc/com/intellij/java/psi/PsiConcurrencyStressTest.java index 66f1f0f80e0b..39ae7127b491 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/PsiConcurrencyStressTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/PsiConcurrencyStressTest.java @@ -13,7 +13,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ex.PathManagerEx; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.editor.Document; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.roots.LanguageLevelProjectExtension; import com.intellij.pom.java.LanguageLevel; @@ -156,7 +155,7 @@ public class PsiConcurrencyStressTest extends DaemonAnalyzerTestCase { super.visitElement(element); final HighlightInfoHolder infoHolder = new HighlightInfoHolder(myFile); - for (HighlightVisitor visitor : Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, getProject())) { + for (HighlightVisitor visitor : HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensions(getProject())) { HighlightVisitor v = visitor.clone(); // to avoid race for com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.myAnnotationHolder v.analyze(myFile, true, infoHolder, () -> v.visit(element)); } diff --git a/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/CustomScopesProviderEx.java b/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/CustomScopesProviderEx.java index 1da5275ff550..ec0213f601a6 100644 --- a/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/CustomScopesProviderEx.java +++ b/platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/CustomScopesProviderEx.java @@ -1,21 +1,6 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi.search.scope.packageSet; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; @@ -46,7 +31,7 @@ public abstract class CustomScopesProviderEx implements CustomScopesProvider { public static void filterNoSettingsScopes(Project project, List scopes) { for (Iterator iterator = scopes.iterator(); iterator.hasNext(); ) { final NamedScope scope = iterator.next(); - for (CustomScopesProvider provider : Extensions.getExtensions(CUSTOM_SCOPES_PROVIDER, project)) { + for (CustomScopesProvider provider : CUSTOM_SCOPES_PROVIDER.getExtensions(project)) { if (provider instanceof CustomScopesProviderEx && ((CustomScopesProviderEx)provider).isVetoed(scope, ScopePlace.SETTING)) { iterator.remove(); break; diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/DefaultHighlightVisitor.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/DefaultHighlightVisitor.java index 1b1c6d0c1250..5b5d69785223 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/DefaultHighlightVisitor.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/DefaultHighlightVisitor.java @@ -7,7 +7,6 @@ import com.intellij.codeInsight.highlighting.HighlightErrorFilter; import com.intellij.lang.LanguageUtil; import com.intellij.lang.annotation.Annotation; import com.intellij.lang.annotation.Annotator; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.DumbService; @@ -51,7 +50,7 @@ class DefaultHighlightVisitor implements HighlightVisitor, DumbAware { myHighlightErrorElements = highlightErrorElements; myRunAnnotators = runAnnotators; myCachedAnnotators = cachedAnnotators; - myErrorFilters = Extensions.getExtensions(HighlightErrorFilter.EP_NAME, project); + myErrorFilters = HighlightErrorFilter.EP_NAME.getExtensions(project); myDumbService = DumbService.getInstance(project); myBatchMode = batchMode; } diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java index 3e94df2d017f..930243222b75 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java @@ -20,7 +20,6 @@ import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.markup.TextAttributes; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressManager; @@ -113,7 +112,7 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP @NotNull private HighlightVisitor[] cloneHighlightVisitors() { int oldCount = incVisitorUsageCount(1); - HighlightVisitor[] highlightVisitors = Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, myProject); + HighlightVisitor[] highlightVisitors = HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensions(myProject); if (oldCount != 0) { HighlightVisitor[] clones = new HighlightVisitor[highlightVisitors.length]; for (int i = 0; i < highlightVisitors.length; i++) { @@ -144,7 +143,7 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP LOG.error("No visitors registered. list=" + list + "; all visitors are:" + - Arrays.asList(Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, myProject))); + Arrays.asList(HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensions(myProject))); } return visitors.toArray(new HighlightVisitor[0]); diff --git a/platform/core-api/src/com/intellij/openapi/vfs/WritingAccessProvider.java b/platform/core-api/src/com/intellij/openapi/vfs/WritingAccessProvider.java index f0009761d646..779a6b388938 100644 --- a/platform/core-api/src/com/intellij/openapi/vfs/WritingAccessProvider.java +++ b/platform/core-api/src/com/intellij/openapi/vfs/WritingAccessProvider.java @@ -1,22 +1,7 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vfs; import com.intellij.openapi.extensions.ExtensionPointName; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NotNull; @@ -40,7 +25,7 @@ public abstract class WritingAccessProvider { @NotNull public static WritingAccessProvider[] getProvidersForProject(Project project) { - return project == null || project.isDefault() ? new WritingAccessProvider[0] : Extensions.getExtensions(EP_NAME, project); + return project == null || project.isDefault() ? new WritingAccessProvider[0] : EP_NAME.getExtensions(project); } public static boolean isPotentiallyWritable(VirtualFile file, Project project) { diff --git a/platform/core-api/src/com/intellij/psi/FileContextProvider.java b/platform/core-api/src/com/intellij/psi/FileContextProvider.java index e8ada6ffcdb5..5de787eb246f 100644 --- a/platform/core-api/src/com/intellij/psi/FileContextProvider.java +++ b/platform/core-api/src/com/intellij/psi/FileContextProvider.java @@ -1,23 +1,8 @@ -/* - * Copyright 2000-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi; import com.intellij.openapi.extensions.ExtensionPointName; -import com.intellij.openapi.extensions.Extensions; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -32,7 +17,7 @@ public abstract class FileContextProvider { @Nullable public static FileContextProvider getProvider(@NotNull final PsiFile file) { - for (FileContextProvider provider: Extensions.getExtensions(EP_NAME, file.getProject())) { + for (FileContextProvider provider: EP_NAME.getExtensions(file.getProject())) { if (provider.isAvailable(file)) { return provider; } diff --git a/platform/core-impl/src/com/intellij/psi/impl/PsiManagerImpl.java b/platform/core-impl/src/com/intellij/psi/impl/PsiManagerImpl.java index 701a7e6167b4..3e3a351e89e9 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/PsiManagerImpl.java +++ b/platform/core-impl/src/com/intellij/psi/impl/PsiManagerImpl.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi.impl; @@ -21,7 +7,6 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.progress.ProgressIndicatorProvider; import com.intellij.openapi.project.Project; @@ -208,7 +193,7 @@ public class PsiManagerImpl extends PsiManagerEx { private static String logPsi(@Nullable PsiElement element) { return element == null ? " null" : element.getClass().getName(); } - + @Override public void beforeChildAddition(@NotNull PsiTreeChangeEventImpl event) { beforeChange(true); @@ -355,7 +340,7 @@ public class PsiManagerImpl extends PsiManagerEx { preprocessor.treeChanged(event); } boolean enableOutOfCodeBlockTracking = ((PsiModificationTrackerImpl)myModificationTracker).isEnableCodeBlockTracker(); - for (PsiTreeChangePreprocessor preprocessor : Extensions.getExtensions(PsiTreeChangePreprocessor.EP_NAME, myProject)) { + for (PsiTreeChangePreprocessor preprocessor : PsiTreeChangePreprocessor.EP_NAME.getExtensions(myProject)) { if (!enableOutOfCodeBlockTracking && preprocessor instanceof PsiTreeChangePreprocessorBase) continue; try { preprocessor.treeChanged(event); @@ -365,7 +350,7 @@ public class PsiManagerImpl extends PsiManagerEx { } } if (!enableOutOfCodeBlockTracking) { - for (PsiTreeChangePreprocessor preprocessor : Extensions.getExtensions(PsiTreeChangePreprocessor.EP_NAME, myProject)) { + for (PsiTreeChangePreprocessor preprocessor : PsiTreeChangePreprocessor.EP_NAME.getExtensions(myProject)) { if (!(preprocessor instanceof PsiTreeChangePreprocessorBase)) continue; try { ((PsiTreeChangePreprocessorBase)preprocessor).onOutOfCodeBlockModification(event); diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/DvcsUtil.java b/platform/dvcs-impl/src/com/intellij/dvcs/DvcsUtil.java index 794f91b754c4..0326263e3c53 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/DvcsUtil.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/DvcsUtil.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.dvcs; import com.intellij.dvcs.push.PushSupport; @@ -25,7 +11,6 @@ import com.intellij.openapi.application.AccessToken; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorManager; @@ -459,7 +444,7 @@ public class DvcsUtil { @Nullable public static PushSupport getPushSupport(@NotNull final AbstractVcs vcs) { - return ContainerUtil.find(Extensions.getExtensions(PushSupport.PUSH_SUPPORT_EP, vcs.getProject()), + return ContainerUtil.find(PushSupport.PUSH_SUPPORT_EP.getExtensions(vcs.getProject()), support -> support.getVcs().equals(vcs)); } diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/cherrypick/VcsCherryPickManager.java b/platform/dvcs-impl/src/com/intellij/dvcs/cherrypick/VcsCherryPickManager.java index 26c3c8ddafb5..11738b53983c 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/cherrypick/VcsCherryPickManager.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/cherrypick/VcsCherryPickManager.java @@ -1,30 +1,18 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.dvcs.cherrypick; import com.google.common.collect.Lists; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.BackgroundTaskQueue; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.Task; import com.intellij.openapi.project.Project; -import com.intellij.openapi.vcs.*; +import com.intellij.openapi.vcs.AbstractVcs; +import com.intellij.openapi.vcs.ProjectLevelVcsManager; +import com.intellij.openapi.vcs.VcsKey; +import com.intellij.openapi.vcs.VcsNotifier; import com.intellij.openapi.vcs.changes.ChangeListManager; import com.intellij.openapi.vcs.changes.ChangeListManagerEx; import com.intellij.util.containers.ContainerUtil; @@ -73,7 +61,7 @@ public class VcsCherryPickManager { @Nullable public VcsCherryPicker getCherryPickerFor(@NotNull final VcsKey key) { - return ContainerUtil.find(Extensions.getExtensions(VcsCherryPicker.EXTENSION_POINT_NAME, myProject), + return ContainerUtil.find(VcsCherryPicker.EXTENSION_POINT_NAME.getExtensions(myProject), picker -> picker.getSupportedVcs().equals(key)); } diff --git a/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java b/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java index b8222ab3ccb6..d0869de388fb 100644 --- a/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java +++ b/platform/dvcs-impl/src/com/intellij/dvcs/repo/VcsRepositoryManager.java @@ -2,7 +2,6 @@ package com.intellij.dvcs.repo; import com.intellij.openapi.Disposable; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.util.BackgroundTaskUtil; import com.intellij.openapi.project.Project; @@ -49,7 +48,7 @@ public class VcsRepositoryManager implements Disposable, VcsListener { public VcsRepositoryManager(@NotNull Project project, @NotNull ProjectLevelVcsManager vcsManager) { myProject = project; myVcsManager = vcsManager; - myRepositoryCreators = Arrays.asList(Extensions.getExtensions(VcsRepositoryCreator.EXTENSION_POINT_NAME, project)); + myRepositoryCreators = Arrays.asList(VcsRepositoryCreator.EXTENSION_POINT_NAME.getExtensions(project)); project.getMessageBus().connect().subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, this); } diff --git a/platform/extensions/src/com/intellij/openapi/extensions/Extensions.java b/platform/extensions/src/com/intellij/openapi/extensions/Extensions.java index 3fbf6cf14903..0095b0cf2bcf 100644 --- a/platform/extensions/src/com/intellij/openapi/extensions/Extensions.java +++ b/platform/extensions/src/com/intellij/openapi/extensions/Extensions.java @@ -13,6 +13,7 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; import java.util.Map; +import java.util.Objects; public class Extensions { public static final ExtensionPointName AREA_LISTENER_EXTENSION_POINT = new ExtensionPointName<>("com.intellij.arealistener"); @@ -80,12 +81,16 @@ public class Extensions { @Deprecated @NotNull public static T[] getExtensions(@NotNull ExtensionPointName extensionPointName) { - return getExtensions(extensionPointName, null); + return extensionPointName.getExtensions(); } + /** + * @deprecated Use {@link ProjectExtensionPointName#getExtensions(AreaInstance)} )} + */ + @Deprecated @NotNull public static T[] getExtensions(@NotNull ExtensionPointName extensionPointName, @Nullable AreaInstance areaInstance) { - return getExtensions(extensionPointName.getName(), areaInstance); + return extensionPointName.getExtensions(areaInstance); } @NotNull @@ -108,7 +113,7 @@ public class Extensions { @NotNull public static U findExtension(@NotNull ExtensionPointName extensionPointName, AreaInstance areaInstance, @NotNull Class extClass) { - for (T t : getExtensions(extensionPointName, areaInstance)) { + for (T t : extensionPointName.getExtensions(areaInstance)) { if (extClass.isInstance(t)) { //noinspection unchecked return (U) t; @@ -123,7 +128,7 @@ public class Extensions { throw new IllegalArgumentException("Area class is not registered: " + areaClass); } ExtensionsArea parentArea = getArea(parentAreaInstance); - if (!equals(parentArea.getAreaClass(), configuration.getParentClassName())) { + if (!Objects.equals(parentArea.getAreaClass(), configuration.getParentClassName())) { throw new IllegalArgumentException("Wrong parent area. Expected class: " + configuration.getParentClassName() + " actual class: " + parentArea.getAreaClass()); } ExtensionsAreaImpl area = new ExtensionsAreaImpl(areaClass, areaInstance, parentArea.getPicoContainer()); @@ -144,7 +149,7 @@ public class Extensions { if (ourAreaClass2Configuration.containsKey(areaClass)) { // allow duplicate area class registrations if they are the same - fixing duplicate registration in tests is much more trouble AreaClassConfiguration configuration = ourAreaClass2Configuration.get(areaClass); - if (!equals(configuration.getParentClassName(), parentAreaClass)) { + if (!Objects.equals(configuration.getParentClassName(), parentAreaClass)) { throw new RuntimeException("Area class already registered: " + areaClass + ", "+ configuration); } else { @@ -172,10 +177,6 @@ public class Extensions { } } - private static boolean equals(@Nullable Object object1, @Nullable Object object2) { - return object1 == object2 || object1 != null && object1.equals(object2); - } - private static class AreaClassConfiguration { private final String myClassName; private final String myParentClassName; diff --git a/platform/lang-api/src/com/intellij/execution/configurations/RunConfigurationsSettings.java b/platform/lang-api/src/com/intellij/execution/configurations/RunConfigurationsSettings.java index 732976cf73a7..5e525d9333bf 100644 --- a/platform/lang-api/src/com/intellij/execution/configurations/RunConfigurationsSettings.java +++ b/platform/lang-api/src/com/intellij/execution/configurations/RunConfigurationsSettings.java @@ -1,26 +1,12 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.execution.configurations; -import com.intellij.openapi.extensions.ExtensionPointName; +import com.intellij.openapi.extensions.ProjectExtensionPointName; import com.intellij.openapi.options.UnnamedConfigurable; import org.jetbrains.annotations.NotNull; public interface RunConfigurationsSettings { - ExtensionPointName EXTENSION_POINT = ExtensionPointName.create("com.intellij.runConfigurationsSettings"); + ProjectExtensionPointName EXTENSION_POINT = new ProjectExtensionPointName<>("com.intellij.runConfigurationsSettings"); @NotNull UnnamedConfigurable createConfigurable(); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HectorComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HectorComponent.java index d94f4ed93df8..1a1a5bb41f2d 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HectorComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HectorComponent.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.daemon.impl; @@ -27,7 +13,6 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.EditorBundle; import com.intellij.openapi.editor.HectorComponentPanel; import com.intellij.openapi.editor.HectorComponentPanelsProvider; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.ShowSettingsUtil; import com.intellij.openapi.options.ex.ConfigurableExtensionPointUtil; @@ -153,7 +138,7 @@ public class HectorComponent extends JPanel { gc.insets.right = 0; gc.fill = GridBagConstraints.HORIZONTAL; myAdditionalPanels = new ArrayList<>(); - for (HectorComponentPanelsProvider provider : Extensions.getExtensions(HectorComponentPanelsProvider.EP_NAME, project)) { + for (HectorComponentPanelsProvider provider : HectorComponentPanelsProvider.EP_NAME.getExtensions(project)) { final HectorComponentPanel componentPanel = provider.createConfigurable(file); if (componentPanel != null) { myAdditionalPanels.add(componentPanel); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java index 13d63737b36b..f8bed78993cc 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/problems/WolfTheProblemSolverImpl.java @@ -8,7 +8,6 @@ import com.intellij.lang.annotation.HighlightSeverity; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.editor.Document; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorManager; @@ -26,7 +25,9 @@ import com.intellij.openapi.util.TextRange; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.FileStatusListener; import com.intellij.openapi.vcs.FileStatusManager; -import com.intellij.openapi.vfs.*; +import com.intellij.openapi.vfs.VfsUtilCore; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.openapi.vfs.VirtualFileManager; import com.intellij.openapi.vfs.newvfs.BulkFileListener; import com.intellij.openapi.vfs.newvfs.events.VFileDeleteEvent; import com.intellij.openapi.vfs.newvfs.events.VFileEvent; @@ -337,7 +338,7 @@ public class WolfTheProblemSolverImpl extends WolfTheProblemSolver { synchronized (myFilters) { if (!myFiltersLoaded) { myFiltersLoaded = true; - myFilters.addAll(Arrays.asList(Extensions.getExtensions(FILTER_EP_NAME, myProject))); + myFilters.addAll(Arrays.asList(FILTER_EP_NAME.getExtensions(myProject))); } } for (final Condition filter : myFilters) { diff --git a/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.kt b/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.kt index e9ae2f140e01..f36f4af404e5 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.kt +++ b/platform/lang-impl/src/com/intellij/execution/impl/RunConfigurable.kt @@ -12,7 +12,6 @@ import com.intellij.openapi.Disposable import com.intellij.openapi.actionSystem.* import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.diagnostic.logger -import com.intellij.openapi.extensions.Extensions import com.intellij.openapi.options.Configurable import com.intellij.openapi.options.ConfigurationException import com.intellij.openapi.options.SettingsEditorConfigurable @@ -545,7 +544,7 @@ open class RunConfigurable @JvmOverloads constructor(private val project: Projec } override fun createComponent(): JComponent? { - for (each in Extensions.getExtensions(RunConfigurationsSettings.EXTENSION_POINT, project)) { + for (each in RunConfigurationsSettings.EXTENSION_POINT.getExtensions(project)) { val configurable = each.createConfigurable() additionalSettings.add(Pair.create(configurable, configurable.createComponent())) } diff --git a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java index 4ba03129401e..8d6ad2a6db6b 100644 --- a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java +++ b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java @@ -17,7 +17,6 @@ import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorLocation; import com.intellij.openapi.fileEditor.TextEditor; @@ -90,7 +89,7 @@ public class FindUsagesManager { } public boolean canFindUsages(@NotNull final PsiElement element) { - for (FindUsagesHandlerFactory factory : Extensions.getExtensions(FindUsagesHandlerFactory.EP_NAME, myProject)) { + for (FindUsagesHandlerFactory factory : FindUsagesHandlerFactory.EP_NAME.getExtensions(myProject)) { try { if (factory.canFindUsages(element)) { return true; @@ -156,7 +155,7 @@ public class FindUsagesManager { @Nullable public FindUsagesHandler getFindUsagesHandler(@NotNull PsiElement element, final boolean forHighlightUsages) { - for (FindUsagesHandlerFactory factory : Extensions.getExtensions(FindUsagesHandlerFactory.EP_NAME, myProject)) { + for (FindUsagesHandlerFactory factory : FindUsagesHandlerFactory.EP_NAME.getExtensions(myProject)) { if (factory.canFindUsages(element)) { final FindUsagesHandler handler = factory.createFindUsagesHandler(element, forHighlightUsages); if (handler == FindUsagesHandler.NULL_HANDLER) return null; @@ -170,7 +169,7 @@ public class FindUsagesManager { @Nullable public FindUsagesHandler getNewFindUsagesHandler(@NotNull PsiElement element, final boolean forHighlightUsages) { - for (FindUsagesHandlerFactory factory : Extensions.getExtensions(FindUsagesHandlerFactory.EP_NAME, myProject)) { + for (FindUsagesHandlerFactory factory : FindUsagesHandlerFactory.EP_NAME.getExtensions(myProject)) { if (factory.canFindUsages(element)) { Class aClass = factory.getClass(); FindUsagesHandlerFactory copy = (FindUsagesHandlerFactory)new CachingConstructorInjectionComponentAdapter(aClass.getName(), aClass) diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesManager.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesManager.java index 92bdbaf8d89f..53750b08a7d4 100644 --- a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesManager.java +++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesManager.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.favoritesTreeView; @@ -25,7 +11,6 @@ import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.ProjectComponent; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleUtilCore; import com.intellij.openapi.project.Project; @@ -69,7 +54,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable { if (myProviders != null) return myProviders; myProviders = new HashMap<>(); if (!ApplicationManager.getApplication().isUnitTestMode()) { - final FavoritesListProvider[] providers = Extensions.getExtensions(EP_NAME, myProject); + final FavoritesListProvider[] providers = EP_NAME.getExtensions(myProject); for (FavoritesListProvider provider : providers) { myProviders.put(provider.getListName(myProject), provider); } @@ -337,7 +322,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable { if (toReorder == index + 1 && !above) return false; return true; } - + @Override @NotNull public String getComponentName() { @@ -407,7 +392,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable { final String urlValue = element.getAttributeValue(ATTRIBUTE_URL); final String moduleName = element.getAttributeValue(ATTRIBUTE_MODULE); - for (FavoriteNodeProvider nodeProvider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) { + for (FavoriteNodeProvider nodeProvider : FavoriteNodeProvider.EP_NAME.getExtensions(project)) { if (nodeProvider.getFavoriteTypeId().equals(type)) { return new AbstractUrlFavoriteAdapter(urlValue, moduleName, nodeProvider); } @@ -436,7 +421,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable { public static AbstractUrl createUrlByElement(Object element, final Project project) { if (element instanceof SmartPsiElementPointer) element = ((SmartPsiElementPointer)element).getElement(); - for (FavoriteNodeProvider nodeProvider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) { + for (FavoriteNodeProvider nodeProvider : FavoriteNodeProvider.EP_NAME.getExtensions(project)) { String url = nodeProvider.getElementUrl(element); if (url != null) { return new AbstractUrlFavoriteAdapter(url, nodeProvider.getElementModuleName(element), nodeProvider); @@ -549,7 +534,7 @@ public class FavoritesManager implements ProjectComponent, JDOMExternalizable { } - for (FavoriteNodeProvider provider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, myProject)) { + for (FavoriteNodeProvider provider : FavoriteNodeProvider.EP_NAME.getExtensions(myProject)) { if (provider.elementContainsFile(element, vFile)) { return true; } diff --git a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeNodeDescriptor.java b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeNodeDescriptor.java index 1569b0c3ee9e..c309b3b07b27 100644 --- a/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeNodeDescriptor.java +++ b/platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeNodeDescriptor.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.favoritesTreeView; @@ -22,7 +8,6 @@ import com.intellij.ide.projectView.impl.nodes.NamedLibraryElement; import com.intellij.ide.util.treeView.AbstractTreeNode; import com.intellij.ide.util.treeView.NodeDescriptor; import com.intellij.ide.util.treeView.PresentableNodeDescriptor; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VfsUtil; @@ -87,7 +72,7 @@ public class FavoritesTreeNodeDescriptor extends PresentableNodeDescriptor nodesToAdd = null; - for (FavoriteNodeProvider provider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) { + for (FavoriteNodeProvider provider : FavoriteNodeProvider.EP_NAME.getExtensions(project)) { Collection nodes = provider.getFavoriteNodes(dataContext, ViewSettings.DEFAULT); if (nodes != null && !nodes.isEmpty()) { nodesToAdd = nodes; @@ -148,7 +133,7 @@ public class AddToFavoritesAction extends AnAction implements DumbAware { ViewSettings favoritesConfig) { if (project == null) return Collections.emptyList(); ArrayList result = new ArrayList<>(); - for (FavoriteNodeProvider provider : Extensions.getExtensions(FavoriteNodeProvider.EP_NAME, project)) { + for (FavoriteNodeProvider provider : FavoriteNodeProvider.EP_NAME.getExtensions(project)) { final AbstractTreeNode treeNode = provider.createNode(project, object, favoritesConfig); if (treeNode != null) { result.add(treeNode); diff --git a/platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInTarget.java b/platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInTarget.java index 23cf1bb190c8..1d9ab8e96c13 100644 --- a/platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInTarget.java +++ b/platform/lang-impl/src/com/intellij/ide/impl/ProjectViewSelectInTarget.java @@ -10,7 +10,6 @@ import com.intellij.ide.projectView.TreeStructureProvider; import com.intellij.ide.projectView.impl.AbstractProjectViewPane; import com.intellij.ide.projectView.impl.ProjectViewImpl; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.ActionCallback; @@ -140,7 +139,7 @@ public abstract class ProjectViewSelectInTarget extends SelectInTargetPsiWrapper } private TreeStructureProvider[] getProvidersDumbAware() { - TreeStructureProvider[] allProviders = Extensions.getExtensions(TreeStructureProvider.EP_NAME, myProject); + TreeStructureProvider[] allProviders = TreeStructureProvider.EP_NAME.getExtensions(myProject); List dumbAware = DumbService.getInstance(myProject).filterByDumbAwareness(allProviders); return dumbAware.toArray(new TreeStructureProvider[0]); } diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectAbstractTreeStructureBase.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectAbstractTreeStructureBase.java index 54e08152ba06..1ed53b3b8b03 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectAbstractTreeStructureBase.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectAbstractTreeStructureBase.java @@ -1,24 +1,9 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.ide.projectView.impl; import com.intellij.ide.projectView.TreeStructureProvider; import com.intellij.ide.util.treeView.AbstractTreeStructureBase; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import java.util.Arrays; @@ -34,7 +19,7 @@ public abstract class ProjectAbstractTreeStructureBase extends AbstractTreeStruc @Override public List getProviders() { if (myProviders == null) { - final TreeStructureProvider[] providers = Extensions.getExtensions(TreeStructureProvider.EP_NAME, myProject); + final TreeStructureProvider[] providers = TreeStructureProvider.EP_NAME.getExtensions(myProject); myProviders = Arrays.asList(providers); } return myProviders; diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java index d06c7062be81..ab9b7228cc43 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java @@ -29,7 +29,6 @@ import com.intellij.openapi.components.Storage; import com.intellij.openapi.components.StoragePathMacros; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileEditor; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.TextEditor; @@ -90,8 +89,8 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import java.awt.*; -import java.util.*; import java.util.List; +import java.util.*; @State(name = "ProjectView", storages = @Storage(StoragePathMacros.WORKSPACE_FILE)) public class ProjectViewImpl extends ProjectView implements PersistentStateComponent, Disposable, QuickActionProvider, BusyObject { @@ -515,7 +514,7 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo private void ensurePanesLoaded() { if (myExtensionsLoaded) return; myExtensionsLoaded = true; - AbstractProjectViewPane[] extensions = Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, myProject); + AbstractProjectViewPane[] extensions = AbstractProjectViewPane.EP_NAME.getExtensions(myProject); Arrays.sort(extensions, PANE_WEIGHT_COMPARATOR); for(AbstractProjectViewPane pane: extensions) { if (myUninitializedPaneState.containsKey(pane.getId())) { diff --git a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java index 6a51031f787a..303934aea6bb 100644 --- a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java +++ b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java @@ -27,7 +27,6 @@ import com.intellij.openapi.editor.colors.CodeInsightColors; import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.markup.EffectType; import com.intellij.openapi.editor.markup.TextAttributes; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.ide.CopyPasteManager; import com.intellij.openapi.module.Module; @@ -237,7 +236,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable { new TreeSpeedSearch(myTree); myCopyPasteDelegator = new CopyPasteDelegator(myProject, this); myTreeExpansionMonitor = PackageTreeExpansionMonitor.install(myTree, myProject); - final ScopeTreeStructureExpander[] extensions = Extensions.getExtensions(ScopeTreeStructureExpander.EP_NAME, myProject); + final ScopeTreeStructureExpander[] extensions = ScopeTreeStructureExpander.EP_NAME.getExtensions(myProject); for (ScopeTreeStructureExpander expander : extensions) { myTree.addTreeWillExpandListener(expander); } diff --git a/platform/lang-impl/src/com/intellij/internal/performance/TypingLatencyReportDialog.kt b/platform/lang-impl/src/com/intellij/internal/performance/TypingLatencyReportDialog.kt index 27bf2d10f3e7..e28265c133a1 100644 --- a/platform/lang-impl/src/com/intellij/internal/performance/TypingLatencyReportDialog.kt +++ b/platform/lang-impl/src/com/intellij/internal/performance/TypingLatencyReportDialog.kt @@ -1,13 +1,11 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.internal.performance -import com.intellij.execution.filters.Filter import com.intellij.execution.filters.TextConsoleBuilderFactory import com.intellij.execution.ui.ConsoleView import com.intellij.execution.ui.ConsoleViewContentType import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent -import com.intellij.openapi.extensions.Extensions import com.intellij.openapi.fileChooser.FileChooserFactory import com.intellij.openapi.fileChooser.FileSaverDescriptor import com.intellij.openapi.project.Project @@ -105,7 +103,7 @@ class TypingLatencyReportDialog( private fun createThreadDumpBrowser(): JComponent { val builder = TextConsoleBuilderFactory.getInstance().createBuilder(project) - builder.filters(*Extensions.getExtensions(AnalyzeStacktraceUtil.EP_NAME, project)) + builder.filters(AnalyzeStacktraceUtil.EP_NAME.getExtensions(project)) consoleView = builder.console Disposer.register(disposable, consoleView) diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java index 95475db222fb..b1d7a402a5ff 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.roots.impl; import com.intellij.ProjectTopics; @@ -22,7 +8,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.ProjectComponent; import com.intellij.openapi.components.impl.stores.BatchUpdateListener; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileTypes.FileTypeEvent; import com.intellij.openapi.fileTypes.FileTypeListener; import com.intellij.openapi.fileTypes.FileTypeManager; @@ -217,7 +202,7 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl implemen recursive.addAll(ContainerUtil.map(extension.getRootsToWatch(myProject), VirtualFile::getPath)); } - for (WatchedRootsProvider extension : Extensions.getExtensions(WatchedRootsProvider.EP_NAME, myProject)) { + for (WatchedRootsProvider extension : WatchedRootsProvider.EP_NAME.getExtensions(myProject)) { recursive.addAll(extension.getRootsToWatch()); } diff --git a/platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java b/platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java index 79fface1978a..28e60071160f 100644 --- a/platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java +++ b/platform/lang-impl/src/com/intellij/psi/search/PredefinedSearchScopeProviderImpl.java @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi.search; import com.intellij.ide.IdeBundle; @@ -13,7 +13,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.SelectionModel; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.module.*; import com.intellij.openapi.project.Project; @@ -63,7 +62,7 @@ public class PredefinedSearchScopeProviderImpl extends PredefinedSearchScopeProv result.add(GlobalSearchScope.allScope(project)); } - for (SearchScopeProvider each : Extensions.getExtensions(SearchScopeProvider.EP, project)) { + for (SearchScopeProvider each : SearchScopeProvider.EP.getExtensions(project)) { result.addAll(each.getGeneralProjectScopes()); } diff --git a/platform/lang-impl/src/com/intellij/refactoring/listeners/impl/RefactoringListenerManagerImpl.java b/platform/lang-impl/src/com/intellij/refactoring/listeners/impl/RefactoringListenerManagerImpl.java index b286e6c0f535..b3276bc5e015 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/listeners/impl/RefactoringListenerManagerImpl.java +++ b/platform/lang-impl/src/com/intellij/refactoring/listeners/impl/RefactoringListenerManagerImpl.java @@ -1,22 +1,7 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.refactoring.listeners.impl; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.refactoring.listeners.RefactoringElementListenerProvider; import com.intellij.refactoring.listeners.RefactoringListenerManager; @@ -50,7 +35,7 @@ public class RefactoringListenerManagerImpl extends RefactoringListenerManager { public RefactoringTransaction startTransaction() { List providers = new ArrayList<>(myListenerProviders); - Collections.addAll(providers, Extensions.getExtensions(RefactoringElementListenerProvider.EP_NAME, myProject)); + Collections.addAll(providers, RefactoringElementListenerProvider.EP_NAME.getExtensions(myProject)); return new RefactoringTransactionImpl(myProject, providers); } } diff --git a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceUtil.java b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceUtil.java index b27f4eb43ba2..603f5a5fed13 100644 --- a/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceUtil.java +++ b/platform/lang-impl/src/com/intellij/unscramble/AnalyzeStacktraceUtil.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.unscramble; @@ -36,8 +22,7 @@ import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorFactory; import com.intellij.openapi.editor.EditorSettings; -import com.intellij.openapi.extensions.ExtensionPointName; -import com.intellij.openapi.extensions.Extensions; +import com.intellij.openapi.extensions.ProjectExtensionPointName; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Disposer; import com.intellij.openapi.util.text.StringUtil; @@ -54,7 +39,7 @@ import static com.intellij.openapi.application.ex.ClipboardUtil.getTextInClipboa * @author yole */ public class AnalyzeStacktraceUtil { - public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.analyzeStacktraceFilter"); + public static final ProjectExtensionPointName EP_NAME = new ProjectExtensionPointName<>("com.intellij.analyzeStacktraceFilter"); private AnalyzeStacktraceUtil() { } @@ -84,7 +69,7 @@ public class AnalyzeStacktraceUtil { String text, @Nullable Icon icon) { final TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project); - builder.filters(Extensions.getExtensions(EP_NAME, project)); + builder.filters(EP_NAME.getExtensions(project)); final ConsoleView consoleView = builder.getConsole(); final DefaultActionGroup toolbarActions = new DefaultActionGroup(); diff --git a/platform/platform-api/src/com/intellij/ide/SelectInManager.java b/platform/platform-api/src/com/intellij/ide/SelectInManager.java index 4fc89026a641..8b79ca3d61bd 100644 --- a/platform/platform-api/src/com/intellij/ide/SelectInManager.java +++ b/platform/platform-api/src/com/intellij/ide/SelectInManager.java @@ -2,7 +2,6 @@ package com.intellij.ide; import com.intellij.openapi.components.ServiceManager; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; import org.jetbrains.annotations.NonNls; @@ -51,7 +50,7 @@ public class SelectInManager { private void checkLoadExtensions() { if (!myLoadedExtensions) { myLoadedExtensions = true; - Collections.addAll(myTargets, Extensions.getExtensions(SelectInTarget.EP_NAME, myProject)); + Collections.addAll(myTargets, SelectInTarget.EP_NAME.getExtensions(myProject)); } } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/NonProjectFileWritingAccessProvider.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/NonProjectFileWritingAccessProvider.java index 494a59580985..d96c65a2dcf7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/NonProjectFileWritingAccessProvider.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/NonProjectFileWritingAccessProvider.java @@ -4,7 +4,6 @@ package com.intellij.openapi.fileEditor.impl; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.ex.IdeDocumentHistory; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; @@ -39,7 +38,7 @@ import java.util.stream.Stream; public class NonProjectFileWritingAccessProvider extends WritingAccessProvider { private static final Key ENABLE_IN_TESTS = Key.create("NON_PROJECT_FILE_ACCESS_ENABLE_IN_TESTS"); private static final Key HONOUR_RECENT_FILES_IN_TESTS = Key.create("NON_PROJECT_FILE_ACCESS_HONOUR_RECENT_FILES_IN_TESTS"); - + private static final NotNullLazyKey ACCESS_ALLOWED = NotNullLazyKey.create("NON_PROJECT_FILE_ACCESS", holder -> new AtomicInteger()); @@ -133,7 +132,7 @@ public class NonProjectFileWritingAccessProvider extends WritingAccessProvider { } private static boolean isProjectFile(@NotNull VirtualFile file, @NotNull Project project) { - for (NonProjectFileWritingAccessExtension each : Extensions.getExtensions(NonProjectFileWritingAccessExtension.EP_NAME, project)) { + for (NonProjectFileWritingAccessExtension each : NonProjectFileWritingAccessExtension.EP_NAME.getExtensions(project)) { if(each.isWritable(file)) return true; if(each.isNotWritable(file)) return false; } diff --git a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/FileDropHandler.java b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/FileDropHandler.java index 090968b27aa7..21f7ee971d68 100644 --- a/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/FileDropHandler.java +++ b/platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/FileDropHandler.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.fileEditor.impl.text; import com.intellij.ide.dnd.FileCopyPasteUtil; @@ -21,8 +7,10 @@ import com.intellij.openapi.editor.CustomFileDropHandler; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.EditorDropHandler; -import com.intellij.openapi.extensions.Extensions; -import com.intellij.openapi.fileEditor.*; +import com.intellij.openapi.fileEditor.FileDocumentManager; +import com.intellij.openapi.fileEditor.FileEditor; +import com.intellij.openapi.fileEditor.FileEditorManager; +import com.intellij.openapi.fileEditor.TextEditor; import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx; import com.intellij.openapi.fileEditor.impl.EditorWindow; import com.intellij.openapi.fileEditor.impl.EditorWithProviderComposite; @@ -59,7 +47,7 @@ public class FileDropHandler implements EditorDropHandler { if (project != null) { final List fileList = FileCopyPasteUtil.getFileList(t); if (fileList != null) { - boolean dropResult = ContainerUtil.process(Extensions.getExtensions(CustomFileDropHandler.CUSTOM_DROP_HANDLER_EP, project), + boolean dropResult = ContainerUtil.process(CustomFileDropHandler.CUSTOM_DROP_HANDLER_EP.getExtensions(project), handler -> !(handler.canHandle(t, myEditor) && handler.handleDrop(t, myEditor, project))); if (!dropResult) return; @@ -78,7 +66,7 @@ public class FileDropHandler implements EditorDropHandler { final FileEditorManagerEx fileEditorManager = (FileEditorManagerEx) FileEditorManager.getInstance(project); if (vFile != null) { NonProjectFileWritingAccessProvider.allowWriting(vFile); - + if (editorWindow != null) { fileEditorManager.openFileWithProviders(vFile, true, editorWindow); } diff --git a/platform/platform-impl/src/com/intellij/openapi/vcs/impl/FileStatusManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/vcs/impl/FileStatusManagerImpl.java index 4f23c17ea029..03a24d4b5add 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vcs/impl/FileStatusManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/vcs/impl/FileStatusManagerImpl.java @@ -15,7 +15,6 @@ import com.intellij.openapi.editor.colors.EditorColorsManager; import com.intellij.openapi.editor.colors.EditorColorsScheme; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.editor.event.DocumentListener; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.project.DumbAwareRunnable; import com.intellij.openapi.project.Project; @@ -53,7 +52,7 @@ public class FileStatusManagerImpl extends FileStatusManager implements ProjectC @NotNull @Override protected FileStatusProvider[] compute() { - return Extensions.getExtensions(FileStatusProvider.EP_NAME, myProject); + return FileStatusProvider.EP_NAME.getExtensions(myProject); } }; diff --git a/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/FileInfo.java b/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/FileInfo.java index 0d3f1d5f4533..d724d22a8391 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/FileInfo.java +++ b/platform/platform-impl/src/com/intellij/openapi/vcs/readOnlyHandler/FileInfo.java @@ -1,21 +1,6 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.readOnlyHandler; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.util.ListWithSelection; @@ -28,7 +13,7 @@ class FileInfo { myFile = file; myHandleType.add(HandleType.USE_FILE_SYSTEM); myHandleType.selectFirst(); - for(HandleTypeFactory factory: Extensions.getExtensions(HandleTypeFactory.EP_NAME, project)) { + for(HandleTypeFactory factory: HandleTypeFactory.EP_NAME.getExtensions(project)) { final HandleType handleType = factory.createHandleType(file); if (handleType != null) { myHandleType.add(handleType); diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java index d5330853529a..8a26ea8adb08 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeRootPane.java @@ -14,7 +14,6 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.ActionManagerEx; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Disposer; @@ -296,7 +295,7 @@ public class IdeRootPane extends JRootPane implements UISettingsListener, Dispos } void installNorthComponents(final Project project) { - ContainerUtil.addAll(myNorthComponents, Extensions.getExtensions(IdeRootPaneNorthExtension.EP_NAME, project)); + ContainerUtil.addAll(myNorthComponents, IdeRootPaneNorthExtension.EP_NAME.getExtensions(project)); for (IdeRootPaneNorthExtension northComponent : myNorthComponents) { myNorthPanel.add(northComponent.getComponent()); northComponent.uiSettingsChanged(UISettings.getInstance()); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ContentEntryImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ContentEntryImpl.java index 058d592449bc..e791d3d51c40 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ContentEntryImpl.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ContentEntryImpl.java @@ -1,23 +1,8 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.roots.impl; import com.intellij.openapi.Disposable; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.roots.ContentEntry; import com.intellij.openapi.roots.ContentFolder; import com.intellij.openapi.roots.ExcludeFolder; @@ -165,7 +150,7 @@ public class ContentEntryImpl extends RootModelComponentBase implements ContentE for (ExcludeFolder folder : myExcludeFolders) { excluded.add(folder.getUrl()); } - for (DirectoryIndexExcludePolicy excludePolicy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, getRootModel().getProject())) { + for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(getRootModel().getProject())) { for (VirtualFilePointer pointer : excludePolicy.getExcludeRootsForModule(getRootModel())) { excluded.add(pointer.getUrl()); } @@ -181,7 +166,7 @@ public class ContentEntryImpl extends RootModelComponentBase implements ContentE for (ExcludeFolder excludeFolder : getExcludeFolders()) { ContainerUtil.addIfNotNull(result, excludeFolder.getFile()); } - for (DirectoryIndexExcludePolicy excludePolicy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, getRootModel().getProject())) { + for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(getRootModel().getProject())) { for (VirtualFilePointer pointer : excludePolicy.getExcludeRootsForModule(getRootModel())) { ContainerUtil.addIfNotNull(result, pointer.getFile()); } diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexExcludePolicy.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexExcludePolicy.java index 54b30303106a..acfe0cddc59c 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexExcludePolicy.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexExcludePolicy.java @@ -1,24 +1,9 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.roots.impl; import com.intellij.openapi.extensions.AreaInstance; import com.intellij.openapi.extensions.ExtensionPointName; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.roots.ModuleRootModel; import com.intellij.openapi.vfs.VirtualFile; @@ -48,6 +33,6 @@ public interface DirectoryIndexExcludePolicy { @NotNull static DirectoryIndexExcludePolicy[] getExtensions(@NotNull AreaInstance areaInstance) { - return Extensions.getExtensions(EP_NAME, areaInstance); + return EP_NAME.getExtensions(areaInstance); } } diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerImpl.java index 5fbc7b6db93a..34d871661dfe 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerImpl.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerImpl.java @@ -8,7 +8,6 @@ import com.intellij.openapi.application.WriteAction; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.State; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.module.Module; import com.intellij.openapi.module.ModuleManager; import com.intellij.openapi.project.Project; @@ -223,7 +222,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Pers incModificationCount(); mergeRootsChangesDuring(() -> myProjectJdkEventDispatcher.getMulticaster().projectJdkChanged()); Sdk sdk = getProjectSdk(); - for (ProjectExtension extension : Extensions.getExtensions(ProjectExtension.EP_NAME, myProject)) { + for (ProjectExtension extension : ProjectExtension.EP_NAME.getExtensions(myProject)) { extension.projectSdkChanged(sdk); } } @@ -248,7 +247,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Pers @Override public void loadState(@NotNull Element element) { - for (ProjectExtension extension : Extensions.getExtensions(ProjectExtension.EP_NAME, myProject)) { + for (ProjectExtension extension : ProjectExtension.EP_NAME.getExtensions(myProject)) { extension.readExternal(element); } myProjectSdkName = element.getAttributeValue(PROJECT_JDK_NAME_ATTR); @@ -260,7 +259,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Pers public Element getState() { Element element = new Element("state"); element.setAttribute(ATTRIBUTE_VERSION, "2"); - for (ProjectExtension extension : Extensions.getExtensions(ProjectExtension.EP_NAME, myProject)) { + for (ProjectExtension extension : ProjectExtension.EP_NAME.getExtensions(myProject)) { extension.writeExternal(element); } if (myProjectSdkName != null) { diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java index 26320f9fe20b..d39a4fe9fed9 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java @@ -3,7 +3,6 @@ package com.intellij.openapi.roots.impl; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileTypes.FileTypeRegistry; import com.intellij.openapi.fileTypes.impl.FileTypeAssocTable; import com.intellij.openapi.module.Module; @@ -203,7 +202,7 @@ public class RootIndex { } } } - for (DirectoryIndexExcludePolicy policy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, project)) { + for (DirectoryIndexExcludePolicy policy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(project)) { info.excludedFromProject.addAll(ContainerUtil.filter(policy.getExcludeRootsForProject(), file -> ensureValid(file, policy))); Function> fun = policy.getExcludeSdkRootsStrategy(); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootModelImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootModelImpl.java index 546e28380bdc..7d7e3e30622d 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootModelImpl.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootModelImpl.java @@ -8,7 +8,6 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.PersistentStateComponentWithModificationTracker; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.module.Module; import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.Sdk; @@ -72,7 +71,7 @@ public class RootModelImpl extends RootModelBase implements ModifiableRootModel addSourceOrderEntries(); myModuleLibraryTable = new ModuleLibraryTable(this, myProjectRootManager); - for (ModuleExtension extension : Extensions.getExtensions(ModuleExtension.EP_NAME, moduleRootManager.getModule())) { + for (ModuleExtension extension : ModuleExtension.EP_NAME.getExtensions(moduleRootManager.getModule())) { ModuleExtension model = extension.getModifiableModel(false); registerOnDispose(model); myExtensions.add(model); diff --git a/platform/projectModel-impl/src/com/intellij/project/model/impl/module/content/JpsContentEntry.java b/platform/projectModel-impl/src/com/intellij/project/model/impl/module/content/JpsContentEntry.java index 18bea3a2cdb6..3ffb6488bb41 100644 --- a/platform/projectModel-impl/src/com/intellij/project/model/impl/module/content/JpsContentEntry.java +++ b/platform/projectModel-impl/src/com/intellij/project/model/impl/module/content/JpsContentEntry.java @@ -1,22 +1,7 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.project.model.impl.module.content; import com.intellij.openapi.Disposable; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.roots.ContentEntry; import com.intellij.openapi.roots.ContentFolder; import com.intellij.openapi.roots.ExcludeFolder; @@ -147,8 +132,7 @@ public class JpsContentEntry implements ContentEntry, Disposable { for (JpsExcludeFolder folder : myExcludeFolders) { excluded.add(folder.getUrl()); } - for (DirectoryIndexExcludePolicy excludePolicy : Extensions - .getExtensions(DirectoryIndexExcludePolicy.EP_NAME, myRootModel.getProject())) { + for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(myRootModel.getProject())) { for (VirtualFilePointer pointer : excludePolicy.getExcludeRootsForModule(myRootModel)) { excluded.add(pointer.getUrl()); } @@ -163,7 +147,7 @@ public class JpsContentEntry implements ContentEntry, Disposable { for (JpsExcludeFolder folder : myExcludeFolders) { ContainerUtil.addIfNotNull(excluded, folder.getFile()); } - for (DirectoryIndexExcludePolicy excludePolicy : Extensions.getExtensions(DirectoryIndexExcludePolicy.EP_NAME, myRootModel.getProject())) { + for (DirectoryIndexExcludePolicy excludePolicy : DirectoryIndexExcludePolicy.EP_NAME.getExtensions(myRootModel.getProject())) { for (VirtualFilePointer pointer : excludePolicy.getExcludeRootsForModule(myRootModel)) { ContainerUtil.addIfNotNull(excluded, pointer.getFile()); } diff --git a/platform/tasks-platform-impl/src/com/intellij/tasks/context/ProjectViewContextProvider.java b/platform/tasks-platform-impl/src/com/intellij/tasks/context/ProjectViewContextProvider.java index b9c1306fc94c..49716be343ed 100644 --- a/platform/tasks-platform-impl/src/com/intellij/tasks/context/ProjectViewContextProvider.java +++ b/platform/tasks-platform-impl/src/com/intellij/tasks/context/ProjectViewContextProvider.java @@ -1,23 +1,8 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.tasks.context; import com.intellij.ide.projectView.impl.AbstractProjectViewPane; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.WriteExternalException; @@ -35,7 +20,7 @@ public class ProjectViewContextProvider extends WorkingContextProvider { private final AbstractProjectViewPane[] myPanes; public ProjectViewContextProvider(Project project) { - myPanes = Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, project); + myPanes = AbstractProjectViewPane.EP_NAME.getExtensions(project); } @NotNull diff --git a/platform/tasks-platform-impl/src/com/intellij/tasks/context/WorkingContextManager.java b/platform/tasks-platform-impl/src/com/intellij/tasks/context/WorkingContextManager.java index 4bc126fd205d..50d14b37f426 100644 --- a/platform/tasks-platform-impl/src/com/intellij/tasks/context/WorkingContextManager.java +++ b/platform/tasks-platform-impl/src/com/intellij/tasks/context/WorkingContextManager.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.tasks.context; @@ -22,7 +8,6 @@ import com.intellij.notification.Notifications; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.InvalidDataException; import com.intellij.openapi.util.WriteExternalException; @@ -73,7 +58,7 @@ public class WorkingContextManager { } public void loadContext(Element fromElement) { - for (WorkingContextProvider provider : Extensions.getExtensions(WorkingContextProvider.EP_NAME, myProject)) { + for (WorkingContextProvider provider : WorkingContextProvider.EP_NAME.getExtensions(myProject)) { try { Element child = fromElement.getChild(provider.getId()); if (child != null) { @@ -87,7 +72,7 @@ public class WorkingContextManager { } public void saveContext(Element toElement) { - for (WorkingContextProvider provider : Extensions.getExtensions(WorkingContextProvider.EP_NAME, myProject)) { + for (WorkingContextProvider provider : WorkingContextProvider.EP_NAME.getExtensions(myProject)) { try { Element child = new Element(provider.getId()); provider.saveContext(child); @@ -100,7 +85,7 @@ public class WorkingContextManager { } public void clearContext() { - for (WorkingContextProvider provider : Extensions.getExtensions(WorkingContextProvider.EP_NAME, myProject)) { + for (WorkingContextProvider provider : WorkingContextProvider.EP_NAME.getExtensions(myProject)) { provider.clearContext(); } } diff --git a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java index 9de8e15e181f..8ad1e27848cf 100644 --- a/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java +++ b/platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java @@ -13,7 +13,6 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.util.ProgressIndicatorUtils; import com.intellij.openapi.progress.util.ProgressWrapper; @@ -541,7 +540,7 @@ public class UsageViewImpl implements UsageViewEx { } }; - UsageContextPanel.Provider[] extensions = Extensions.getExtensions(UsageContextPanel.Provider.EP_NAME, myProject); + UsageContextPanel.Provider[] extensions = UsageContextPanel.Provider.EP_NAME.getExtensions(myProject); myUsageContextPanelProviders = ContainerUtil.filter(extensions, provider -> provider.isAvailableFor(this)); Map components = new LinkedHashMap<>(); for (UsageContextPanel.Provider provider : myUsageContextPanelProviders) { diff --git a/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/UnifiedDiffWriter.java b/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/UnifiedDiffWriter.java index 0f2cd5625a27..8f40ebdd330c 100644 --- a/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/UnifiedDiffWriter.java +++ b/platform/vcs-api/vcs-api-core/src/com/intellij/openapi/diff/impl/patch/UnifiedDiffWriter.java @@ -1,28 +1,12 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.diff.impl.patch; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.changes.CommitContext; import com.intellij.util.ObjectUtils; -import java.util.HashMap; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -32,6 +16,7 @@ import java.io.IOException; import java.io.Writer; import java.text.MessageFormat; import java.util.Collection; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -54,7 +39,7 @@ public class UnifiedDiffWriter { @NotNull public static PatchEP[] getPatchExtensions(@Nullable Project project) { - return project == null ? new PatchEP[0] : Extensions.getExtensions(PatchEP.EP_NAME, project); + return project == null ? new PatchEP[0] : PatchEP.EP_NAME.getExtensions(project); } public static void write(@Nullable Project project, Collection patches, Writer writer, final String lineSeparator, diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java index 5c16c00aeb28..d28f383ec5f7 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDefaultExecutor.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2011 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.changes.patch; import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; @@ -20,7 +6,6 @@ import com.intellij.openapi.diff.impl.patch.FilePatch; import com.intellij.openapi.diff.impl.patch.PatchEP; import com.intellij.openapi.diff.impl.patch.PatchSyntaxException; import com.intellij.openapi.diff.impl.patch.formove.PatchApplier; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.util.ThrowableComputable; @@ -79,7 +64,7 @@ public class ApplyPatchDefaultExecutor implements ApplyPatchExecutor>, PatchSyntaxException> additionalInfo, @Nullable CommitContext commitContext) { - final PatchEP[] extensions = Extensions.getExtensions(PatchEP.EP_NAME, project); + final PatchEP[] extensions = PatchEP.EP_NAME.getExtensions(project); if (extensions.length == 0 || additionalInfo == null) return; try { Map> additionalInfoMap = additionalInfo.compute(); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/PatchWriter.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/PatchWriter.java index e495d34895e1..edd098e69975 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/PatchWriter.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/PatchWriter.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2011 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.changes.patch; import com.intellij.application.options.CodeStyle; @@ -20,7 +6,6 @@ import com.intellij.openapi.diff.impl.patch.BinaryFilePatch; import com.intellij.openapi.diff.impl.patch.FilePatch; import com.intellij.openapi.diff.impl.patch.PatchEP; import com.intellij.openapi.diff.impl.patch.UnifiedDiffWriter; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.ide.CopyPasteManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.changes.Change; @@ -69,7 +54,7 @@ public class PatchWriter { @Nullable CommitContext commitContext, boolean includeBinaries) throws IOException { final String lineSeparator = CodeStyle.getSettings(project).getLineSeparator(); UnifiedDiffWriter - .write(project, basePath, patches, writer, lineSeparator, Extensions.getExtensions(PatchEP.EP_NAME, project), commitContext); + .write(project, basePath, patches, writer, lineSeparator, PatchEP.EP_NAME.getExtensions(project), commitContext); if (includeBinaries) { BinaryPatchWriter.writeBinaries(basePath, ContainerUtil.findAll(patches, BinaryFilePatch.class), writer); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java index 321a888f3783..1033ea0e735c 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java @@ -14,7 +14,6 @@ import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.DataProvider; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; @@ -443,7 +442,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj updateOnListSelection(); myCommitMessageArea.requestFocusInMessage(); - for (EditChangelistSupport support : Extensions.getExtensions(EditChangelistSupport.EP_NAME, project)) { + for (EditChangelistSupport support : EditChangelistSupport.EP_NAME.getExtensions(project)) { support.installSearch(myCommitMessageArea.getEditorField(), myCommitMessageArea.getEditorField()); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java index 90b86d94fd07..033c805b2e63 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java @@ -4,7 +4,6 @@ package com.intellij.openapi.vcs.changes.ui; import com.intellij.openapi.editor.SpellCheckingEditorCustomizationProvider; import com.intellij.openapi.editor.event.DocumentEvent; import com.intellij.openapi.editor.event.DocumentListener; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileTypes.FileTypes; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.VcsBundle; @@ -94,7 +93,7 @@ public abstract class NewEditChangelistPanel extends JPanel { public void init(final LocalChangeList initial) { myMakeActiveCheckBox.setSelected(VcsConfiguration.getInstance(myProject).MAKE_NEW_CHANGELIST_ACTIVE); - for (EditChangelistSupport support : Extensions.getExtensions(EditChangelistSupport.EP_NAME, myProject)) { + for (EditChangelistSupport support : EditChangelistSupport.EP_NAME.getExtensions(myProject)) { support.installSearch(myNameTextField, myDescriptionTextArea); myConsumer = support.addControls(myAdditionalControlsPanel, initial); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/AllVcses.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/AllVcses.java index 5da617116923..4ee2235d9798 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/AllVcses.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/projectlevelman/AllVcses.java @@ -4,7 +4,6 @@ package com.intellij.openapi.vcs.impl.projectlevelman; import com.intellij.openapi.Disposable; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.AbstractVcs; import com.intellij.openapi.vcs.VcsException; @@ -28,7 +27,7 @@ public class AllVcses implements AllVcsesI, Disposable { myVcses = new HashMap<>(); myLock = new Object(); - final VcsEP[] vcsEPs = Extensions.getExtensions(VcsEP.EP_NAME, myProject); + final VcsEP[] vcsEPs = VcsEP.EP_NAME.getExtensions(myProject); final HashMap map = new HashMap<>(); for (VcsEP vcsEP : vcsEPs) { map.put(vcsEP.name, vcsEP); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/history/FileHistoryUi.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/history/FileHistoryUi.java index f2e0ec6dc313..342416b1c3ed 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/history/FileHistoryUi.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/history/FileHistoryUi.java @@ -1,22 +1,7 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.vcs.log.history; import com.google.common.util.concurrent.SettableFuture; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.Conditions; import com.intellij.openapi.vcs.FilePath; @@ -85,7 +70,7 @@ public class FileHistoryUi extends AbstractVcsLogUi { ? ContainerUtil.newHashSet(MyCommitsHighlighter.Factory.ID, CurrentBranchHighlighter.Factory.ID) : Collections.singleton(MyCommitsHighlighter.Factory.ID); - for (VcsLogHighlighterFactory factory : ContainerUtil.filter(Extensions.getExtensions(LOG_HIGHLIGHTER_FACTORY_EP, myProject), + for (VcsLogHighlighterFactory factory : ContainerUtil.filter(LOG_HIGHLIGHTER_FACTORY_EP.getExtensions(myProject), f -> isHighlighterEnabled(f.getId()))) { getTable().addHighlighter(factory.createHighlighter(logData, this)); } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java index 89b34791a611..e5c1c5916ef9 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsLogManager.java @@ -4,7 +4,6 @@ package com.intellij.vcs.log.impl; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.util.Disposer; @@ -143,7 +142,7 @@ public class VcsLogManager implements Disposable { @NotNull public static Map findLogProviders(@NotNull Collection roots, @NotNull Project project) { Map logProviders = ContainerUtil.newHashMap(); - VcsLogProvider[] allLogProviders = Extensions.getExtensions(VcsLogProvider.LOG_PROVIDER_EP, project); + VcsLogProvider[] allLogProviders = VcsLogProvider.LOG_PROVIDER_EP.getExtensions(project); for (VcsRoot root: roots) { AbstractVcs vcs = root.getVcs(); VirtualFile path = root.getPath(); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/statistics/VcsLogFeaturesCollector.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/statistics/VcsLogFeaturesCollector.java index f375689dfd79..113fb8b86465 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/statistics/VcsLogFeaturesCollector.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/statistics/VcsLogFeaturesCollector.java @@ -5,7 +5,6 @@ import com.intellij.internal.statistic.beans.UsageDescriptor; import com.intellij.internal.statistic.service.fus.collectors.ProjectUsagesCollector; import com.intellij.internal.statistic.service.fus.collectors.UsageDescriptorKeyValidator; import com.intellij.internal.statistic.utils.StatisticsUtilKt; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.util.containers.ContainerUtil; import com.intellij.vcs.log.graph.PermanentGraph; @@ -53,7 +52,7 @@ public class VcsLogFeaturesCollector extends ProjectUsagesCollector { usages.add(StatisticsUtilKt.getBooleanUsage("textFilter.regex", properties.get(TEXT_FILTER_REGEX))); usages.add(StatisticsUtilKt.getBooleanUsage("textFilter.matchCase", properties.get(TEXT_FILTER_MATCH_CASE))); - for (VcsLogHighlighterFactory factory : Extensions.getExtensions(LOG_HIGHLIGHTER_FACTORY_EP, project)) { + for (VcsLogHighlighterFactory factory : LOG_HIGHLIGHTER_FACTORY_EP.getExtensions(project)) { if (factory.showMenuItem()) { VcsLogHighlighterProperty property = VcsLogHighlighterProperty.get(factory.getId()); usages.add(StatisticsUtilKt.getBooleanUsage("highlighter." + UsageDescriptorKeyValidator.ensureProperKey(factory.getId()), diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java index 6b6f59782c90..3826e7ee5071 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/VcsLogUiImpl.java @@ -1,8 +1,8 @@ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.vcs.log.ui; import com.google.common.util.concurrent.SettableFuture; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.util.NamedRunnable; @@ -47,7 +47,7 @@ public class VcsLogUiImpl extends AbstractVcsLogUi { myUiProperties = uiProperties; myMainFrame = new MainFrame(logData, this, uiProperties, myLog, myVisiblePack); - for (VcsLogHighlighterFactory factory : Extensions.getExtensions(LOG_HIGHLIGHTER_FACTORY_EP, myProject)) { + for (VcsLogHighlighterFactory factory : LOG_HIGHLIGHTER_FACTORY_EP.getExtensions(myProject)) { getTable().addHighlighter(factory.createHighlighter(logData, this)); } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/actions/HighlightersActionGroup.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/actions/HighlightersActionGroup.java index ce3118d34337..8b8ce4fd5e80 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/actions/HighlightersActionGroup.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/actions/HighlightersActionGroup.java @@ -1,25 +1,10 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.vcs.log.ui.actions; import com.intellij.openapi.actionSystem.ActionGroup; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.Separator; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.DumbAware; import com.intellij.util.containers.ContainerUtil; import com.intellij.vcs.log.impl.VcsLogUiProperties; @@ -42,7 +27,7 @@ public class HighlightersActionGroup extends ActionGroup implements DumbAware { if (e != null) { if (e.getData(VcsLogInternalDataKeys.LOG_UI_PROPERTIES) != null) { actions.add(new Separator("Highlight")); - for (VcsLogHighlighterFactory factory : Extensions.getExtensions(AbstractVcsLogUi.LOG_HIGHLIGHTER_FACTORY_EP, e.getProject())) { + for (VcsLogHighlighterFactory factory : AbstractVcsLogUi.LOG_HIGHLIGHTER_FACTORY_EP.getExtensions(e.getProject())) { if (factory.showMenuItem()) { actions.add(new EnableHighlighterAction(factory)); } diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/style/BoundedWildcardInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/style/BoundedWildcardInspection.java index e2fb6fed42ed..30d8cab4c66c 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/style/BoundedWildcardInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/style/BoundedWildcardInspection.java @@ -9,7 +9,6 @@ import com.intellij.ide.util.SuperMethodWarningUtil; import com.intellij.openapi.application.TransactionGuard; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; @@ -390,7 +389,7 @@ public class BoundedWildcardInspection extends AbstractBaseJavaLocalInspectionTo private static boolean errorChecks(@NotNull PsiElement method, @NotNull List elementsToIgnore) { - HighlightVisitor visitor = ContainerUtil.find(Extensions.getExtensions(HighlightVisitor.EP_HIGHLIGHT_VISITOR, method.getProject()), h -> h instanceof HighlightVisitorImpl).clone(); + HighlightVisitor visitor = ContainerUtil.find(HighlightVisitor.EP_HIGHLIGHT_VISITOR.getExtensions(method.getProject()), h -> h instanceof HighlightVisitorImpl).clone(); HighlightInfoHolder holder = new HighlightInfoHolder(method.getContainingFile()); visitor.analyze(method.getContainingFile(), false, holder, ()->{ method.accept(new PsiRecursiveElementWalkingVisitor() { diff --git a/plugins/coverage-common/src/com/intellij/coverage/CoverageOptionsConfigurable.java b/plugins/coverage-common/src/com/intellij/coverage/CoverageOptionsConfigurable.java index b7f3b0a29857..094ec85aa9c9 100644 --- a/plugins/coverage-common/src/com/intellij/coverage/CoverageOptionsConfigurable.java +++ b/plugins/coverage-common/src/com/intellij/coverage/CoverageOptionsConfigurable.java @@ -1,21 +1,6 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.coverage; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.SearchableConfigurable; import com.intellij.openapi.project.Project; @@ -97,7 +82,7 @@ public class CoverageOptionsConfigurable implements SearchableConfigurable { @NotNull private CoverageOptions[] getExtensions() { - return Extensions.getExtensions(CoverageOptions.EP_NAME, myProject); + return CoverageOptions.EP_NAME.getExtensions(myProject); } @Override diff --git a/plugins/git4idea/tests/git4idea/test/GitTestUtil.kt b/plugins/git4idea/tests/git4idea/test/GitTestUtil.kt index 0bebb766b02f..8712c560aad3 100644 --- a/plugins/git4idea/tests/git4idea/test/GitTestUtil.kt +++ b/plugins/git4idea/tests/git4idea/test/GitTestUtil.kt @@ -1,24 +1,9 @@ -/* - * Copyright 2000-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. @file:JvmName("GitTestUtil") package git4idea.test import com.intellij.dvcs.push.PushSpec -import com.intellij.openapi.extensions.Extensions import com.intellij.openapi.project.Project import com.intellij.openapi.vcs.Executor.* import com.intellij.openapi.vcs.ProjectLevelVcsManager @@ -126,13 +111,13 @@ fun registerRepo(project: Project, root: String): GitRepository { val file = LocalFileSystem.getInstance().findFileByIoFile(File(root)) assertFalse(vcsManager.allVcsRoots.isEmpty()) val repository = GitUtil.getRepositoryManager(project).getRepositoryForRoot(file) - assertNotNull("Couldn't find repository for root " + root, repository) + assertNotNull("Couldn't find repository for root $root", repository) return repository!! } fun assumeSupportedGitVersion(vcs: GitVcs) { val version = vcs.version - assumeTrue("Unsupported Git version: " + version, version.isSupported) + assumeTrue("Unsupported Git version: $version", version.isSupported) } fun GitPlatformTest.readAllRefs(root: VirtualFile, objectsFactory: VcsLogObjectsFactory): Set { @@ -151,7 +136,7 @@ fun GitPlatformTest.makeCommit(file: String): String { } fun findGitLogProvider(project: Project): GitLogProvider { - val providers = Extensions.getExtensions(VcsLogProvider.LOG_PROVIDER_EP, project) + val providers = VcsLogProvider.LOG_PROVIDER_EP.getExtensions(project) .filter { provider -> provider.supportedVcs == GitVcs.getKey() } assertEquals("Incorrect number of GitLogProviders", 1, providers.size) return providers[0] as GitLogProvider diff --git a/plugins/gradle/java/src/service/GradleBuildClasspathManager.java b/plugins/gradle/java/src/service/GradleBuildClasspathManager.java index 76c2dfc09764..9fad41e95ed8 100644 --- a/plugins/gradle/java/src/service/GradleBuildClasspathManager.java +++ b/plugins/gradle/java/src/service/GradleBuildClasspathManager.java @@ -1,10 +1,7 @@ -/* - * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.gradle.service; import com.intellij.openapi.components.ServiceManager; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.externalSystem.ExternalSystemManager; import com.intellij.openapi.externalSystem.model.project.ExternalModuleBuildClasspathPojo; import com.intellij.openapi.externalSystem.model.project.ExternalProjectBuildClasspathPojo; @@ -88,7 +85,7 @@ public class GradleBuildClasspathManager { set.addAll(virtualFiles); } allFilesCache = ContainerUtil.newArrayList(set); - for (PsiElementFinder finder : Extensions.getExtensions(PsiElementFinder.EP_NAME, myProject)) { + for (PsiElementFinder finder : PsiElementFinder.EP_NAME.getExtensions(myProject)) { if (finder instanceof GradleClassFinder) { ((GradleClassFinder)finder).clearCache(); break; diff --git a/plugins/hg4idea/testSrc/hg4idea/test/log/HgUserFilterTest.java b/plugins/hg4idea/testSrc/hg4idea/test/log/HgUserFilterTest.java index 060ecdfdb4e9..300dfcbd30ad 100644 --- a/plugins/hg4idea/testSrc/hg4idea/test/log/HgUserFilterTest.java +++ b/plugins/hg4idea/testSrc/hg4idea/test/log/HgUserFilterTest.java @@ -1,7 +1,6 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package hg4idea.test.log; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.util.containers.ContainerUtil; import com.intellij.vcs.log.VcsLogProvider; @@ -77,7 +76,7 @@ public class HgUserFilterTest extends HgPlatformTest { public static HgLogProvider findLogProvider(@NotNull Project project) { List providers = - ContainerUtil.filter(Extensions.getExtensions(VcsLogProvider.LOG_PROVIDER_EP, project), + ContainerUtil.filter(VcsLogProvider.LOG_PROVIDER_EP.getExtensions(project), provider -> provider.getSupportedVcs().equals(HgVcs.getKey())); TestCase.assertEquals("Incorrect number of HgLogProviders", 1, providers.size()); return (HgLogProvider)providers.get(0); diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/ShareDialog.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/ShareDialog.java index 266852404d20..9212121ab0c2 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/ShareDialog.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/ShareDialog.java @@ -4,7 +4,6 @@ package org.jetbrains.idea.svn.dialogs; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.ActionPopupMenu; import com.intellij.openapi.actionSystem.DefaultActionGroup; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vcs.changes.ChangeListManager; @@ -233,7 +232,7 @@ public class ShareDialog extends RepositoryBrowserDialog { myCommitMessage.setText(text); panel.add(myCommitMessage, gb); myCommitMessage.setSeparatorText("Commit Comment Prefix"); - for (EditChangelistSupport support : Extensions.getExtensions(EditChangelistSupport.EP_NAME, project)) { + for (EditChangelistSupport support : EditChangelistSupport.EP_NAME.getExtensions(project)) { support.installSearch(myCommitMessage.getEditorField(), myCommitMessage.getEditorField()); } diff --git a/plugins/ui-designer/src/com/intellij/ide/palette/impl/PaletteWindow.java b/plugins/ui-designer/src/com/intellij/ide/palette/impl/PaletteWindow.java index 2dc01d0252f6..385353a074cd 100644 --- a/plugins/ui-designer/src/com/intellij/ide/palette/impl/PaletteWindow.java +++ b/plugins/ui-designer/src/com/intellij/ide/palette/impl/PaletteWindow.java @@ -7,7 +7,6 @@ import com.intellij.ide.palette.PaletteItem; import com.intellij.ide.palette.PaletteItemProvider; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.ui.PopupHandler; @@ -64,7 +63,7 @@ public class PaletteWindow extends JPanel implements LightToolWindowContent, Dat public PaletteWindow(Project project) { myProject = project; - myProviders = Extensions.getExtensions(PaletteItemProvider.EP_NAME, project); + myProviders = PaletteItemProvider.EP_NAME.getExtensions(project); setLayout(new GridLayout(1, 1)); myScrollPane.addMouseListener(new MyScrollPanePopupHandler()); diff --git a/python/educational-python/src/com/jetbrains/python/edu/PyCharmEduInitialConfigurator.java b/python/educational-python/src/com/jetbrains/python/edu/PyCharmEduInitialConfigurator.java index 329f83b7bbb2..0e9ecaa44e91 100644 --- a/python/educational-python/src/com/jetbrains/python/edu/PyCharmEduInitialConfigurator.java +++ b/python/educational-python/src/com/jetbrains/python/edu/PyCharmEduInitialConfigurator.java @@ -341,14 +341,14 @@ public class PyCharmEduInitialConfigurator { ExtensionsArea projectArea = Extensions.getArea(project); - for (SelectInTarget target : Extensions.getExtensions(SelectInTarget.EP_NAME, project)) { + for (SelectInTarget target : SelectInTarget.EP_NAME.getExtensions(project)) { if (ToolWindowId.FAVORITES_VIEW.equals(target.getToolWindowId()) || ToolWindowId.STRUCTURE_VIEW.equals(target.getToolWindowId())) { projectArea.getExtensionPoint(SelectInTarget.EP_NAME).unregisterExtension(target); } } - for (AbstractProjectViewPane pane : Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, project)) { + for (AbstractProjectViewPane pane : AbstractProjectViewPane.EP_NAME.getExtensions(project)) { if (pane.getId().equals(ScopeViewPane.ID)) { Disposer.dispose(pane); projectArea.getExtensionPoint(AbstractProjectViewPane.EP_NAME).unregisterExtension(pane); diff --git a/python/src/com/jetbrains/python/testing/PyRerunFailedTestsAction.java b/python/src/com/jetbrains/python/testing/PyRerunFailedTestsAction.java index 6f6839588989..1c4aea66b2f4 100644 --- a/python/src/com/jetbrains/python/testing/PyRerunFailedTestsAction.java +++ b/python/src/com/jetbrains/python/testing/PyRerunFailedTestsAction.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.testing; import com.intellij.execution.ExecutionException; @@ -129,7 +115,6 @@ public class PyRerunFailedTestsAction extends AbstractRerunFailedTestsAction { @NotNull @Override protected List getTestSpecs() { - final List, AbstractTestProxy>> failedTestLocations = new ArrayList<>(); final List failedTests = getFailedTests(myProject); for (final AbstractTestProxy failedTest : failedTests) { diff --git a/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsXmlWrapper.java b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsXmlWrapper.java index 4d87fc813aaa..d2e3d6ad052d 100644 --- a/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsXmlWrapper.java +++ b/xml/impl/src/com/intellij/xml/breadcrumbs/BreadcrumbsXmlWrapper.java @@ -16,7 +16,6 @@ import com.intellij.openapi.editor.ex.EditorGutterComponentEx; import com.intellij.openapi.editor.impl.ComplementaryFontsRegistry; import com.intellij.openapi.editor.markup.RangeHighlighter; import com.intellij.openapi.editor.markup.TextAttributes; -import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.util.ProgressIndicatorBase; @@ -167,7 +166,7 @@ public class BreadcrumbsXmlWrapper extends JComponent implements Disposable { } private FileBreadcrumbsCollector findBreadcrumbsCollector() { - for (FileBreadcrumbsCollector extension : Extensions.getExtensions(FileBreadcrumbsCollector.EP_NAME, myProject)) { + for (FileBreadcrumbsCollector extension : FileBreadcrumbsCollector.EP_NAME.getExtensions(myProject)) { if (extension.handlesFile(myFile)) { return extension; }