add additional jsr test to Subroutine

This commit is contained in:
Joel Dice 2008-11-17 08:21:20 -07:00
parent 7ea5a4a64f
commit 14e509dfd2

View File

@ -10,7 +10,7 @@ public class Subroutine {
// //
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4381996 // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4381996
// //
private static void test(boolean throw_) { private static void test(boolean throw_, boolean predicate) {
int x = 42; int x = 42;
int y = 99; int y = 99;
int a = 0; int a = 0;
@ -18,6 +18,9 @@ public class Subroutine {
try { try {
int z = x + y; int z = x + y;
if (throw_) throw new DummyException(); if (throw_) throw new DummyException();
if (predicate) {
return;
}
Integer.valueOf(z).toString(); Integer.valueOf(z).toString();
} finally { } finally {
a = x + y; a = x + y;
@ -30,8 +33,9 @@ public class Subroutine {
} }
public static void main(String[] args) { public static void main(String[] args) {
test(false); test(false, false);
test(true); test(false, true);
test(true, false);
} }
private static class DummyException extends RuntimeException { } private static class DummyException extends RuntimeException { }