mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-analysis] IDEA-381010 follow-up: better error message when older preview level is used
GitOrigin-RevId: b60494217caf0894c3ab1c6f0953db967e243bd8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
63f8fd27cc
commit
ff551067cf
+1
-1
@@ -59,7 +59,7 @@ public final class PreviewFeatureInspection extends LocalInspectionTool {
|
||||
String name = owner instanceof PsiClass cls ?
|
||||
cls.getQualifiedName() :
|
||||
Objects.requireNonNull(owner.getContainingClass()).getQualifiedName() + "#" + owner.getName();
|
||||
holder.registerProblem(element, JavaBundle.message("preview.api.usage", name));
|
||||
holder.registerProblem(element, JavaBundle.message("preview.api.usage.old.jdk", name, level.feature()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
import <warning descr="java.util.stream.Gatherers is a preview API and may be removed in a future release">java.util.stream.Gatherers</warning>;
|
||||
import <warning descr="java.util.stream.Gatherers was in preview in JDK 22">java.util.stream.Gatherers</warning>;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Main {
|
||||
public static void main(String[] args) {
|
||||
<warning descr="java.util.stream.Stream#gather is a preview API and may be removed in a future release">Stream.of(1, 2, 3).gather</warning>(<warning descr="java.util.stream.Gatherers is a preview API and may be removed in a future release">Gatherers</warning>.windowFixed(3)).forEach(System.out::println);
|
||||
<warning descr="java.util.stream.Stream#gather was in preview in JDK 22">Stream.of(1, 2, 3).gather</warning>(<warning descr="java.util.stream.Gatherers was in preview in JDK 22">Gatherers</warning>.windowFixed(3)).forEach(System.out::println);
|
||||
}
|
||||
}
|
||||
@@ -1989,6 +1989,7 @@ java.test.sum.time=Sum time: {0}
|
||||
|
||||
error.no.annotation.class.found=No annotation class found
|
||||
preview.api.usage={0} is a preview API and may be removed in a future release
|
||||
preview.api.usage.old.jdk={0} was in preview in JDK {1}
|
||||
preview.api.usage.reflective={0} is a reflective preview API and may be removed in a future release
|
||||
todo.0=todo "{0}"
|
||||
todo.item=todo item
|
||||
|
||||
Reference in New Issue
Block a user