mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
[java-inspections] IDEA-359031 Preview API use warning: ignore imports
GitOrigin-RevId: d9ba762be3f03f60372a70471f4c04efc26a9a66
This commit is contained in:
committed by
intellij-monorepo-bot
parent
465fd6efaa
commit
8ed70be46d
@@ -8,6 +8,7 @@ import com.intellij.pom.java.JavaFeature;
|
||||
import com.intellij.psi.PsiAnnotation;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.PsiImportStatementBase;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -39,6 +40,8 @@ public final class PreviewFeatureInspection extends LocalInspectionTool {
|
||||
|
||||
@Override
|
||||
protected void registerProblem(PsiElement element, String description, JavaFeature feature, PsiAnnotation annotation) {
|
||||
// Do not report warnings in imports, because they cannot be suppressed and javac doesn't report them
|
||||
if (element.getParent() instanceof PsiImportStatementBase) return;
|
||||
myHolder.registerProblem(element, description);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import <warning descr="com.mycom.FirstPreviewFeature is a preview API and may be removed in a future release">com.mycom.FirstPreviewFeature</warning>;
|
||||
import com.mycom.FirstPreviewFeature;
|
||||
|
||||
class Main {
|
||||
public Main(String s) { }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
import <warning descr="com.mycom.FirstPreviewFeature is a preview API and may be removed in a future release">com.mycom.FirstPreviewFeature</warning>;
|
||||
import com.mycom.FirstPreviewFeature;
|
||||
|
||||
class Main {
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user