diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2011-08-31 10:29:34 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2011-08-31 10:29:34 +0000 |
commit | d72870bfb6b09927e10944bdd129ce18dfcf7366 (patch) | |
tree | 27f56e4d1523a8cecc8976df60155e6b8429e504 /src/test/test1/GetThrowables.java | |
parent | 76a1cba9c433e8242bb6648e72b3ed43c7a4995a (diff) | |
download | javassist-d72870bfb6b09927e10944bdd129ce18dfcf7366.tar.gz javassist-d72870bfb6b09927e10944bdd129ce18dfcf7366.zip |
JvstTest test case.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@589 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/test/test1/GetThrowables.java')
-rw-r--r-- | src/test/test1/GetThrowables.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/test/test1/GetThrowables.java b/src/test/test1/GetThrowables.java new file mode 100644 index 00000000..19e9a8a5 --- /dev/null +++ b/src/test/test1/GetThrowables.java @@ -0,0 +1,41 @@ +package test1; + +class GetThrow1 extends Exception { +} + +class GetThrow2 extends Exception { +} + +public class GetThrowables { + int k = 0; + + public void m1() throws GetThrow1, GetThrow2 { + if (k < 0) + throw new GetThrow1(); + else if (k == 1) + throw new GetThrow2(); + + k = 1; + } + + public int run() throws GetThrow2 { + int i = 0; + try { + try { + m1(); + } + catch (GetThrow1 e) { + i = 1; + throw e; + } + finally { + i += 3; + } + } + catch (GetThrow1 e2) { + ++i; + } + + return i; + } +} |