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/test4/LocalVars.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/test4/LocalVars.java')
-rw-r--r-- | src/test/test4/LocalVars.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/test/test4/LocalVars.java b/src/test/test4/LocalVars.java new file mode 100644 index 00000000..17ab6cd1 --- /dev/null +++ b/src/test/test4/LocalVars.java @@ -0,0 +1,60 @@ +package test4; + +public class LocalVars { + public int run() { + int i = 0; + int p = i; + int q = p; + int r = q; + for (int k = 1; k < 3; ++k) + p += k; + + for (int k = 3; k > 0; --k) + try { + foo(k); + p++; + } + finally { + p++; + } + + switch (p) { + case 1: + p = 100; + break; + default : + ++p; + } + return p + r; + } + + public int run2() { + int i = 0; + int p = i; + int q = p; + int r = q; + for (int k = 1; k < 3; ++k) + p += k; + + for (int k = 3; k > 0; --k) + try { + foo(k); + p++; + } + finally { + p++; + } + + switch (p) { + case 1: + p = 100; + break; + default : + ++p; + } + + return p + r; + } + + public int foo(int i) { return i; } +} |