mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[java] fixing not-null instrumentation of static interface methods (IDEA-229070)
GitOrigin-RevId: d419d4a1fcec36a86b1979a2feee50cb1fa70faf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9c42c316c8
commit
2c34ddf4c9
+11
@@ -0,0 +1,11 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class InterfaceStaticMethodParameter {
|
||||
public static void test() {
|
||||
I.test(null);
|
||||
}
|
||||
|
||||
interface I {
|
||||
static void test(@NotNull String s) { }
|
||||
}
|
||||
}
|
||||
+7
@@ -380,6 +380,13 @@ public abstract class NotNullVerifyingInstrumenterTest {
|
||||
verifyNotInstrumented();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterfaceStaticMethodParameter() throws Exception {
|
||||
Class<?> testClass = prepareTest();
|
||||
Method method = testClass.getMethod("test");
|
||||
verifyCallThrowsException("Argument 0 for @NotNull parameter of InterfaceStaticMethodParameter$I.test must not be null", null, method);
|
||||
}
|
||||
|
||||
protected static void verifyCallThrowsException(String expectedError, @Nullable Object instance, Member member, Object... args) throws Exception {
|
||||
String exceptionText = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user