mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
109 lines
1.3 KiB
Java
109 lines
1.3 KiB
Java
package successors;
|
|
|
|
public class TestFinallyBreakContinue {
|
|
public void f()
|
|
{
|
|
int x = 1;
|
|
a:
|
|
for (;;)
|
|
{
|
|
try
|
|
{
|
|
if (x == 1)
|
|
{
|
|
break;
|
|
} else
|
|
{
|
|
continue;
|
|
}
|
|
} catch (Exception e)
|
|
{
|
|
if (x == 1)
|
|
{
|
|
break;
|
|
} else
|
|
{
|
|
continue;
|
|
}
|
|
} finally
|
|
{
|
|
System.out.println("finally");
|
|
}
|
|
}
|
|
|
|
while (true)
|
|
{
|
|
try
|
|
{
|
|
try
|
|
{
|
|
if (x == 1)
|
|
{
|
|
break;
|
|
} else
|
|
{
|
|
continue;
|
|
}
|
|
} catch (Exception e)
|
|
{
|
|
if (x == 1)
|
|
{
|
|
break;
|
|
} else
|
|
{
|
|
continue;
|
|
}
|
|
} finally
|
|
{
|
|
System.out.println("finally");
|
|
}
|
|
} catch (Exception e)
|
|
{
|
|
System.out.println("Exception");
|
|
} finally
|
|
{
|
|
System.out.println("finally");
|
|
}
|
|
}
|
|
|
|
b:
|
|
do
|
|
{
|
|
try
|
|
{
|
|
for (int i : new int[20])
|
|
{
|
|
try
|
|
{
|
|
if (x == 1)
|
|
{
|
|
break;
|
|
} else
|
|
{
|
|
continue;
|
|
}
|
|
} catch (Exception e)
|
|
{
|
|
if (x == 1)
|
|
{
|
|
break b;
|
|
} else
|
|
{
|
|
continue b;
|
|
}
|
|
} finally
|
|
{
|
|
System.out.println("finally");
|
|
}
|
|
}
|
|
} catch (Exception e)
|
|
{
|
|
System.out.println("Exception");
|
|
} finally
|
|
{
|
|
System.out.println("finally");
|
|
}
|
|
} while (true);
|
|
}
|
|
}
|