Files
codeql/java/ql/test/library-tests/java7/MultiCatch/MultiCatch.java
2018-08-30 10:48:05 +01:00

44 lines
667 B
Java

import java.io.IOException;
import java.sql.SQLException;
public class MultiCatch {
public void multiCatch(boolean b) throws IOException, SQLException
{
try
{
if(b)
throw new IOException();
else
throw new SQLException();
} catch(IOException|SQLException e)
{
e.printStackTrace();
throw e;
}
}
public void multiCatch2(boolean b, boolean c) throws Exception
{
try
{
if(b)
throw new IOException();
else if(c)
throw new SQLException();
throw new Exception();
} catch(IOException|SQLException e)
{}
}
public void ordinaryCatch()
{
try
{
throw new IOException();
} catch(Exception e)
{}
}
}