mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[jvm] Add test case for Java API usage inspection
Adds another test case for when a method has a certain since version but its super method has a lower since version. GitOrigin-RevId: 5962a0f2d4549b6729fe7c303798bc04b575e5c5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ab151dd3c9
commit
3a5d36c5f7
@@ -237,4 +237,21 @@ class JavaJavaApiUsageInspectionTest : JavaApiUsageInspectionTestBase() {
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
fun `test override with different since version`() {
|
||||
myFixture.setLanguageLevel(LanguageLevel.JDK_1_8)
|
||||
myFixture.testHighlighting(JvmLanguage.JAVA, """
|
||||
import java.io.FilterOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
class Main {
|
||||
public static void main(String[] args) throws IOException {
|
||||
byte[] buff = "hello\n".getBytes(StandardCharsets.UTF_8);
|
||||
System.out.write(buff); // call to PrintStream in JDK 14
|
||||
((FilterOutputStream) System.out).write(buff); // call to FilterOutputStream in JDK below 14
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user