local redundant throws should respect exception subclasses when checking inherited method exceptions (add test)

This commit is contained in:
Dmitry Batkovich
2018-07-02 18:44:15 +03:00
parent 89e0474bad
commit e34c1fed9e
@@ -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");
}
}
}