diff --git a/java/compiler/impl/src/com/intellij/compiler/chainsSearch/context/ChainCompletionContext.java b/java/compiler/impl/src/com/intellij/compiler/chainsSearch/context/ChainCompletionContext.java index 1997981dec30..47634bab5de5 100644 --- a/java/compiler/impl/src/com/intellij/compiler/chainsSearch/context/ChainCompletionContext.java +++ b/java/compiler/impl/src/com/intellij/compiler/chainsSearch/context/ChainCompletionContext.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-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. package com.intellij.compiler.chainsSearch.context; import com.intellij.compiler.CompilerReferenceService; @@ -22,11 +8,14 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.psi.*; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.ElementClassHint; +import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.scope.util.PsiScopesUtil; import com.intellij.psi.search.GlobalSearchScope; -import com.intellij.psi.util.*; +import com.intellij.psi.util.ClassUtil; +import com.intellij.psi.util.PropertyUtilBase; +import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.psi.util.PsiUtil; import com.intellij.util.SmartList; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.containers.FactoryMap; @@ -225,7 +214,7 @@ public class ChainCompletionContext { return result; } - private static class ContextProcessor extends BaseScopeProcessor implements ElementClassHint { + private static class ContextProcessor implements PsiScopeProcessor, ElementClassHint { private final List myContextElements = new SmartList<>(); private final PsiVariable myCompletionVariable; private final PsiResolveHelper myResolveHelper; @@ -273,7 +262,7 @@ public class ChainCompletionContext { //noinspection unchecked return (T)this; } - return super.getHint(hintKey); + return null; } @NotNull diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/BasicExpressionCompletionContributor.java b/java/java-impl/src/com/intellij/codeInsight/completion/BasicExpressionCompletionContributor.java index c5fe8849a0df..7039bff35775 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/BasicExpressionCompletionContributor.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/BasicExpressionCompletionContributor.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-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. package com.intellij.codeInsight.completion; import com.intellij.codeInsight.guess.GuessManager; @@ -27,7 +13,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.*; import com.intellij.psi.filters.getters.ClassLiteralGetter; import com.intellij.psi.filters.getters.ThisGetter; -import com.intellij.psi.scope.BaseScopeProcessor; +import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.scope.util.PsiScopesUtil; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.util.Consumer; @@ -100,7 +86,7 @@ public class BasicExpressionCompletionContributor { return; } - PsiScopesUtil.treeWalkUp(new BaseScopeProcessor() { + PsiScopesUtil.treeWalkUp(new PsiScopeProcessor() { @Override public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) { if (element instanceof PsiLocalVariable) { diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionUtil.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionUtil.java index 9b801761672c..b2919bf268b8 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionUtil.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionUtil.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-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. package com.intellij.codeInsight.completion; import com.intellij.codeInsight.*; @@ -45,7 +31,6 @@ import com.intellij.psi.impl.FakePsiElement; import com.intellij.psi.impl.light.LightVariableBuilder; import com.intellij.psi.impl.source.PostprocessReformattingAspect; import com.intellij.psi.impl.source.PsiImmediateClassType; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.ElementClassHint; import com.intellij.psi.scope.NameHint; import com.intellij.psi.scope.PsiScopeProcessor; @@ -206,7 +191,7 @@ public class JavaCompletionUtil { @Nullable public static PsiType getQualifiedMemberReferenceType(@Nullable PsiType qualifierType, @NotNull final PsiMember member) { final Ref subst = Ref.create(PsiSubstitutor.EMPTY); - class MyProcessor extends BaseScopeProcessor implements NameHint, ElementClassHint { + class MyProcessor implements PsiScopeProcessor, NameHint, ElementClassHint { @Override public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) { if (element == member) { diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/scope/JavaCompletionProcessor.java b/java/java-impl/src/com/intellij/codeInsight/completion/scope/JavaCompletionProcessor.java index d285e41162c4..25b137b3ce15 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/scope/JavaCompletionProcessor.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/scope/JavaCompletionProcessor.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-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. package com.intellij.codeInsight.completion.scope; import com.intellij.codeInspection.SuppressManager; @@ -26,9 +12,9 @@ import com.intellij.psi.filters.ElementFilter; import com.intellij.psi.impl.light.LightMethodBuilder; import com.intellij.psi.impl.source.resolve.JavaResolveUtil; import com.intellij.psi.infos.CandidateInfo; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.ElementClassHint; import com.intellij.psi.scope.JavaScopeProcessorEvent; +import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiTypesUtil; import com.intellij.psi.util.PsiUtil; @@ -41,7 +27,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Map; import java.util.Set; -public class JavaCompletionProcessor extends BaseScopeProcessor implements ElementClassHint { +public class JavaCompletionProcessor implements PsiScopeProcessor, ElementClassHint { private final boolean myInJavaDoc; private boolean myStatic; @@ -325,7 +311,7 @@ public class JavaCompletionProcessor extends BaseScopeProcessor implements Eleme return (T)myMatcher; } - return super.getHint(hintKey); + return null; } public static class Options { diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RenameWrongRefFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RenameWrongRefFix.java index 6ba69f84bd61..b99c9c1ab8ce 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RenameWrongRefFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RenameWrongRefFix.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-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. package com.intellij.codeInsight.daemon.impl.quickfix; @@ -29,7 +15,7 @@ import com.intellij.openapi.editor.ex.util.EditorUtil; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.TextRange; import com.intellij.psi.*; -import com.intellij.psi.scope.BaseScopeProcessor; +import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiUtilCore; import org.jetbrains.annotations.NonNls; @@ -92,7 +78,7 @@ public class RenameWrongRefFix implements IntentionAction { items.add(LookupElementBuilder.create(var.getName())); } } else { - class MyScopeProcessor extends BaseScopeProcessor { + class MyScopeProcessor implements PsiScopeProcessor { ArrayList myResult = new ArrayList<>(); boolean myFilterMethods; boolean myFilterStatics; diff --git a/java/java-impl/src/com/intellij/psi/AbstractQualifiedReference.java b/java/java-impl/src/com/intellij/psi/AbstractQualifiedReference.java index bbb9e5d05005..5de24b4712d1 100644 --- a/java/java-impl/src/com/intellij/psi/AbstractQualifiedReference.java +++ b/java/java-impl/src/com/intellij/psi/AbstractQualifiedReference.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-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. package com.intellij.psi; import com.intellij.extapi.psi.ASTWrapperPsiElement; @@ -24,7 +10,6 @@ import com.intellij.psi.impl.source.resolve.JavaResolveUtil; import com.intellij.psi.impl.source.resolve.ResolveCache; import com.intellij.psi.meta.PsiMetaData; import com.intellij.psi.meta.PsiMetaOwner; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.JavaScopeProcessorEvent; import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.scope.util.PsiScopesUtil; @@ -245,7 +230,7 @@ public abstract class AbstractQualifiedReference myResults = new LinkedHashSet<>(); @@ -269,7 +254,6 @@ public abstract class AbstractQualifiedReference myFieldResults = new SmartList<>(); @@ -96,7 +82,7 @@ public class StaticImportResolveProcessor extends BaseScopeProcessor implements //noinspection unchecked return (T)this; } - return super.getHint(hintKey); + return null; } @NotNull diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/SymbolCollectingProcessor.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/SymbolCollectingProcessor.java index 221b275f91b9..debf5b7f798c 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/SymbolCollectingProcessor.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/SymbolCollectingProcessor.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-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. package com.intellij.psi.impl.source.resolve; import com.intellij.openapi.util.Key; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiNamedElement; import com.intellij.psi.ResolveState; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.ElementClassHint; import com.intellij.psi.scope.JavaScopeProcessorEvent; import com.intellij.psi.scope.PsiScopeProcessor; @@ -30,7 +15,7 @@ import org.jetbrains.annotations.Nullable; /** * @author max */ -public class SymbolCollectingProcessor extends BaseScopeProcessor implements ElementClassHint { +public class SymbolCollectingProcessor implements PsiScopeProcessor, ElementClassHint { private final MostlySingularMultiMap myResult = new MostlySingularMultiMap<>(); private PsiElement myCurrentFileContext; diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCodeBlockImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCodeBlockImpl.java index cb9421a19a39..a267e1243166 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCodeBlockImpl.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiCodeBlockImpl.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-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. package com.intellij.psi.impl.source.tree.java; import com.intellij.lang.ASTNode; @@ -23,7 +9,6 @@ import com.intellij.openapi.util.Ref; import com.intellij.psi.*; import com.intellij.psi.impl.PsiImplUtil; import com.intellij.psi.impl.source.tree.*; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.ElementClassHint; import com.intellij.psi.scope.NameHint; import com.intellij.psi.scope.PsiScopeProcessor; @@ -100,7 +85,7 @@ public class PsiCodeBlockImpl extends LazyParseablePsiElement implements PsiCode final Set localsSet = new THashSet<>(); final Set classesSet = new THashSet<>(); final Ref conflict = new Ref<>(Boolean.FALSE); - PsiScopesUtil.walkChildrenScopes(this, new BaseScopeProcessor() { + PsiScopesUtil.walkChildrenScopes(this, new PsiScopeProcessor() { @Override public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) { if (element instanceof PsiLocalVariable) { diff --git a/java/java-psi-impl/src/com/intellij/psi/scope/processor/FilterScopeProcessor.java b/java/java-psi-impl/src/com/intellij/psi/scope/processor/FilterScopeProcessor.java index 4c8965a7b9b2..bfe9e3fb0376 100644 --- a/java/java-psi-impl/src/com/intellij/psi/scope/processor/FilterScopeProcessor.java +++ b/java/java-psi-impl/src/com/intellij/psi/scope/processor/FilterScopeProcessor.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-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. package com.intellij.psi.scope.processor; import com.intellij.openapi.util.Key; @@ -20,7 +6,6 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiSubstitutor; import com.intellij.psi.ResolveState; import com.intellij.psi.filters.ElementFilter; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.util.SmartList; import org.jetbrains.annotations.NotNull; @@ -32,7 +17,7 @@ import java.util.List; * @author ik * Date: 13.02.2003 */ -public class FilterScopeProcessor extends BaseScopeProcessor { +public class FilterScopeProcessor implements PsiScopeProcessor { protected final List myResults; private PsiElement myCurrentDeclarationHolder; private final ElementFilter myFilter; diff --git a/java/java-psi-impl/src/com/intellij/psi/scope/processor/VariablesProcessor.java b/java/java-psi-impl/src/com/intellij/psi/scope/processor/VariablesProcessor.java index baa09fd49fa3..ef0fb950abf4 100644 --- a/java/java-psi-impl/src/com/intellij/psi/scope/processor/VariablesProcessor.java +++ b/java/java-psi-impl/src/com/intellij/psi/scope/processor/VariablesProcessor.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-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. package com.intellij.psi.scope.processor; import com.intellij.openapi.util.Key; @@ -20,15 +6,15 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiModifier; import com.intellij.psi.PsiVariable; import com.intellij.psi.ResolveState; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.ElementClassHint; import com.intellij.psi.scope.JavaScopeProcessorEvent; +import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.util.SmartList; import org.jetbrains.annotations.NotNull; import java.util.List; -public abstract class VariablesProcessor extends BaseScopeProcessor implements ElementClassHint { +public abstract class VariablesProcessor implements PsiScopeProcessor, ElementClassHint { private boolean myStaticScopeFlag; private final boolean myStaticSensitiveFlag; private final List myResultList; @@ -85,6 +71,6 @@ public abstract class VariablesProcessor extends BaseScopeProcessor implements E return (T)this; } - return super.getHint(hintKey); + return null; } } diff --git a/java/java-structure-view/src/com/intellij/ide/structureView/impl/AddAllMembersProcessor.java b/java/java-structure-view/src/com/intellij/ide/structureView/impl/AddAllMembersProcessor.java index 55239488422c..914760166dfd 100644 --- a/java/java-structure-view/src/com/intellij/ide/structureView/impl/AddAllMembersProcessor.java +++ b/java/java-structure-view/src/com/intellij/ide/structureView/impl/AddAllMembersProcessor.java @@ -1,23 +1,9 @@ -/* - * 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-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. package com.intellij.ide.structureView.impl; import com.intellij.psi.*; import com.intellij.psi.impl.PsiImplUtil; -import com.intellij.psi.scope.BaseScopeProcessor; +import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.util.MethodSignature; import com.intellij.psi.util.PsiUtil; import com.intellij.util.containers.HashMap; @@ -29,7 +15,7 @@ import java.util.Map; /** * @deprecated use conflict-filter processor with duplicates resolver {@link com.intellij.psi.scope.processor.ConflictFilterProcessor} */ -public class AddAllMembersProcessor extends BaseScopeProcessor { +public class AddAllMembersProcessor implements PsiScopeProcessor { private final Collection myAllMembers; private final PsiClass myPsiClass; private final Map myMethodsBySignature = new HashMap<>(); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/caches/fileCache.kt b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/caches/fileCache.kt index 8e43bb4a04f7..30e5bd744769 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/caches/fileCache.kt +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/caches/fileCache.kt @@ -5,7 +5,6 @@ import com.intellij.openapi.util.Key import com.intellij.psi.PsiElement import com.intellij.psi.PsiNamedElement import com.intellij.psi.ResolveState -import com.intellij.psi.scope.BaseScopeProcessor import com.intellij.psi.scope.ElementClassHint import com.intellij.psi.scope.PsiScopeProcessor import com.intellij.util.containers.MostlySingularMultiMap @@ -15,7 +14,7 @@ import org.jetbrains.plugins.groovy.lang.resolve.imports.importedNameKey private data class ElementWithState(val element: PsiElement, val state: ResolveState) -class FileCacheBuilderProcessor(private val annotationResolve: Boolean) : BaseScopeProcessor(), ElementClassHint, AnnotationHint { +class FileCacheBuilderProcessor(private val annotationResolve: Boolean) : PsiScopeProcessor, ElementClassHint, AnnotationHint { private val declarations = MostlySingularMultiMap() diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/CollectElementsProcessor.kt b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/CollectElementsProcessor.kt index e5a88fc52272..bc22aa7d697c 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/CollectElementsProcessor.kt +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/resolve/processors/CollectElementsProcessor.kt @@ -3,9 +3,9 @@ package org.jetbrains.plugins.groovy.lang.resolve.processors import com.intellij.psi.PsiElement import com.intellij.psi.ResolveState -import com.intellij.psi.scope.BaseScopeProcessor +import com.intellij.psi.scope.PsiScopeProcessor -class CollectElementsProcessor : BaseScopeProcessor() { +class CollectElementsProcessor : PsiScopeProcessor { private val myResults = mutableListOf() val results: List get() = myResults diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/ext/logback/LogbackDelegateMemberContributor.kt b/plugins/groovy/src/org/jetbrains/plugins/groovy/ext/logback/LogbackDelegateMemberContributor.kt index 7dc107310bd9..5bfe60933a0d 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/ext/logback/LogbackDelegateMemberContributor.kt +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/ext/logback/LogbackDelegateMemberContributor.kt @@ -1,24 +1,9 @@ -/* - * 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-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. package org.jetbrains.plugins.groovy.ext.logback import com.intellij.openapi.util.Key import com.intellij.psi.* import com.intellij.psi.CommonClassNames.JAVA_LANG_STRING -import com.intellij.psi.scope.BaseScopeProcessor import com.intellij.psi.scope.ElementClassHint import com.intellij.psi.scope.NameHint import com.intellij.psi.scope.PsiScopeProcessor @@ -75,7 +60,7 @@ class LogbackDelegateMemberContributor : NonCodeMembersContributor() { return componentType?.resolve() } - class ComponentProcessor(val delegate: PsiScopeProcessor, val place: PsiElement, val name: String?) : BaseScopeProcessor() { + class ComponentProcessor(val delegate: PsiScopeProcessor, val place: PsiElement, val name: String?) : PsiScopeProcessor { override fun execute(method: PsiElement, state: ResolveState): Boolean { method as? PsiMethod ?: return true diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GdslClosureCompleter.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GdslClosureCompleter.java index 054da3911368..52b61a9488e9 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GdslClosureCompleter.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GdslClosureCompleter.java @@ -1,23 +1,9 @@ -/* - * 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-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. package org.jetbrains.plugins.groovy.lang.completion; import com.intellij.codeInsight.completion.InsertionContext; import com.intellij.psi.*; -import com.intellij.psi.scope.BaseScopeProcessor; +import com.intellij.psi.scope.PsiScopeProcessor; import org.jetbrains.annotations.NotNull; import org.jetbrains.plugins.groovy.dsl.GroovyDslFileIndex; import org.jetbrains.plugins.groovy.lang.completion.closureParameters.ClosureDescriptor; @@ -74,7 +60,7 @@ public class GdslClosureCompleter extends ClosureCompleter { } private static void processExecutors(PsiType qtype, GrReferenceExpression ref, final ArrayList descriptors) { - GroovyDslFileIndex.processExecutors(qtype, ref, new BaseScopeProcessor() { + GroovyDslFileIndex.processExecutors(qtype, ref, new PsiScopeProcessor() { @Override public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) { if (element instanceof ClosureDescriptor) { diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/completeReferenceElement.kt b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/completeReferenceElement.kt index df3660a265b8..e0c72c1c8aac 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/completeReferenceElement.kt +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/completeReferenceElement.kt @@ -11,7 +11,6 @@ import com.intellij.codeInsight.lookup.LookupElementBuilder import com.intellij.openapi.util.Conditions import com.intellij.openapi.util.Key import com.intellij.psi.* -import com.intellij.psi.scope.BaseScopeProcessor import com.intellij.psi.scope.ElementClassHint.DeclarationKind.CLASS import com.intellij.psi.scope.ElementClassHint.DeclarationKind.PACKAGE import com.intellij.psi.scope.PsiScopeProcessor @@ -93,7 +92,7 @@ private class CompleteReferenceProcessor( private val matcher: PrefixMatcher, private val consumer: LookupConsumer, private val afterNew: Boolean -) : BaseScopeProcessor() { +) : PsiScopeProcessor { override fun execute(element: PsiElement, state: ResolveState): Boolean { element as? PsiNamedElement ?: return true diff --git a/python/src/com/jetbrains/python/codeInsight/PyDunderAllReference.java b/python/src/com/jetbrains/python/codeInsight/PyDunderAllReference.java index c13882ca0aa7..1251aceeb4b7 100644 --- a/python/src/com/jetbrains/python/codeInsight/PyDunderAllReference.java +++ b/python/src/com/jetbrains/python/codeInsight/PyDunderAllReference.java @@ -5,7 +5,7 @@ import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupElementBuilder; import com.intellij.openapi.util.TextRange; import com.intellij.psi.*; -import com.intellij.psi.scope.BaseScopeProcessor; +import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.util.ArrayUtil; import com.intellij.util.containers.ContainerUtil; import com.jetbrains.python.PyNames; @@ -66,7 +66,7 @@ public class PyDunderAllReference extends PsiPolyVariantReferenceBase fields = new TreeSet<>(Comparator.comparingInt(PyTargetExpression::getTextOffset)); cls.processClassLevelDeclarations( - new BaseScopeProcessor() { + new PsiScopeProcessor() { @Override public boolean execute(@NotNull PsiElement element, @NotNull ResolveState substitutor) { if (element instanceof PyTargetExpression) { diff --git a/python/src/com/jetbrains/python/inspections/PyNamedTupleInspection.kt b/python/src/com/jetbrains/python/inspections/PyNamedTupleInspection.kt index 8ed567ec7332..c2ccda54ec9a 100644 --- a/python/src/com/jetbrains/python/inspections/PyNamedTupleInspection.kt +++ b/python/src/com/jetbrains/python/inspections/PyNamedTupleInspection.kt @@ -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-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. package com.jetbrains.python.inspections import com.intellij.codeInspection.LocalInspectionToolSession @@ -21,7 +7,7 @@ import com.intellij.codeInspection.ProblemsHolder import com.intellij.psi.PsiElement import com.intellij.psi.PsiElementVisitor import com.intellij.psi.ResolveState -import com.intellij.psi.scope.BaseScopeProcessor +import com.intellij.psi.scope.PsiScopeProcessor import com.jetbrains.python.codeInsight.stdlib.PyNamedTupleType import com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider import com.jetbrains.python.psi.LanguageLevel @@ -29,7 +15,6 @@ import com.jetbrains.python.psi.PyClass import com.jetbrains.python.psi.PyTargetExpression import com.jetbrains.python.psi.types.PyClassLikeType import java.util.* -import kotlin.comparisons.compareBy class PyNamedTupleInspection : PyInspection() { @@ -71,7 +56,7 @@ class PyNamedTupleInspection : PyInspection() { } } - private class FieldsProcessor : BaseScopeProcessor() { + private class FieldsProcessor : PsiScopeProcessor { val lastFieldWithoutDefaultValue: PyTargetExpression? get() = lastFieldWithoutDefaultValueBox.result diff --git a/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java b/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java index e93e9b45d4de..73ce074b7a92 100644 --- a/python/src/com/jetbrains/python/psi/impl/PyClassImpl.java +++ b/python/src/com/jetbrains/python/psi/impl/PyClassImpl.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-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. package com.jetbrains.python.psi.impl; import com.intellij.codeInsight.completion.CompletionUtil; @@ -22,15 +8,14 @@ import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.NotNullLazyValue; import com.intellij.openapi.util.Ref; import com.intellij.psi.*; -import com.intellij.psi.scope.BaseScopeProcessor; import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.search.LocalSearchScope; import com.intellij.psi.search.SearchScope; import com.intellij.psi.stubs.IStubElementType; import com.intellij.psi.stubs.StubElement; import com.intellij.psi.tree.TokenSet; -import com.intellij.psi.util.*; import com.intellij.psi.util.CachedValueProvider.Result; +import com.intellij.psi.util.*; import com.intellij.util.*; import com.intellij.util.containers.ContainerUtil; import com.jetbrains.python.PyElementTypes; @@ -504,7 +489,7 @@ public class PyClassImpl extends PyBaseElementImpl implements PyCla @NotNull Class childrenClass, @NotNull ArrayFactory factory) { final List result = new ArrayList<>(); - processClassLevelDeclarations(new BaseScopeProcessor() { + processClassLevelDeclarations(new PsiScopeProcessor() { @Override public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) { if (childrenClass.isInstance(element) && elementTypes.contains(((StubBasedPsiElement)element).getElementType())) { diff --git a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNameImpl.java b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNameImpl.java index 47005a50b536..e20136faf8e2 100644 --- a/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNameImpl.java +++ b/xml/relaxng/src/org/intellij/plugins/relaxNG/compact/psi/impl/RncNameImpl.java @@ -36,7 +36,7 @@ import com.intellij.psi.PsiFileFactory; import com.intellij.psi.PsiReference; import com.intellij.psi.ResolveState; import com.intellij.psi.codeStyle.CodeStyleManager; -import com.intellij.psi.scope.BaseScopeProcessor; +import com.intellij.psi.scope.PsiScopeProcessor; import com.intellij.psi.tree.IElementType; import com.intellij.util.ArrayUtil; import com.intellij.util.IncorrectOperationException; @@ -162,7 +162,7 @@ public class RncNameImpl extends RncElementImpl implements RncName, PsiReference return LocalQuickFix.EMPTY_ARRAY; } - private static class MyResolver extends BaseScopeProcessor { + private static class MyResolver implements PsiScopeProcessor { private final String myPrefix; private final Kind myKind; private PsiElement myResult;