mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
44 lines
667 B
Java
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)
|
|
{}
|
|
}
|
|
}
|