mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
CR-IA-226 ImportFilter: make targetFile parameter not null
This commit is contained in:
+1
-1
@@ -121,7 +121,7 @@ public abstract class ImportClassFixBase<T extends PsiElement, R extends PsiRefe
|
||||
String qName = aClass.getQualifiedName();
|
||||
if (qName != null) { //filter local classes
|
||||
if (qName.indexOf('.') == -1) continue; //do not show classes from default package)
|
||||
if (qName.endsWith(name) && ImportFilter.shouldImport(file, qName)) {
|
||||
if (qName.endsWith(name) && (file == null || ImportFilter.shouldImport(file, qName))) {
|
||||
if (isAccessible(aClass, myElement)) {
|
||||
classList.add(aClass);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.intellij.codeInsight;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author Eugene.Kudelevsky
|
||||
@@ -11,9 +10,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
public abstract class ImportFilter {
|
||||
public static final ExtensionPointName<ImportFilter> EP_NAME = new ExtensionPointName<ImportFilter>("com.intellij.importFilter");
|
||||
|
||||
public abstract boolean shouldUseFullyQualifiedName(@Nullable PsiFile targetFile, @NotNull String classQualifiedName);
|
||||
public abstract boolean shouldUseFullyQualifiedName(@NotNull PsiFile targetFile, @NotNull String classQualifiedName);
|
||||
|
||||
public static boolean shouldImport(@Nullable PsiFile targetFile, @NotNull String classQualifiedName) {
|
||||
public static boolean shouldImport(@NotNull PsiFile targetFile, @NotNull String classQualifiedName) {
|
||||
for (ImportFilter filter : EP_NAME.getExtensions()) {
|
||||
if (filter.shouldUseFullyQualifiedName(targetFile, classQualifiedName)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user