mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[java] IDEA-354964 Migrate standard descriptors like JAVA_21 to TYPE_USE annotations
- fix NullableManager, when it can't find annotation in type GitOrigin-RevId: 121927429534971abb4a50d1f670afbed9384045
This commit is contained in:
committed by
intellij-monorepo-bot
parent
638393e895
commit
330ba98e01
@@ -9,8 +9,8 @@ abstract class P2 {
|
||||
}
|
||||
|
||||
Object o = new P2() {
|
||||
@NotNull
|
||||
@Override
|
||||
@NotNull
|
||||
String foo(String p) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@ import org.jetbrains.annotations.NonNls;
|
||||
|
||||
// "Annotate method 'doTest()' as '@NonNls'" "true-preview"
|
||||
class Foo {
|
||||
@NonNls
|
||||
public String doTest() {
|
||||
public @NonNls String doTest() {
|
||||
return "text";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class Mixed {
|
||||
}
|
||||
|
||||
// Error due to mock limitation
|
||||
<error descr="'@NotNull' not applicable to annotation type">@NotNull</error>
|
||||
@NotNull
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@TypeQualifierDefault({ ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD, ElementType.TYPE_USE })
|
||||
|
||||
@@ -28,7 +28,7 @@ class TooComplexCode {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private TooComplexCode.X newMethod(@NotNull X x) {
|
||||
private X newMethod(@NotNull X x) {
|
||||
return x.get();
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public class NullableCheckBreakDuplicate {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private NullableCheckBreakDuplicate.Pojo newMethod() {
|
||||
private Pojo newMethod() {
|
||||
Pojo x = things.get(0);
|
||||
|
||||
if (x.it > 0) return null;
|
||||
|
||||
@@ -4,8 +4,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
class B {
|
||||
public final A myDelegate = new A();
|
||||
|
||||
@Nullable
|
||||
public Object methodFromA(@NotNull String s) {
|
||||
public @Nullable Object methodFromA(@NotNull String s) {
|
||||
return myDelegate.methodFromA(s);
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,8 @@ public class MakeInferredAnnotationExplicitTest extends LightJavaCodeInsightFixt
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class Foo {
|
||||
@NotNull
|
||||
@Contract(pure = true)
|
||||
static String f<caret>oo() {
|
||||
static @NotNull String f<caret>oo() {
|
||||
return "s";
|
||||
}
|
||||
}""");
|
||||
|
||||
@@ -24,7 +24,10 @@ import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
|
||||
import com.intellij.psi.codeStyle.JavaCodeStyleSettings;
|
||||
import com.intellij.psi.impl.light.LightMethodBuilder;
|
||||
import com.intellij.psi.impl.source.PsiExtensibleClass;
|
||||
import com.intellij.testFramework.*;
|
||||
import com.intellij.testFramework.IdeaTestUtil;
|
||||
import com.intellij.testFramework.LightProjectDescriptor;
|
||||
import com.intellij.testFramework.NeedsIndex;
|
||||
import com.intellij.testFramework.ServiceContainerUtil;
|
||||
import com.intellij.tools.ide.metrics.benchmark.PerformanceTestUtil;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
@@ -2882,7 +2885,7 @@ public class NormalCompletionTest extends NormalCompletionTestCase {
|
||||
}
|
||||
""");
|
||||
myFixture.completeBasic();
|
||||
assertEquals(List.of("NonNls", "NotNull"), myFixture.getLookupElementStrings());
|
||||
assertEquals(List.of("NonNls", "NotNull", "UnknownNullability"), myFixture.getLookupElementStrings());
|
||||
}
|
||||
|
||||
@NeedsIndex.Full
|
||||
|
||||
Reference in New Issue
Block a user