diff --git a/java/java-indexing-api/src/com/intellij/psi/search/searches/MethodReferencesSearch.java b/java/java-indexing-api/src/com/intellij/psi/search/searches/MethodReferencesSearch.java index 5a94469d8f7d..04fc446357fd 100644 --- a/java/java-indexing-api/src/com/intellij/psi/search/searches/MethodReferencesSearch.java +++ b/java/java-indexing-api/src/com/intellij/psi/search/searches/MethodReferencesSearch.java @@ -100,7 +100,7 @@ public class MethodReferencesSearch extends ExtensibleQueryFactory processor) { + @NotNull SearchRequestCollector collector, final Processor processor) { searchOptimized(method, scope, strictSignatureSearch, collector, false, (psiReference, collector1) -> processor.process(psiReference)); } diff --git a/java/java-indexing-impl/src/com/intellij/codeInsight/navigation/ClassImplementationsSearch.java b/java/java-indexing-impl/src/com/intellij/codeInsight/navigation/ClassImplementationsSearch.java index d15c03bd3ce0..650f8e60ddcd 100644 --- a/java/java-indexing-impl/src/com/intellij/codeInsight/navigation/ClassImplementationsSearch.java +++ b/java/java-indexing-impl/src/com/intellij/codeInsight/navigation/ClassImplementationsSearch.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.codeInsight.navigation; import com.intellij.openapi.util.registry.Registry; @@ -30,12 +16,12 @@ import org.jetbrains.annotations.NotNull; public class ClassImplementationsSearch implements QueryExecutor { @Override - public boolean execute(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor consumer) { + public boolean execute(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor consumer) { final PsiElement sourceElement = queryParameters.getElement(); return !(sourceElement instanceof PsiClass) || processImplementations((PsiClass)sourceElement, consumer, queryParameters.getScope()); } - public static boolean processImplementations(final PsiClass psiClass, final Processor processor, SearchScope scope) { + public static boolean processImplementations(final PsiClass psiClass, final Processor processor, SearchScope scope) { final boolean showInterfaces = Registry.is("ide.goto.implementation.show.interfaces"); if (!ClassInheritorsSearch.search(psiClass, scope, true).forEach(new PsiElementProcessorAdapter<>(element -> { if (!showInterfaces && element.isInterface()) { diff --git a/java/java-indexing-impl/src/com/intellij/codeInsight/navigation/MethodImplementationsSearch.java b/java/java-indexing-impl/src/com/intellij/codeInsight/navigation/MethodImplementationsSearch.java index 25d5bc2c6aac..ac86451f6bee 100644 --- a/java/java-indexing-impl/src/com/intellij/codeInsight/navigation/MethodImplementationsSearch.java +++ b/java/java-indexing-impl/src/com/intellij/codeInsight/navigation/MethodImplementationsSearch.java @@ -1,22 +1,7 @@ -/* - * 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.codeInsight.navigation; import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiFunctionalExpression; import com.intellij.psi.PsiMethod; import com.intellij.psi.search.SearchScope; import com.intellij.psi.search.searches.DefinitionsScopedSearch; @@ -32,7 +17,7 @@ import java.util.List; public class MethodImplementationsSearch implements QueryExecutor { @Override - public boolean execute(@NotNull final DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { final PsiElement sourceElement = queryParameters.getElement(); if (sourceElement instanceof PsiMethod) { return processImplementations((PsiMethod)sourceElement, consumer, queryParameters.getScope()); @@ -40,17 +25,17 @@ public class MethodImplementationsSearch implements QueryExecutor consumer, + public static boolean processImplementations(final PsiMethod psiMethod, final Processor consumer, final SearchScope searchScope) { - return processOverridingMethods(psiMethod, searchScope, consumer::process) && - FunctionalExpressionSearch.search(psiMethod, searchScope).forEach((Processor)consumer::process); + return processOverridingMethods(psiMethod, searchScope, consumer) && + FunctionalExpressionSearch.search(psiMethod, searchScope).forEach(consumer); } public static void getOverridingMethods(PsiMethod method, List list, SearchScope scope) { processOverridingMethods(method, scope, new CommonProcessors.CollectProcessor<>(list)); } - private static boolean processOverridingMethods(PsiMethod method, SearchScope scope, Processor processor) { + private static boolean processOverridingMethods(PsiMethod method, SearchScope scope, Processor processor) { return OverridingMethodsSearch.search(method, scope, true).forEach(processor); } diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/AllClassesSearchExecutor.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/AllClassesSearchExecutor.java index 3b7ecc0029a3..733f45028842 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/AllClassesSearchExecutor.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/AllClassesSearchExecutor.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. /* * @author max @@ -42,7 +28,7 @@ import java.util.*; public class AllClassesSearchExecutor implements QueryExecutor { @Override - public boolean execute(@NotNull final AllClassesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final AllClassesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { SearchScope scope = queryParameters.getScope(); if (scope instanceof GlobalSearchScope) { @@ -58,7 +44,7 @@ public class AllClassesSearchExecutor implements QueryExecutor processor) { + @NotNull Processor processor) { final Set names = new THashSet<>(10000); processClassNames(parameters.getProject(), scope, s -> { if (parameters.nameMatches(s)) { @@ -75,7 +61,7 @@ public class AllClassesSearchExecutor implements QueryExecutor names, - Processor processor) { + Processor processor) { final PsiShortNamesCache cache = PsiShortNamesCache.getInstance(project); for (final String name : names) { ProgressIndicatorProvider.checkCanceled(); @@ -103,7 +89,7 @@ public class AllClassesSearchExecutor implements QueryExecutor processor) { + private static boolean processScopeRootForAllClasses(@NotNull final PsiElement scopeRoot, @NotNull final Processor processor) { final boolean[] stopped = {false}; final JavaElementVisitor visitor = scopeRoot instanceof PsiCompiledElement ? new JavaRecursiveElementVisitor() { diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/AnnotatedElementsSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/AnnotatedElementsSearcher.java index cb23ddc8efa8..8df155ecb109 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/AnnotatedElementsSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/AnnotatedElementsSearcher.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.psi.impl.search; import com.intellij.openapi.application.ReadAction; @@ -37,7 +23,7 @@ import java.util.List; */ public class AnnotatedElementsSearcher implements QueryExecutor { @Override - public boolean execute(@NotNull final AnnotatedElementsSearch.Parameters p, @NotNull final Processor consumer) { + public boolean execute(@NotNull final AnnotatedElementsSearch.Parameters p, @NotNull final Processor consumer) { final PsiClass annClass = p.getAnnotationClass(); if (!annClass.isAnnotationType()) throw new IllegalArgumentException("Annotation type should be passed to annotated members search but got: "+annClass); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/AnnotatedPackagesSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/AnnotatedPackagesSearcher.java index aa01fe4188a9..60a23c35e709 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/AnnotatedPackagesSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/AnnotatedPackagesSearcher.java @@ -25,7 +25,7 @@ public class AnnotatedPackagesSearcher implements QueryExecutor consumer) { + public boolean execute(@NotNull final AnnotatedPackagesSearch.Parameters p, @NotNull final Processor consumer) { final PsiClass annClass = p.getAnnotationClass(); assert annClass.isAnnotationType() : "Annotation type should be passed to annotated packages search"; diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/ClassesWithAnnotatedMembersSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/ClassesWithAnnotatedMembersSearcher.java index 955491645e54..849f2d04793a 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/ClassesWithAnnotatedMembersSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/ClassesWithAnnotatedMembersSearcher.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.psi.impl.search; import com.intellij.openapi.application.QueryExecutorBase; @@ -37,7 +23,7 @@ import java.util.Set; public class ClassesWithAnnotatedMembersSearcher extends QueryExecutorBase { @Override public void processQuery(@NotNull ClassesWithAnnotatedMembersSearch.Parameters queryParameters, - @NotNull final Processor consumer) { + @NotNull final Processor consumer) { SearchScope scope = queryParameters.getScope(); for (QueryExecutor executor : Extensions.getExtensions(ClassesWithAnnotatedMembersSearch.EP_NAME)) { if (executor instanceof ScopedQueryExecutor) { diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/ConstructorReferencesSearchHelper.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/ConstructorReferencesSearchHelper.java index 5354bc255d83..862be02e0f86 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/ConstructorReferencesSearchHelper.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/ConstructorReferencesSearchHelper.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.search; import com.intellij.ide.highlighter.JavaFileType; @@ -51,7 +37,7 @@ class ConstructorReferencesSearchHelper { * 2. Exception avoidance. Project is needed outside of read action (to run it via DumbService in the first place), * and so getProject would fail with an assertion that read action is required but not present. */ - boolean processConstructorReferences(@NotNull final Processor processor, + boolean processConstructorReferences(@NotNull final Processor processor, @NotNull final PsiMethod constructor, @NotNull final PsiClass containingClass, @NotNull final SearchScope searchScope, @@ -132,7 +118,7 @@ class ConstructorReferencesSearchHelper { return ClassInheritorsSearch.search(containingClass, searchScope, false).forEach(processor2); } - private static boolean processEnumReferences(@NotNull final Processor processor, + private static boolean processEnumReferences(@NotNull final Processor processor, @NotNull final PsiMethod constructor, @NotNull final Project project, @NotNull final PsiClass aClass) { @@ -151,7 +137,7 @@ class ConstructorReferencesSearchHelper { }); } - private static boolean process18MethodPointers(@NotNull final Processor processor, + private static boolean process18MethodPointers(@NotNull final Processor processor, @NotNull final PsiMethod constructor, @NotNull final Project project, @NotNull PsiClass aClass, SearchScope searchScope) { @@ -181,7 +167,7 @@ class ConstructorReferencesSearchHelper { final boolean isStrictSignatureSearch, @NotNull String superOrThisKeyword, @NotNull String thisOrSuperKeyword, - @NotNull Processor processor) { + @NotNull Processor processor) { PsiMethod[] constructors = inheritor.getConstructors(); if (constructors.length == 0 && constructorCanBeCalledImplicitly) { if (!processImplicitConstructorCall(inheritor, processor, constructor, project, inheritor)) return false; @@ -227,7 +213,7 @@ class ConstructorReferencesSearchHelper { } private boolean processImplicitConstructorCall(@NotNull final PsiMember usage, - @NotNull final Processor processor, + @NotNull final Processor processor, @NotNull final PsiMethod constructor, @NotNull final Project project, @NotNull final PsiClass containingClass) { diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/ConstructorReferencesSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/ConstructorReferencesSearcher.java index cf07bb9124cc..06f7472f6df6 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/ConstructorReferencesSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/ConstructorReferencesSearcher.java @@ -1,3 +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. package com.intellij.psi.impl.search; import com.intellij.openapi.application.QueryExecutorBase; @@ -13,7 +14,7 @@ import org.jetbrains.annotations.NotNull; */ public class ConstructorReferencesSearcher extends QueryExecutorBase { @Override - public void processQuery(@NotNull final ReferencesSearch.SearchParameters p, @NotNull Processor consumer) { + public void processQuery(@NotNull final ReferencesSearch.SearchParameters p, @NotNull Processor consumer) { final PsiElement element = p.getElementToSearch(); if (!(element instanceof PsiMethod)) { return; diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaAllOverridingMethodsSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaAllOverridingMethodsSearcher.java index 9463e5400618..49ec8f3d4bd9 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaAllOverridingMethodsSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaAllOverridingMethodsSearcher.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.psi.impl.search; import com.intellij.openapi.application.ReadAction; @@ -39,7 +25,7 @@ import java.util.List; */ public class JavaAllOverridingMethodsSearcher implements QueryExecutor, AllOverridingMethodsSearch.SearchParameters> { @Override - public boolean execute(@NotNull final AllOverridingMethodsSearch.SearchParameters p, @NotNull final Processor> consumer) { + public boolean execute(@NotNull final AllOverridingMethodsSearch.SearchParameters p, @NotNull final Processor> consumer) { final PsiClass psiClass = p.getPsiClass(); final List potentials = ReadAction.compute(() -> ContainerUtil.filter(psiClass.getMethods(), PsiUtil::canBeOverridden)); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaClassInheritorsSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaClassInheritorsSearcher.java index 34709ed13d02..e964929d27a6 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaClassInheritorsSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaClassInheritorsSearcher.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.search; import com.intellij.openapi.application.ApplicationManager; @@ -42,7 +28,7 @@ import java.util.concurrent.ConcurrentMap; public class JavaClassInheritorsSearcher extends QueryExecutorBase { @Override - public void processQuery(@NotNull ClassInheritorsSearch.SearchParameters parameters, @NotNull Processor consumer) { + public void processQuery(@NotNull ClassInheritorsSearch.SearchParameters parameters, @NotNull Processor consumer) { final PsiClass baseClass = parameters.getClassToProcess(); assert parameters.isCheckDeep(); assert parameters.isCheckInheritance(); @@ -67,7 +53,7 @@ public class JavaClassInheritorsSearcher extends QueryExecutorBase consumer) { + @NotNull final Processor consumer) { @NotNull final PsiClass baseClass = parameters.getClassToProcess(); if (baseClass instanceof PsiAnonymousClass || isFinal(baseClass)) return; @@ -140,7 +126,7 @@ public class JavaClassInheritorsSearcher extends QueryExecutorBase consumer) { + @NotNull Processor consumer) { // optimisation: in case of local scope it's considered cheaper to enumerate all scope files and check if there is an inheritor there, // instead of traversing the (potentially huge) class hierarchy and filter out almost everything by scope. VirtualFile[] virtualFiles = searchScope.getVirtualFiles(); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaDirectInheritorsSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaDirectInheritorsSearcher.java index bb0e1942b9e9..c4fc4eb1a051 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaDirectInheritorsSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaDirectInheritorsSearcher.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.psi.impl.search; import com.intellij.compiler.CompilerDirectHierarchyInfo; @@ -43,7 +41,7 @@ import java.util.stream.Stream; */ public class JavaDirectInheritorsSearcher implements QueryExecutor { @Override - public boolean execute(@NotNull final DirectClassInheritorsSearch.SearchParameters parameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final DirectClassInheritorsSearch.SearchParameters parameters, @NotNull final Processor consumer) { PsiClass baseClass = getClassToSearch(parameters); assert parameters.isCheckInheritance(); @@ -282,7 +280,7 @@ public class JavaDirectInheritorsSearcher implements QueryExecutor classStream, - @NotNull Processor consumer, + @NotNull Processor consumer, boolean acceptAnonymous) { if (!acceptAnonymous) { classStream = classStream.filter(c -> !(c instanceof PsiAnonymousClass)); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaFunctionalExpressionSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaFunctionalExpressionSearcher.java index 83d1cba65cf0..87a1d2469bce 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaFunctionalExpressionSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaFunctionalExpressionSearcher.java @@ -51,7 +51,7 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull SearchParameters p, @NotNull Processor consumer) { List descriptors = calcDescriptors(p); Project project = PsiUtilCore.getProjectInReadAction(p.getElementToSearch()); if (project == null) return; @@ -178,7 +178,7 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase it.canHaveType(samClasses, vFile))); } - private static boolean processFile(@NotNull Processor consumer, + private static boolean processFile(@NotNull Processor consumer, List descriptors, VirtualFile vFile, Collection offsets) { return ReadAction.compute(() -> { @@ -332,7 +332,7 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase descriptors, @NotNull GlobalSearchScope searchScope, @NotNull Project project, - @NotNull Processor consumer) { + @NotNull Processor consumer) { CompilerReferenceService compilerReferenceService = CompilerReferenceService.getInstance(project); if (compilerReferenceService == null) return true; for (SamDescriptor descriptor : descriptors) { @@ -354,7 +354,7 @@ public class JavaFunctionalExpressionSearcher extends QueryExecutorBase consumer) { + @NotNull Processor consumer) { if (funExprInfo != null) { if (!ContainerUtil.process(funExprInfo.getHierarchyChildren().iterator(), fe -> consumer.process((PsiFunctionalExpression)fe))) return false; GlobalSearchScope dirtyScope = funExprInfo.getDirtyScope(); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaOverridingMethodsSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaOverridingMethodsSearcher.java index 2e0617339858..8a2e2579c19c 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaOverridingMethodsSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaOverridingMethodsSearcher.java @@ -31,7 +31,7 @@ import java.util.LinkedHashSet; */ public class JavaOverridingMethodsSearcher implements QueryExecutor { @Override - public boolean execute(@NotNull final OverridingMethodsSearch.SearchParameters parameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final OverridingMethodsSearch.SearchParameters parameters, @NotNull final Processor consumer) { final PsiMethod method = parameters.getMethod(); Project project = ReadAction.compute(method::getProject); @@ -72,7 +72,7 @@ public class JavaOverridingMethodsSearcher implements QueryExecutor consumer) { + @NotNull final Processor consumer) { // optimisation: in case of local scope it's considered cheaper to enumerate all scope files and check if there is an inheritor there, // instead of traversing the (potentially huge) class hierarchy and filter out almost everything by scope. VirtualFile[] virtualFiles = searchScope.getVirtualFiles(); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java index b1daf0734c69..11b30a5f5cfd 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodDeepestSuperSearcher.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.psi.impl.search; import com.intellij.openapi.application.ReadAction; @@ -29,11 +15,11 @@ import java.util.Set; */ public class MethodDeepestSuperSearcher implements QueryExecutor { @Override - public boolean execute(@NotNull PsiMethod method, @NotNull Processor consumer) { + public boolean execute(@NotNull PsiMethod method, @NotNull Processor consumer) { return processDeepestSuperMethods(method, consumer); } - public static boolean processDeepestSuperMethods(@NotNull PsiMethod method, @NotNull Processor consumer) { + public static boolean processDeepestSuperMethods(@NotNull PsiMethod method, @NotNull Processor consumer) { final Set methods = new THashSet<>(); methods.add(method); return findDeepestSuperOrSelfSignature(method, methods, null, consumer); @@ -42,7 +28,7 @@ public class MethodDeepestSuperSearcher implements QueryExecutor set, Set guard, - @NotNull Processor processor) { + @NotNull Processor processor) { if (guard != null && !guard.add(method)) return true; PsiMethod[] supers = ReadAction.compute(() -> method.findSuperMethods()); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodTextOccurrenceProcessor.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodTextOccurrenceProcessor.java index 0759c1643216..443279339b41 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodTextOccurrenceProcessor.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodTextOccurrenceProcessor.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.psi.impl.search; import com.intellij.psi.*; @@ -42,7 +28,7 @@ public class MethodTextOccurrenceProcessor extends RequestResultProcessor { } @Override - public final boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull final Processor consumer) { + public final boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull final Processor consumer) { for (PsiReference ref : ourReferenceService.getReferences(element, new PsiReferenceService.Hints(myMethods[0], offsetInElement))) { if (ReferenceRange.containsOffsetInElement(ref, offsetInElement) && !processReference(consumer, ref)) { return false; @@ -51,7 +37,7 @@ public class MethodTextOccurrenceProcessor extends RequestResultProcessor { return true; } - private boolean processReference(Processor consumer, PsiReference ref) { + private boolean processReference(Processor consumer, PsiReference ref) { for (PsiMethod method : myMethods) { if (!method.isValid()) { continue; @@ -72,7 +58,7 @@ public class MethodTextOccurrenceProcessor extends RequestResultProcessor { return true; } - protected boolean processInexactReference(PsiReference ref, PsiElement refElement, PsiMethod method, Processor consumer) { + protected boolean processInexactReference(PsiReference ref, PsiElement refElement, PsiMethod method, Processor consumer) { if (refElement instanceof PsiMethod) { PsiMethod refMethod = (PsiMethod)refElement; PsiClass refMethodClass = refMethod.getContainingClass(); diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodUsagesSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodUsagesSearcher.java index 0bfad2339218..4226c18ef75e 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodUsagesSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/MethodUsagesSearcher.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.psi.impl.search; import com.intellij.openapi.application.QueryExecutorBase; @@ -34,7 +20,7 @@ import org.jetbrains.annotations.NotNull; */ public class MethodUsagesSearcher extends QueryExecutorBase { @Override - public void processQuery(@NotNull final MethodReferencesSearch.SearchParameters p, @NotNull final Processor consumer) { + public void processQuery(@NotNull final MethodReferencesSearch.SearchParameters p, @NotNull final Processor consumer) { final PsiMethod method = p.getMethod(); final boolean[] isConstructor = new boolean[1]; final PsiManager[] psiManager = new PsiManager[1]; diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/PsiAnnotationMethodReferencesSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/PsiAnnotationMethodReferencesSearcher.java index 824b5fec8e07..8ba221550638 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/PsiAnnotationMethodReferencesSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/PsiAnnotationMethodReferencesSearcher.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.psi.impl.search; import com.intellij.openapi.application.ReadAction; @@ -31,7 +17,7 @@ import org.jetbrains.annotations.NotNull; */ public class PsiAnnotationMethodReferencesSearcher implements QueryExecutor { @Override - public boolean execute(@NotNull final ReferencesSearch.SearchParameters p, @NotNull final Processor consumer) { + public boolean execute(@NotNull final ReferencesSearch.SearchParameters p, @NotNull final Processor consumer) { final PsiElement refElement = p.getElementToSearch(); boolean isAnnotation = ReadAction.compute(() -> PsiUtil.isAnnotationMethod(refElement)); if (isAnnotation) { @@ -52,7 +38,7 @@ public class PsiAnnotationMethodReferencesSearcher implements QueryExecutor createImplicitDefaultAnnotationMethodConsumer(@NotNull Processor consumer) { + static ReadActionProcessor createImplicitDefaultAnnotationMethodConsumer(@NotNull Processor consumer) { return new ReadActionProcessor() { @Override public boolean processInReadAction(final PsiReference reference) { diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/SPIReferencesSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/SPIReferencesSearcher.java index 959e9814c8d1..413539d0b6d9 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/SPIReferencesSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/SPIReferencesSearcher.java @@ -1,18 +1,4 @@ -/* - * 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.impl.search; import com.intellij.lang.spi.SPILanguage; @@ -33,7 +19,7 @@ public class SPIReferencesSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull final ReferencesSearch.SearchParameters p, @NotNull final Processor consumer) { final PsiElement element = p.getElementToSearch(); if (!element.isValid()) return; diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/SimpleAccessorReferenceSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/SimpleAccessorReferenceSearcher.java index 71cd62b649b9..8eaf7e56faa0 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/SimpleAccessorReferenceSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/SimpleAccessorReferenceSearcher.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.psi.impl.search; import com.intellij.openapi.application.QueryExecutorBase; @@ -26,7 +12,6 @@ import com.intellij.psi.search.SearchRequestCollector; import com.intellij.psi.search.SearchScope; import com.intellij.psi.search.UsageSearchContext; import com.intellij.psi.search.searches.ReferencesSearch; -import com.intellij.psi.util.PropertyUtil; import com.intellij.psi.util.PropertyUtilBase; import com.intellij.util.Processor; import org.jetbrains.annotations.NotNull; @@ -40,7 +25,7 @@ public class SimpleAccessorReferenceSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull Processor consumer) { PsiElement refElement = queryParameters.getElementToSearch(); if (!(refElement instanceof PsiMethod)) return; diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/StubHierarchyInheritorSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/StubHierarchyInheritorSearcher.java index 704e37e31e4e..15b0bd9efa49 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/StubHierarchyInheritorSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/StubHierarchyInheritorSearcher.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.search; import com.intellij.openapi.application.QueryExecutorBase; @@ -53,7 +39,7 @@ public class StubHierarchyInheritorSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull DirectClassInheritorsSearch.SearchParameters p, @NotNull Processor consumer) { if (!(p.getScope() instanceof GlobalSearchScope) || !isSearching()) return; PsiClass base = p.getClassToProcess(); @@ -71,7 +57,7 @@ public class StubHierarchyInheritorSearcher extends QueryExecutorBase consumer, + private static boolean processCandidate(Processor consumer, PsiClass base, GlobalSearchScope scope, ClassHierarchy hierarchy, SmartClassAnchor anchor) { diff --git a/java/java-indexing-impl/src/com/intellij/psi/impl/search/VariableInIncompleteCodeSearcher.java b/java/java-indexing-impl/src/com/intellij/psi/impl/search/VariableInIncompleteCodeSearcher.java index 5950ca27c12f..432acb411d60 100644 --- a/java/java-indexing-impl/src/com/intellij/psi/impl/search/VariableInIncompleteCodeSearcher.java +++ b/java/java-indexing-impl/src/com/intellij/psi/impl/search/VariableInIncompleteCodeSearcher.java @@ -22,7 +22,7 @@ public class VariableInIncompleteCodeSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull final ReferencesSearch.SearchParameters p, @NotNull final Processor consumer) { final PsiElement refElement = p.getElementToSearch(); if (!refElement.isValid() || !(refElement instanceof PsiVariable)) return; diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java b/java/java-psi-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java index 0dbe4abf0580..a59c7f6d8e07 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/search/MethodSuperSearcher.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.psi.impl.search; import com.intellij.openapi.application.ReadAction; @@ -35,7 +21,7 @@ public class MethodSuperSearcher implements QueryExecutor consumer) { + public boolean execute(@NotNull final SuperMethodsSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { final PsiClass parentClass = queryParameters.getPsiClass(); final PsiMethod method = queryParameters.getMethod(); return ReadAction.compute(() -> { @@ -59,7 +45,7 @@ public class MethodSuperSearcher implements QueryExecutor consumer) { + final Processor consumer) { PsiMethod signatureMethod = signature.getMethod(); PsiClass hisClass = signatureMethod.getContainingClass(); if (parentClass == null || InheritanceUtil.isInheritorOrSelf(parentClass, hisClass, true)) { diff --git a/platform/editor-ui-ex/src/com/intellij/psi/impl/search/IndexPatternSearcher.java b/platform/editor-ui-ex/src/com/intellij/psi/impl/search/IndexPatternSearcher.java index 0ac1764a0095..f0be8b749708 100644 --- a/platform/editor-ui-ex/src/com/intellij/psi/impl/search/IndexPatternSearcher.java +++ b/platform/editor-ui-ex/src/com/intellij/psi/impl/search/IndexPatternSearcher.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.psi.impl.search; @@ -53,7 +39,7 @@ import java.util.regex.Pattern; public class IndexPatternSearcher implements QueryExecutor { @Override public boolean execute(@NotNull final IndexPatternSearch.SearchParameters queryParameters, - @NotNull final Processor consumer) { + @NotNull final Processor consumer) { final PsiFile file = queryParameters.getFile(); VirtualFile virtualFile = file.getVirtualFile(); if (file instanceof PsiBinaryFile || file instanceof PsiCompiledElement || virtualFile == null) { @@ -69,7 +55,7 @@ public class IndexPatternSearcher implements QueryExecutor consumer) { + Processor consumer) { final IndexPatternProvider patternProvider = queryParameters.getPatternProvider(); final PsiFile file = queryParameters.getFile(); TIntArrayList commentStarts = new TIntArrayList(); @@ -282,7 +268,7 @@ public class IndexPatternSearcher implements QueryExecutor consumer, + Processor consumer, TIntArrayList matches ) { Pattern pattern = indexPattern.getPattern(); diff --git a/platform/editor-ui-ex/src/com/intellij/psi/impl/search/LightIndexPatternSearcher.java b/platform/editor-ui-ex/src/com/intellij/psi/impl/search/LightIndexPatternSearcher.java index b01256c35a71..ef6114f11f5e 100644 --- a/platform/editor-ui-ex/src/com/intellij/psi/impl/search/LightIndexPatternSearcher.java +++ b/platform/editor-ui-ex/src/com/intellij/psi/impl/search/LightIndexPatternSearcher.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.psi.impl.search; import com.intellij.psi.search.IndexPatternOccurrence; @@ -26,7 +12,7 @@ import org.jetbrains.annotations.NotNull; public class LightIndexPatternSearcher extends IndexPatternSearcher { @Override public boolean execute(@NotNull IndexPatternSearch.SearchParameters queryParameters, - @NotNull Processor consumer) { + @NotNull Processor consumer) { return executeImpl(queryParameters, consumer); } } diff --git a/platform/indexing-api/src/com/intellij/psi/search/PsiSearchHelper.java b/platform/indexing-api/src/com/intellij/psi/search/PsiSearchHelper.java index 0c1f50f0b27b..8b747c30c911 100644 --- a/platform/indexing-api/src/com/intellij/psi/search/PsiSearchHelper.java +++ b/platform/indexing-api/src/com/intellij/psi/search/PsiSearchHelper.java @@ -152,10 +152,10 @@ public interface PsiSearchHelper { */ boolean processAllFilesWithWordInLiterals(@NotNull String word, @NotNull GlobalSearchScope scope, @NotNull Processor processor); - boolean processRequests(@NotNull SearchRequestCollector request, @NotNull Processor processor); + boolean processRequests(@NotNull SearchRequestCollector request, @NotNull Processor processor); @NotNull - AsyncFuture processRequestsAsync(@NotNull SearchRequestCollector request, @NotNull Processor processor); + AsyncFuture processRequestsAsync(@NotNull SearchRequestCollector request, @NotNull Processor processor); boolean processElementsWithWord(@NotNull TextOccurenceProcessor processor, @NotNull SearchScope searchScope, diff --git a/platform/indexing-api/src/com/intellij/psi/search/RequestResultProcessor.java b/platform/indexing-api/src/com/intellij/psi/search/RequestResultProcessor.java index 2667df01bfd2..8a53c0d4ee27 100644 --- a/platform/indexing-api/src/com/intellij/psi/search/RequestResultProcessor.java +++ b/platform/indexing-api/src/com/intellij/psi/search/RequestResultProcessor.java @@ -1,18 +1,4 @@ -/* - * 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.psi.search; import com.intellij.psi.PsiElement; @@ -64,7 +50,7 @@ public abstract class RequestResultProcessor { * * @return whether the consumer has returned false for any of the references (and thus stopped searching), false otherwise. */ - public abstract boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull Processor consumer); + public abstract boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull Processor consumer); /** * A variant of {@link RequestResultProcessor} that processes all text occurrences at once, e.g. for performance purposes. @@ -81,7 +67,7 @@ public abstract class RequestResultProcessor { } @Override - public boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull Processor consumer) { + public boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull Processor consumer) { return processTextOccurrences(element, new int[]{offsetInElement}, consumer); } @@ -91,6 +77,6 @@ public abstract class RequestResultProcessor { * inside the given element at the given offsets, and feed them to {@code consumer}.

* @return whether the consumer has returned false for any of the references (and thus stopped searching), false otherwise. */ - public abstract boolean processTextOccurrences(@NotNull PsiElement scope, int[] offsetsInScope, @NotNull Processor consumer); + public abstract boolean processTextOccurrences(@NotNull PsiElement scope, int[] offsetsInScope, @NotNull Processor consumer); } } diff --git a/platform/indexing-api/src/com/intellij/psi/search/SearchRequestCollector.java b/platform/indexing-api/src/com/intellij/psi/search/SearchRequestCollector.java index dbbca1fe22ad..798fcf8df908 100644 --- a/platform/indexing-api/src/com/intellij/psi/search/SearchRequestCollector.java +++ b/platform/indexing-api/src/com/intellij/psi/search/SearchRequestCollector.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.psi.search; import com.intellij.codeInsight.ContainerProvider; @@ -41,7 +27,7 @@ public class SearchRequestCollector { private final Object lock = new Object(); private final List myWordRequests = new ArrayList<>(); private final List myQueryRequests = new ArrayList<>(); - private final List>> myCustomSearchActions = new ArrayList<>(); + private final List>> myCustomSearchActions = new ArrayList<>(); private final SearchSession mySession; public SearchRequestCollector(@NotNull SearchSession session) { @@ -156,7 +142,7 @@ public class SearchRequestCollector { } } - public void searchCustom(@NotNull Processor> searchAction) { + public void searchCustom(@NotNull Processor> searchAction) { synchronized (lock) { myCustomSearchActions.add(searchAction); } @@ -182,7 +168,7 @@ public class SearchRequestCollector { } @NotNull - public List>> takeCustomSearchActions() { + public List>> takeCustomSearchActions() { return takeRequests(myCustomSearchActions); } diff --git a/platform/indexing-api/src/com/intellij/psi/search/SingleTargetRequestResultProcessor.java b/platform/indexing-api/src/com/intellij/psi/search/SingleTargetRequestResultProcessor.java index 1ea755a7668e..c3872e7beab6 100644 --- a/platform/indexing-api/src/com/intellij/psi/search/SingleTargetRequestResultProcessor.java +++ b/platform/indexing-api/src/com/intellij/psi/search/SingleTargetRequestResultProcessor.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.psi.search; import com.intellij.openapi.progress.ProgressManager; @@ -38,7 +24,7 @@ public final class SingleTargetRequestResultProcessor extends RequestResultProce } @Override - public boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull final Processor consumer) { + public boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull final Processor consumer) { if (!myTarget.isValid()) { return false; } diff --git a/platform/indexing-api/src/com/intellij/psi/search/searches/ReferencesSearch.java b/platform/indexing-api/src/com/intellij/psi/search/searches/ReferencesSearch.java index fda310556128..016b7079c48f 100644 --- a/platform/indexing-api/src/com/intellij/psi/search/searches/ReferencesSearch.java +++ b/platform/indexing-api/src/com/intellij/psi/search/searches/ReferencesSearch.java @@ -173,7 +173,7 @@ public class ReferencesSearch extends ExtensibleQueryFactory processor) { + @NotNull final Processor processor) { searchOptimized(element, searchScope, ignoreAccessScope, collector, false, (psiReference, collector1) -> processor.process(psiReference)); } diff --git a/platform/indexing-impl/src/com/intellij/psi/impl/search/CachesBasedRefSearcher.java b/platform/indexing-impl/src/com/intellij/psi/impl/search/CachesBasedRefSearcher.java index c09e67ccf6b9..91c896b28e1e 100644 --- a/platform/indexing-impl/src/com/intellij/psi/impl/search/CachesBasedRefSearcher.java +++ b/platform/indexing-impl/src/com/intellij/psi/impl/search/CachesBasedRefSearcher.java @@ -1,3 +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. package com.intellij.psi.impl.search; import com.intellij.openapi.application.QueryExecutorBase; @@ -24,7 +25,7 @@ public class CachesBasedRefSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters p, @NotNull Processor consumer) { final PsiElement refElement = p.getElementToSearch(); boolean caseSensitive = refElement.getLanguage().isCaseSensitive(); diff --git a/platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java b/platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java index 513ec0b54292..a513f27d00d6 100644 --- a/platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java +++ b/platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java @@ -560,16 +560,16 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { private static class RequestWithProcessor { @NotNull private final PsiSearchRequest request; - @NotNull private Processor refProcessor; + @NotNull private Processor refProcessor; - private RequestWithProcessor(@NotNull PsiSearchRequest request, @NotNull Processor processor) { + private RequestWithProcessor(@NotNull PsiSearchRequest request, @NotNull Processor processor) { this.request = request; refProcessor = processor; } private boolean uniteWith(@NotNull final RequestWithProcessor another) { if (request.equals(another.request)) { - final Processor myProcessor = refProcessor; + final Processor myProcessor = refProcessor; if (myProcessor != another.refProcessor) { refProcessor = psiReference -> myProcessor.process(psiReference) && another.refProcessor.process(psiReference); } @@ -585,8 +585,8 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { } @Override - public boolean processRequests(@NotNull SearchRequestCollector collector, @NotNull Processor processor) { - final Map> collectors = ContainerUtil.newHashMap(); + public boolean processRequests(@NotNull SearchRequestCollector collector, @NotNull Processor processor) { + final Map> collectors = ContainerUtil.newHashMap(); collectors.put(collector, processor); ProgressIndicator progress = getOrCreateIndicator(); @@ -621,11 +621,11 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { @NotNull @Override - public AsyncFuture processRequestsAsync(@NotNull SearchRequestCollector collector, @NotNull Processor processor) { + public AsyncFuture processRequestsAsync(@NotNull SearchRequestCollector collector, @NotNull Processor processor) { return AsyncUtil.wrapBoolean(processRequests(collector, processor)); } - private static boolean appendCollectorsFromQueryRequests(@NotNull Map> collectors) { + private static boolean appendCollectorsFromQueryRequests(@NotNull Map> collectors) { boolean changed = false; Deque queue = new LinkedList<>(collectors.keySet()); while (!queue.isEmpty()) { @@ -736,7 +736,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { @NotNull private static BulkOccurrenceProcessor adaptProcessor(@NotNull PsiSearchRequest singleRequest, - @NotNull Processor consumer) { + @NotNull Processor consumer) { final SearchScope searchScope = singleRequest.searchScope; final boolean ignoreInjectedPsi = searchScope instanceof LocalSearchScope && ((LocalSearchScope)searchScope).isIgnoreInjectedPsi(); final RequestResultProcessor wrapped = singleRequest.processor; @@ -864,15 +864,15 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { return GlobalSearchScope.union(scopes.toArray(new GlobalSearchScope[0])); } - private static void distributePrimitives(@NotNull Map> collectors, + private static void distributePrimitives(@NotNull Map> collectors, @NotNull Set locals, @NotNull MultiMap, RequestWithProcessor> globals, @NotNull List> customs, @NotNull Map> localProcessors, @NotNull ProgressIndicator progress) { - for (final Map.Entry> entry : collectors.entrySet()) { + for (final Map.Entry> entry : collectors.entrySet()) { ProgressManager.checkCanceled(); - final Processor processor = entry.getValue(); + final Processor processor = entry.getValue(); SearchRequestCollector collector = entry.getKey(); for (final PsiSearchRequest primitive : collector.takeSearchRequests()) { ProgressManager.checkCanceled(); @@ -885,7 +885,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { registerRequest(globals.getModifiable(key), primitive, processor); } } - for (final Processor> customAction : collector.takeCustomSearchActions()) { + for (final Processor> customAction : collector.takeCustomSearchActions()) { ProgressManager.checkCanceled(); customs.add(() -> customAction.process(processor)); } @@ -909,7 +909,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { private static void registerRequest(@NotNull Collection collection, @NotNull PsiSearchRequest primitive, - @NotNull Processor processor) { + @NotNull Processor processor) { RequestWithProcessor singleRequest = new RequestWithProcessor(primitive, processor); for (RequestWithProcessor existing : collection) { @@ -921,7 +921,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper { collection.add(singleRequest); } - private boolean processSingleRequest(@NotNull PsiSearchRequest single, @NotNull Processor consumer) { + private boolean processSingleRequest(@NotNull PsiSearchRequest single, @NotNull Processor consumer) { final EnumSet options = EnumSet.of(Options.PROCESS_ONLY_JAVA_IDENTIFIERS_IF_POSSIBLE); if (single.caseSensitive) options.add(Options.CASE_SENSITIVE_SEARCH); if (shouldProcessInjectedPsi(single.searchScope)) options.add(Options.PROCESS_INJECTED_PSI); diff --git a/platform/lang-impl/src/com/intellij/pom/PomDefinitionSearch.java b/platform/lang-impl/src/com/intellij/pom/PomDefinitionSearch.java index 154b6ddbeacb..de514ea1e978 100644 --- a/platform/lang-impl/src/com/intellij/pom/PomDefinitionSearch.java +++ b/platform/lang-impl/src/com/intellij/pom/PomDefinitionSearch.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.pom; import com.intellij.psi.PsiElement; @@ -26,7 +12,7 @@ import org.jetbrains.annotations.NotNull; */ public class PomDefinitionSearch implements QueryExecutor { @Override - public boolean execute(@NotNull PsiElement queryParameters, @NotNull Processor consumer) { + public boolean execute(@NotNull PsiElement queryParameters, @NotNull Processor consumer) { if (queryParameters instanceof PomTargetPsiElement) { final PomTarget target = ((PomTargetPsiElement)queryParameters).getTarget(); if (target instanceof PsiTarget) { diff --git a/platform/lang-impl/src/com/intellij/psi/impl/search/NonPhysicalReferenceSearcher.java b/platform/lang-impl/src/com/intellij/psi/impl/search/NonPhysicalReferenceSearcher.java index b33d7940a882..847263c42903 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/search/NonPhysicalReferenceSearcher.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/search/NonPhysicalReferenceSearcher.java @@ -1,3 +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. package com.intellij.psi.impl.search; import com.intellij.ide.scratch.ScratchFileService; @@ -25,7 +26,7 @@ public class NonPhysicalReferenceSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull Processor consumer) { if (ApplicationManager.getApplication().isUnitTestMode()) { return; } diff --git a/plugins/devkit/devkit-core/src/references/IconsReferencesContributor.java b/plugins/devkit/devkit-core/src/references/IconsReferencesContributor.java index 306fcd525897..9775ae2833c8 100644 --- a/plugins/devkit/devkit-core/src/references/IconsReferencesContributor.java +++ b/plugins/devkit/devkit-core/src/references/IconsReferencesContributor.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 org.jetbrains.idea.devkit.references; import com.intellij.codeInsight.daemon.EmptyResolveMessageProvider; @@ -71,7 +57,7 @@ public class IconsReferencesContributor extends PsiReferenceContributor implements QueryExecutor { @Override - public boolean execute(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { final PsiElement file = queryParameters.getElementToSearch(); if (file instanceof PsiBinaryFile) { final Module module = ReadAction.compute(() -> ModuleUtilCore.findModuleForPsiElement(file)); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/AccessorReferencesSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/AccessorReferencesSearcher.java index e37a2887b3c9..a059b5f6f336 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/AccessorReferencesSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/AccessorReferencesSearcher.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 org.jetbrains.plugins.groovy.findUsages; @@ -40,7 +26,7 @@ public class AccessorReferencesSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull Processor consumer) { final PsiElement element = queryParameters.getElementToSearch(); if (element instanceof PsiMethod) { final String propertyName = GroovyPropertyUtils.getPropertyName((PsiMethod)element); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/AnnotatedMembersSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/AnnotatedMembersSearcher.java index a7b6f4014a15..f9dcf906df2e 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/AnnotatedMembersSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/AnnotatedMembersSearcher.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 org.jetbrains.plugins.groovy.findUsages; import com.intellij.openapi.application.ApplicationManager; @@ -70,7 +56,7 @@ public class AnnotatedMembersSearcher implements QueryExecutor consumer) { + public boolean execute(@NotNull final AnnotatedElementsSearch.Parameters p, @NotNull final Processor consumer) { final PsiClass annClass = p.getAnnotationClass(); assert annClass.isAnnotationType() : "Annotation type should be passed to annotated members search"; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/ConstructorReferencesSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/ConstructorReferencesSearcher.java index 50badf95137f..a9d53d1a149e 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/ConstructorReferencesSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/ConstructorReferencesSearcher.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 org.jetbrains.plugins.groovy.findUsages; import com.intellij.openapi.application.QueryExecutorBase; @@ -32,7 +18,7 @@ public class ConstructorReferencesSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull Processor consumer) { final PsiElement element = queryParameters.getElementToSearch(); if (element instanceof PsiMethod) { final PsiMethod method = (PsiMethod)element; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GDKSuperMethodSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GDKSuperMethodSearcher.java index 9aa6e6d21ccc..f84b77288b1b 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GDKSuperMethodSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GDKSuperMethodSearcher.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 org.jetbrains.plugins.groovy.findUsages; @@ -47,7 +33,7 @@ public class GDKSuperMethodSearcher implements QueryExecutor consumer) { + public boolean execute(@NotNull SuperMethodsSearch.SearchParameters queryParameters, @NotNull Processor consumer) { final PsiMethod method = queryParameters.getMethod(); if (!(method instanceof GrMethod)) { return true; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GrAliasedImportedElementSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GrAliasedImportedElementSearcher.java index 84961dab3c61..265ce6314016 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GrAliasedImportedElementSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GrAliasedImportedElementSearcher.java @@ -23,7 +23,7 @@ public class GrAliasedImportedElementSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters parameters, @NotNull Processor consumer) { final PsiElement target = parameters.getElementToSearch(); if (!(target instanceof PsiMember) || !(target instanceof PsiNamedElement)) return; @@ -64,7 +64,7 @@ public class GrAliasedImportedElementSearcher extends QueryExecutorBase consumer) { + public boolean processTextOccurrence(@NotNull final PsiElement element, int offsetInElement, @NotNull Processor consumer) { String alias = getAlias(element); if (alias == null) return true; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GrLiteralMethodSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GrLiteralMethodSearcher.java index e6f4481965c6..3ca224ca2e82 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GrLiteralMethodSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GrLiteralMethodSearcher.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 org.jetbrains.plugins.groovy.findUsages; import com.intellij.openapi.application.QueryExecutorBase; @@ -34,7 +20,7 @@ import java.util.List; */ public class GrLiteralMethodSearcher extends QueryExecutorBase { @Override - public void processQuery(@NotNull MethodReferencesSearch.SearchParameters p, @NotNull Processor consumer) { + public void processQuery(@NotNull MethodReferencesSearch.SearchParameters p, @NotNull Processor consumer) { final PsiMethod method = p.getMethod(); final PsiClass aClass = method.getContainingClass(); if (aClass == null) return; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyConstructorUsagesSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyConstructorUsagesSearcher.java index 0da8fcb15bc7..89036689dc3b 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyConstructorUsagesSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyConstructorUsagesSearcher.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 org.jetbrains.plugins.groovy.findUsages; @@ -63,14 +49,14 @@ public class GroovyConstructorUsagesSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull MethodReferencesSearch.SearchParameters p, @NotNull Processor consumer) { processConstructorUsages(p.getMethod(), p.getEffectiveSearchScope(), consumer, p.getOptimizer(), !p.isStrictSignatureSearch()); } public static final Key> LITERALLY_CONSTRUCTED_CLASSES = Key.create("LITERALLY_CONSTRUCTED_CLASSES"); static void processConstructorUsages(final PsiMethod constructor, final SearchScope searchScope, - final Processor consumer, + final Processor consumer, final SearchRequestCollector collector, final boolean includeOverloads) { if (!constructor.isConstructor()) return; @@ -210,7 +196,7 @@ public class GroovyConstructorUsagesSearcher extends QueryExecutorBase consumer, final PsiClass clazz, + private static boolean processConstructors(final PsiMethod searchedConstructor, final Processor consumer, final PsiClass clazz, final boolean processThisRefs) { final PsiMethod[] constructors = clazz.getConstructors(); if (constructors.length == 0) { @@ -238,7 +224,7 @@ public class GroovyConstructorUsagesSearcher extends QueryExecutorBase processor, + final Processor processor, final PsiMethod constructor) { if (constructor instanceof GrMethod) { GrParameter[] grParameters = (GrParameter[])constructor.getParameterList().getParameters(); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyImplementationSearch.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyImplementationSearch.java index 3659826ff2e7..e3ac06695c43 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyImplementationSearch.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyImplementationSearch.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 org.jetbrains.plugins.groovy.findUsages; import com.intellij.codeInsight.navigation.MethodImplementationsSearch; @@ -34,7 +20,7 @@ import org.jetbrains.plugins.groovy.lang.psi.util.GroovyPropertyUtils; */ public class GroovyImplementationSearch implements QueryExecutor { @Override - public boolean execute(@NotNull final DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { return ReadAction.compute(() -> { final PsiElement source = queryParameters.getElement(); if (!source.isValid()) return true; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyReflectedMethodReferenceSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyReflectedMethodReferenceSearcher.java index 2245ef2f781e..f843fb6fdf4b 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyReflectedMethodReferenceSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyReflectedMethodReferenceSearcher.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 org.jetbrains.plugins.groovy.findUsages; import com.intellij.openapi.application.QueryExecutorBase; @@ -33,7 +19,7 @@ public class GroovyReflectedMethodReferenceSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull MethodReferencesSearch.SearchParameters queryParameters, @NotNull Processor consumer) { final PsiMethod method = queryParameters.getMethod(); if (method instanceof GrMethod) { for (GrReflectedMethod reflectedMethod : ((GrMethod)method).getReflectedMethods()) { diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyTraitFieldSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyTraitFieldSearcher.java index 90360044af5e..2dd595d6ae1d 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyTraitFieldSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/GroovyTraitFieldSearcher.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 org.jetbrains.plugins.groovy.findUsages; import com.intellij.openapi.application.QueryExecutorBase; @@ -33,7 +19,7 @@ public class GroovyTraitFieldSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters p, @NotNull Processor consumer) { final PsiElement target = p.getElementToSearch(); if (target instanceof GrField && !(target instanceof GrTraitField)) { @@ -58,7 +44,7 @@ public class GroovyTraitFieldSearcher extends QueryExecutorBase consumer) { + @NotNull Processor consumer) { PsiElement parent = element.getParent(); if (parent instanceof GrReferenceExpression && element == ((GrReferenceExpression)parent).getReferenceNameElement()) { PsiElement resolved = ((GrReferenceExpression)parent).resolve(); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/LiteralConstructorSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/LiteralConstructorSearcher.java index fedd70a311df..4a1d9e81d7c8 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/LiteralConstructorSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/LiteralConstructorSearcher.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 org.jetbrains.plugins.groovy.findUsages; import com.intellij.psi.PsiClass; @@ -27,10 +13,10 @@ import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrListOrMap; */ public class LiteralConstructorSearcher { private final PsiMethod myConstructor; - private final Processor myConsumer; + private final Processor myConsumer; private final boolean myIncludeOverloads; - public LiteralConstructorSearcher(PsiMethod constructor, Processor consumer, boolean includeOverloads) { + public LiteralConstructorSearcher(PsiMethod constructor, Processor consumer, boolean includeOverloads) { myConstructor = constructor; myConsumer = consumer; myIncludeOverloads = includeOverloads; diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/MethodLateBoundReferencesSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/MethodLateBoundReferencesSearcher.java index 8f73f52cec4d..ef2ffb9774b2 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/MethodLateBoundReferencesSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/MethodLateBoundReferencesSearcher.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 org.jetbrains.plugins.groovy.findUsages; @@ -27,7 +13,6 @@ import com.intellij.psi.PsiMethod; import com.intellij.psi.PsiReference; import com.intellij.psi.search.*; import com.intellij.psi.search.searches.MethodReferencesSearch; -import com.intellij.psi.util.PropertyUtil; import com.intellij.psi.util.PropertyUtilBase; import com.intellij.util.Processor; import org.jetbrains.annotations.NotNull; @@ -50,7 +35,7 @@ public class MethodLateBoundReferencesSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull MethodReferencesSearch.SearchParameters queryParameters, @NotNull Processor consumer) { final PsiMethod method = queryParameters.getMethod(); SearchScope searchScope = GroovyScopeUtil.restrictScopeToGroovyFiles(queryParameters.getEffectiveSearchScope()).intersectWith( getUseScope(method)); @@ -84,7 +69,7 @@ public class MethodLateBoundReferencesSearcher extends QueryExecutorBase consumer) { + public boolean processTextOccurrence(@NotNull PsiElement element, int offsetInElement, @NotNull Processor consumer) { if (!(element instanceof GrReferenceExpression)) { return true; } diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/PropertyMethodReferenceSearchExecutor.kt b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/PropertyMethodReferenceSearchExecutor.kt index bec9ad42854c..f4a684cc1bc4 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/PropertyMethodReferenceSearchExecutor.kt +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/findUsages/PropertyMethodReferenceSearchExecutor.kt @@ -19,7 +19,7 @@ import org.jetbrains.plugins.groovy.lang.psi.util.GroovyPropertyUtils */ class PropertyMethodReferenceSearchExecutor : QueryExecutorBase(true) { - override fun processQuery(queryParameters: MethodReferencesSearch.SearchParameters, consumer: Processor) { + override fun processQuery(queryParameters: MethodReferencesSearch.SearchParameters, consumer: Processor) { val method = queryParameters.method val propertyName: String? = if (GdkMethodUtil.isCategoryMethod(method, null, null, PsiSubstitutor.EMPTY)) { diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyDirectInheritorsSearcher.java b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyDirectInheritorsSearcher.java index 6980e4c583bf..339c9446a464 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyDirectInheritorsSearcher.java +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/GroovyDirectInheritorsSearcher.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 org.jetbrains.plugins.groovy.lang.psi.impl; import com.intellij.openapi.project.DumbService; @@ -68,7 +54,7 @@ public class GroovyDirectInheritorsSearcher implements QueryExecutor consumer) { + public boolean execute(@NotNull final DirectClassInheritorsSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { final PsiClass clazz = queryParameters.getClassToProcess(); final SearchScope scope = queryParameters.getScope(); Project project = PsiUtilCore.getProjectInReadAction(clazz); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/indexedProperty/IndexedPropertyReferenceSearchExecutor.kt b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/indexedProperty/IndexedPropertyReferenceSearchExecutor.kt index 06355ef9d54f..e22cca1e237e 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/indexedProperty/IndexedPropertyReferenceSearchExecutor.kt +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/indexedProperty/IndexedPropertyReferenceSearchExecutor.kt @@ -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 org.jetbrains.plugins.groovy.transformations.indexedProperty import com.intellij.openapi.application.runReadAction @@ -25,7 +11,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrField class IndexedPropertyReferenceSearchExecutor : QueryExecutor { - override fun execute(queryParameters: ReferencesSearch.SearchParameters, consumer: Processor): Boolean { + override fun execute(queryParameters: ReferencesSearch.SearchParameters, consumer: Processor): Boolean { val field = queryParameters.elementToSearch if (field is GrField) { runReadAction { diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxControllerFieldSearcher.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxControllerFieldSearcher.java index e2e42d213d81..6732b13e67ff 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxControllerFieldSearcher.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxControllerFieldSearcher.java @@ -1,18 +1,4 @@ -/* - * 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 org.jetbrains.plugins.javaFX.fxml.refs; import com.intellij.openapi.application.ApplicationManager; @@ -35,7 +21,7 @@ import java.util.List; public class JavaFxControllerFieldSearcher implements QueryExecutor{ @Override - public boolean execute(@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { final PsiElement elementToSearch = queryParameters.getElementToSearch(); if (elementToSearch instanceof PsiField) { final PsiField field = (PsiField)elementToSearch; diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxMethodSearcher.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxMethodSearcher.java index d6e982246b31..713b60c46fb7 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxMethodSearcher.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxMethodSearcher.java @@ -1,18 +1,4 @@ -/* - * 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 org.jetbrains.plugins.javaFX.fxml.refs; import com.intellij.openapi.application.ReadAction; @@ -44,7 +30,7 @@ import org.jetbrains.plugins.javaFX.refactoring.JavaFxPropertyElement; public class JavaFxMethodSearcher implements QueryExecutor { @Override public boolean execute(@NotNull final ReferencesSearch.SearchParameters queryParameters, - @NotNull final Processor consumer) { + @NotNull final Processor consumer) { final PsiElement elementToSearch = queryParameters.getElementToSearch(); if (elementToSearch instanceof PsiMethod) { searchMethod((PsiMethod)elementToSearch, queryParameters, consumer); @@ -61,7 +47,7 @@ public class JavaFxMethodSearcher implements QueryExecutor consumer) { + @NotNull Processor consumer) { final Project project = PsiUtilCore.getProjectInReadAction(psiMethod); final SearchScope scope = ReadAction.compute(queryParameters::getEffectiveSearchScope); @@ -100,7 +86,7 @@ public class JavaFxMethodSearcher implements QueryExecutor consumer) { + @NotNull Processor consumer) { final Ref stopped = new Ref<>(false); file.accept(new XmlRecursiveElementVisitor() { @Override diff --git a/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesInheritorsSearcher.java b/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesInheritorsSearcher.java index 9ddc865c55d1..c123859634dc 100644 --- a/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesInheritorsSearcher.java +++ b/plugins/properties/src/com/intellij/lang/properties/editor/PropertiesInheritorsSearcher.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.lang.properties.editor; import com.intellij.lang.properties.IProperty; @@ -40,7 +26,7 @@ public class PropertiesInheritorsSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor consumer) { final PsiElement element = queryParameters.getElement(); Property prop = ReadAction.compute(() -> GotoPropertyParentDeclarationHandler.findProperty(element)); if (prop == null || !(queryParameters.getScope() instanceof GlobalSearchScope)) { diff --git a/plugins/testng/src/com/theoryinpractice/testng/DataProviderSearcher.java b/plugins/testng/src/com/theoryinpractice/testng/DataProviderSearcher.java index 62dffdb5a63b..55281cb5f727 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/DataProviderSearcher.java +++ b/plugins/testng/src/com/theoryinpractice/testng/DataProviderSearcher.java @@ -1,24 +1,13 @@ -/* - * 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.theoryinpractice.testng; import com.intellij.codeInsight.AnnotationUtil; import com.intellij.openapi.application.QueryExecutorBase; import com.intellij.openapi.util.text.StringUtil; -import com.intellij.psi.*; +import com.intellij.psi.PsiAnnotation; +import com.intellij.psi.PsiAnnotationMemberValue; +import com.intellij.psi.PsiMethod; +import com.intellij.psi.PsiReference; import com.intellij.psi.search.UsageSearchContext; import com.intellij.psi.search.searches.MethodReferencesSearch; import com.intellij.util.Processor; @@ -31,7 +20,7 @@ public class DataProviderSearcher extends QueryExecutorBase consumer) { + public void processQuery(@NotNull MethodReferencesSearch.SearchParameters queryParameters, @NotNull Processor consumer) { final PsiMethod method = queryParameters.getMethod(); final PsiAnnotation annotation = AnnotationUtil.findAnnotation(method, DataProvider.class.getName()); diff --git a/plugins/ui-designer/src/com/intellij/uiDesigner/binding/FormReferencesSearcher.java b/plugins/ui-designer/src/com/intellij/uiDesigner/binding/FormReferencesSearcher.java index 7b37a3df9f8d..bd0a6a72506a 100644 --- a/plugins/ui-designer/src/com/intellij/uiDesigner/binding/FormReferencesSearcher.java +++ b/plugins/ui-designer/src/com/intellij/uiDesigner/binding/FormReferencesSearcher.java @@ -33,7 +33,7 @@ import java.util.List; */ public class FormReferencesSearcher implements QueryExecutor { @Override - public boolean execute(@NotNull final ReferencesSearch.SearchParameters p, @NotNull final Processor consumer) { + public boolean execute(@NotNull final ReferencesSearch.SearchParameters p, @NotNull final Processor consumer) { SearchScope userScope = p.getScopeDeterminedByUser(); if (!scopeCanContainForms(userScope)) return true; final PsiElement refElement = p.getElementToSearch(); @@ -104,7 +104,7 @@ public class FormReferencesSearcher implements QueryExecutor processor, + private static boolean processReferencesInUIForms(Processor processor, PsiManager psiManager, final PsiClass aClass, GlobalSearchScope scope, final LocalSearchScope filterScope) { String className = getQualifiedName(aClass); @@ -118,7 +118,7 @@ public class FormReferencesSearcher implements QueryExecutor processor, + private static boolean processEnumReferencesInUIForms(Processor processor, PsiManager psiManager, final PsiEnumConstant enumConstant, GlobalSearchScope scope, final LocalSearchScope filterScope) { String className = ReadAction.compute(() -> enumConstant.getName()); @@ -127,7 +127,7 @@ public class FormReferencesSearcher implements QueryExecutor processor, + Processor processor, GlobalSearchScope scope1, PsiManager manager, final LocalSearchScope filterScope) { @@ -137,7 +137,7 @@ public class FormReferencesSearcher implements QueryExecutor processor, + private static boolean processReferencesInUIForms(Processor processor, PsiManager psiManager, PsiField field, GlobalSearchScope scope1, @@ -150,7 +150,7 @@ public class FormReferencesSearcher implements QueryExecutor processor, + private static boolean processReferences(final Processor processor, final PsiFile file, String name, final PsiElement element, @@ -190,7 +190,7 @@ public class FormReferencesSearcher implements QueryExecutor processor, + private static boolean processReferencesInUIForms(final Processor processor, PsiManager psiManager, final Property property, final GlobalSearchScope globalSearchScope, @@ -228,7 +228,7 @@ public class FormReferencesSearcher implements QueryExecutor processor, + private static boolean processReferencesInUIForms(final Processor processor, PsiManager psiManager, final PropertiesFile propFile, final GlobalSearchScope globalSearchScope, @@ -246,7 +246,7 @@ public class FormReferencesSearcher implements QueryExecutor processor) { + Processor processor) { psiManager.startBatchFilesProcessingMode(); try { diff --git a/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbSearchExecutor.java b/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbSearchExecutor.java index f513ab7eb4b5..4b2e668773a7 100644 --- a/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbSearchExecutor.java +++ b/python/ipnb/src/org/jetbrains/plugins/ipnb/psi/IpnbSearchExecutor.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 org.jetbrains.plugins.ipnb.psi; import com.intellij.openapi.application.QueryExecutorBase; @@ -36,7 +22,7 @@ import java.util.List; public class IpnbSearchExecutor extends QueryExecutorBase { @Override - public void processQuery(@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public void processQuery(@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { final SearchScope scope = queryParameters.getEffectiveSearchScope(); if (scope instanceof LocalSearchScope) return; final PsiElement element = queryParameters.getElementToSearch(); diff --git a/python/pluginJava/com/jetbrains/python/psi/impl/PyJavaSuperMethodsSearchExecutor.java b/python/pluginJava/com/jetbrains/python/psi/impl/PyJavaSuperMethodsSearchExecutor.java index 9386fcf13a70..e7a93d87aca6 100644 --- a/python/pluginJava/com/jetbrains/python/psi/impl/PyJavaSuperMethodsSearchExecutor.java +++ b/python/pluginJava/com/jetbrains/python/psi/impl/PyJavaSuperMethodsSearchExecutor.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.jetbrains.python.psi.impl; import com.intellij.psi.PsiClass; @@ -32,7 +18,7 @@ import org.jetbrains.annotations.NotNull; * @author yole */ public class PyJavaSuperMethodsSearchExecutor implements QueryExecutor { - public boolean execute(@NotNull final PySuperMethodsSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final PySuperMethodsSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { PyFunction func = queryParameters.getDerivedMethod(); PyClass containingClass = func.getContainingClass(); if (containingClass != null) { diff --git a/python/src/com/jetbrains/python/magicLiteral/PyMagicLiteralReferenceSearcher.java b/python/src/com/jetbrains/python/magicLiteral/PyMagicLiteralReferenceSearcher.java index 5bd9ad969f7d..69f0df319923 100644 --- a/python/src/com/jetbrains/python/magicLiteral/PyMagicLiteralReferenceSearcher.java +++ b/python/src/com/jetbrains/python/magicLiteral/PyMagicLiteralReferenceSearcher.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.jetbrains.python.magicLiteral; import com.intellij.openapi.application.ApplicationManager; @@ -34,7 +20,7 @@ import org.jetbrains.annotations.NotNull; class PyMagicLiteralReferenceSearcher extends QueryExecutorBase { @Override - public void processQuery(@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public void processQuery(@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { ApplicationManager.getApplication().runReadAction(() -> { final PsiElement refElement = queryParameters.getElementToSearch(); if (PyMagicLiteralTools.isMagicLiteral(refElement)) { diff --git a/python/src/com/jetbrains/python/psi/search/PyClassInheritorsSearchExecutor.java b/python/src/com/jetbrains/python/psi/search/PyClassInheritorsSearchExecutor.java index 20a23087283c..42b37a9788fc 100644 --- a/python/src/com/jetbrains/python/psi/search/PyClassInheritorsSearchExecutor.java +++ b/python/src/com/jetbrains/python/psi/search/PyClassInheritorsSearchExecutor.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.jetbrains.python.psi.search; import com.google.common.collect.ImmutableSet; @@ -40,13 +26,13 @@ public class PyClassInheritorsSearchExecutor implements QueryExecutor IGNORED_BASES = ImmutableSet.of("object", "BaseException", "Exception"); - public boolean execute(@NotNull final PyClassInheritorsSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final PyClassInheritorsSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { Set processed = new HashSet<>(); return processDirectInheritors(queryParameters.getSuperClass(), consumer, queryParameters.isCheckDeepInheritance(), processed); } private static boolean processDirectInheritors( - final PyClass superClass, final Processor consumer, final boolean checkDeep, final Set processed + final PyClass superClass, final Processor consumer, final boolean checkDeep, final Set processed ) { return ReadAction.compute(() -> { final String superClassName = superClass.getName(); diff --git a/python/src/com/jetbrains/python/psi/search/PyClassReferenceSearchExecutor.java b/python/src/com/jetbrains/python/psi/search/PyClassReferenceSearchExecutor.java index 51249fdb98b0..dc99e6047e45 100644 --- a/python/src/com/jetbrains/python/psi/search/PyClassReferenceSearchExecutor.java +++ b/python/src/com/jetbrains/python/psi/search/PyClassReferenceSearchExecutor.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.jetbrains.python.psi.search; import com.google.common.base.Strings; @@ -32,7 +18,7 @@ import com.jetbrains.python.psi.PyUtil; import org.jetbrains.annotations.NotNull; public class PyClassReferenceSearchExecutor extends QueryExecutorBase { - public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { PyClass pyClass = PyUtil.as(queryParameters.getElementToSearch(), PyClass.class); if (pyClass == null) { return; diff --git a/python/src/com/jetbrains/python/psi/search/PyDefinitionsSearch.java b/python/src/com/jetbrains/python/psi/search/PyDefinitionsSearch.java index eea9956b4a17..189402f491f5 100644 --- a/python/src/com/jetbrains/python/psi/search/PyDefinitionsSearch.java +++ b/python/src/com/jetbrains/python/psi/search/PyDefinitionsSearch.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.psi.search; import com.intellij.openapi.application.ReadAction; @@ -30,7 +16,7 @@ import org.jetbrains.annotations.NotNull; * @author yole */ public class PyDefinitionsSearch implements QueryExecutor { - public boolean execute(@NotNull final PsiElement queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final PsiElement queryParameters, @NotNull final Processor consumer) { if (queryParameters instanceof PyClass) { final Query query = PyClassInheritorsSearch.search((PyClass)queryParameters, true); return query.forEach(pyClass -> { diff --git a/python/src/com/jetbrains/python/psi/search/PyInitReferenceSearchExecutor.java b/python/src/com/jetbrains/python/psi/search/PyInitReferenceSearchExecutor.java index 1d86dbc8befc..c5dbead5a2f6 100644 --- a/python/src/com/jetbrains/python/psi/search/PyInitReferenceSearchExecutor.java +++ b/python/src/com/jetbrains/python/psi/search/PyInitReferenceSearchExecutor.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.jetbrains.python.psi.search; import com.intellij.openapi.application.ApplicationManager; @@ -34,7 +20,7 @@ import org.jetbrains.annotations.NotNull; * @author yole */ public class PyInitReferenceSearchExecutor extends QueryExecutorBase { - public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public void processQuery(@NotNull ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { PsiElement element = queryParameters.getElementToSearch(); if (!(element instanceof PyFunction)) { return; diff --git a/python/src/com/jetbrains/python/psi/search/PyKeywordArgumentSearchExecutor.java b/python/src/com/jetbrains/python/psi/search/PyKeywordArgumentSearchExecutor.java index 29ecf0a7178c..662388fcfb4f 100644 --- a/python/src/com/jetbrains/python/psi/search/PyKeywordArgumentSearchExecutor.java +++ b/python/src/com/jetbrains/python/psi/search/PyKeywordArgumentSearchExecutor.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.jetbrains.python.psi.search; import com.intellij.openapi.application.QueryExecutorBase; @@ -32,7 +18,7 @@ import org.jetbrains.annotations.NotNull; */ public class PyKeywordArgumentSearchExecutor extends QueryExecutorBase { @Override - public void processQuery(@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { + public void processQuery(@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor consumer) { final PsiElement element = queryParameters.getElementToSearch(); if (!(element instanceof PyNamedParameter)) { return; diff --git a/python/src/com/jetbrains/python/psi/search/PyOverridingMethodsSearchExecutor.java b/python/src/com/jetbrains/python/psi/search/PyOverridingMethodsSearchExecutor.java index 347d4f35a5e3..2ac881ebeadd 100644 --- a/python/src/com/jetbrains/python/psi/search/PyOverridingMethodsSearchExecutor.java +++ b/python/src/com/jetbrains/python/psi/search/PyOverridingMethodsSearchExecutor.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.psi.search; import com.intellij.openapi.application.ReadAction; @@ -26,7 +12,7 @@ import org.jetbrains.annotations.NotNull; */ public class PyOverridingMethodsSearchExecutor implements QueryExecutor { public boolean execute(@NotNull final PyOverridingMethodsSearch.SearchParameters queryParameters, - @NotNull final Processor consumer) { + @NotNull final Processor consumer) { final PyFunction baseMethod = queryParameters.getFunction(); final PyClass containingClass = ReadAction.compute(() -> baseMethod.getContainingClass()); diff --git a/python/src/com/jetbrains/python/psi/search/PyStringReferenceSearch.java b/python/src/com/jetbrains/python/psi/search/PyStringReferenceSearch.java index 80fe44736aca..69fcc363cf90 100644 --- a/python/src/com/jetbrains/python/psi/search/PyStringReferenceSearch.java +++ b/python/src/com/jetbrains/python/psi/search/PyStringReferenceSearch.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.jetbrains.python.psi.search; import com.intellij.openapi.application.QueryExecutorBase; @@ -40,7 +26,7 @@ public class PyStringReferenceSearch extends QueryExecutorBase consumer) { + @NotNull final Processor consumer) { final PsiElement element = params.getElementToSearch(); if (!(element instanceof PyElement) && !(element instanceof PsiDirectory)) { return; diff --git a/python/src/com/jetbrains/python/psi/search/PySuperMethodsSearchExecutor.java b/python/src/com/jetbrains/python/psi/search/PySuperMethodsSearchExecutor.java index 853b40f402c8..e95e47ae73c7 100644 --- a/python/src/com/jetbrains/python/psi/search/PySuperMethodsSearchExecutor.java +++ b/python/src/com/jetbrains/python/psi/search/PySuperMethodsSearchExecutor.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.jetbrains.python.psi.search; import com.intellij.psi.PsiElement; @@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull; public class PySuperMethodsSearchExecutor implements QueryExecutor { @Override public boolean execute(@NotNull final PySuperMethodsSearch.SearchParameters queryParameters, - @NotNull final Processor consumer) { + @NotNull final Processor consumer) { final PyFunction func = queryParameters.getDerivedMethod(); final String name = func.getName(); final PyClass containingClass = func.getContainingClass(); diff --git a/xml/impl/src/com/intellij/xml/impl/schema/SchemaDefinitionsSearch.java b/xml/impl/src/com/intellij/xml/impl/schema/SchemaDefinitionsSearch.java index 838c419fae7b..27ee2b008a5a 100644 --- a/xml/impl/src/com/intellij/xml/impl/schema/SchemaDefinitionsSearch.java +++ b/xml/impl/src/com/intellij/xml/impl/schema/SchemaDefinitionsSearch.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.xml.impl.schema; import com.intellij.openapi.application.ApplicationManager; @@ -44,7 +30,7 @@ import java.util.function.BiFunction; public class SchemaDefinitionsSearch implements QueryExecutor { @Override - public boolean execute(@NotNull final PsiElement queryParameters, @NotNull final Processor consumer) { + public boolean execute(@NotNull final PsiElement queryParameters, @NotNull final Processor consumer) { if (queryParameters instanceof XmlTagImpl) { final XmlTagImpl xml = (XmlTagImpl) queryParameters; if (ReadAction.compute(() -> isTypeElement(xml))) {