mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 06:11:42 +07:00
local redundant throws should respect exception subclasses when checking inherited method exceptions (add test)
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
// "Remove 'Exception' from 'doIt' throws list" "false"
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
|
||||
public class Test
|
||||
{
|
||||
public static class BaseClass
|
||||
{
|
||||
public void doIt() throws Exc<caret>eption
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public static class Subclass1 extends BaseClass
|
||||
{
|
||||
@Override
|
||||
public void doIt() throws IOException
|
||||
{
|
||||
Files.createFile(Paths.get("blah"));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Subclass2 extends BaseClass
|
||||
{
|
||||
@Override
|
||||
public void doIt() throws ParseException
|
||||
{
|
||||
NumberFormat.getInstance().parse("x");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user