mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
junit 5 migration: allow if jdk >= 1.8 and any language level (IDEA-163544)
This commit is contained in:
@@ -21,10 +21,11 @@ import com.intellij.codeInspection.*;
|
||||
import com.intellij.codeInspection.actions.CleanupInspectionIntention;
|
||||
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.JavaVersionService;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.refactoring.RefactoringManager;
|
||||
import com.intellij.refactoring.migration.MigrationManager;
|
||||
import com.intellij.refactoring.migration.MigrationMap;
|
||||
@@ -64,7 +65,7 @@ public class JUnit5ConverterInspection extends BaseInspection {
|
||||
|
||||
@Override
|
||||
public boolean shouldInspect(PsiFile file) {
|
||||
if (!PsiUtil.isLanguageLevel8OrHigher(file)) return false;
|
||||
if (!JavaVersionService.getInstance().isAtLeast(file, JavaSdkVersion.JDK_1_8)) return false;
|
||||
if (JavaPsiFacade.getInstance(file.getProject()).findClass(JUnitCommonClassNames.ORG_JUNIT_JUPITER_API_ASSERTIONS, file.getResolveScope()) == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user