mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
wildcardize parameters correctly
GitOrigin-RevId: 1041f4afb9f7970c1f28f79909a5a3a8ed6750af
This commit is contained in:
committed by
intellij-monorepo-bot
parent
48022d959e
commit
679a71cd40
@@ -37,7 +37,7 @@ public final class OptimizeImportsRefactoringHelper implements RefactoringHelper
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<PsiJavaFile> prepareOperation(UsageInfo @NotNull [] usages, @NotNull List<@NotNull PsiElement> elements) {
|
||||
public Set<PsiJavaFile> prepareOperation(UsageInfo @NotNull [] usages, @NotNull List<? extends @NotNull PsiElement> elements) {
|
||||
Set<PsiJavaFile> movedFiles = ContainerUtil.map2SetNotNull(elements, e -> ObjectUtils.tryCast(e.getContainingFile(), PsiJavaFile.class));
|
||||
return ContainerUtil.union(movedFiles, prepareOperation(usages));
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
* Allows performing cleanup operations after refactoring is done e.g., optimize imports
|
||||
*/
|
||||
public interface RefactoringHelper<T> {
|
||||
ExtensionPointName<RefactoringHelper> EP_NAME = ExtensionPointName.create("com.intellij.refactoring.helper");
|
||||
ExtensionPointName<RefactoringHelper<?>> EP_NAME = ExtensionPointName.create("com.intellij.refactoring.helper");
|
||||
|
||||
/**
|
||||
* Is called before the refactoring is executed when the refactoring provides {@link BaseRefactoringProcessor#getBeforeData()}.
|
||||
@@ -22,7 +22,7 @@ public interface RefactoringHelper<T> {
|
||||
* @param usages the usages found of the elements the refactoring will be called on
|
||||
* @param elements the elements the refactoring will be called on
|
||||
*/
|
||||
T prepareOperation(UsageInfo @NotNull [] usages, @NotNull List<@NotNull PsiElement> elements);
|
||||
T prepareOperation(UsageInfo @NotNull [] usages, @NotNull List<? extends @NotNull PsiElement> elements);
|
||||
|
||||
/**
|
||||
* Is invoked in EDT, without WriteAction after refactoring is performed
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class GroovyImportOptimizerRefactoringHelper implements Refactoring
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<GroovyFile> prepareOperation(UsageInfo @NotNull [] usages, @NotNull List<@NotNull PsiElement> elements) {
|
||||
public Set<GroovyFile> prepareOperation(UsageInfo @NotNull [] usages, @NotNull List<? extends @NotNull PsiElement> elements) {
|
||||
Set<GroovyFile> movedFiles = ContainerUtil.map2SetNotNull(elements, e -> ObjectUtils.tryCast(e.getContainingFile(), GroovyFile.class));
|
||||
return ContainerUtil.union(movedFiles, prepareOperation(usages));
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ import org.jetbrains.kotlin.idea.codeInsight.shorten.prepareDelayedRequests
|
||||
|
||||
class KotlinRefactoringHelperForDelayedRequests : RefactoringHelper<Any> {
|
||||
override fun prepareOperation(
|
||||
usages: Array<out UsageInfo>,
|
||||
elements: List<PsiElement>
|
||||
usages: Array<out UsageInfo>,
|
||||
elements: List<PsiElement>
|
||||
): Any? {
|
||||
if (usages.isNotEmpty()) {
|
||||
val project = usages[0].project
|
||||
|
||||
Reference in New Issue
Block a user