diff options
author | Brian Carlstrom <bdc@google.com> | 2011-10-03 11:24:05 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2011-10-03 11:24:05 -0700 |
commit | 33f741eefef8f8012f6c190b39355f2e0430d535 (patch) | |
tree | 8d17953423f87d6fec38404dd503b6bfad9ac474 /test/ExceptionHandle | |
parent | 1afef11c4cfb0ac37db7aba183bf71f938af2520 (diff) | |
download | android_art-33f741eefef8f8012f6c190b39355f2e0430d535.tar.gz android_art-33f741eefef8f8012f6c190b39355f2e0430d535.tar.bz2 android_art-33f741eefef8f8012f6c190b39355f2e0430d535.zip |
Remove opening of DexFile from pointer
Change-Id: I158e75e9e72f1dcc579742ff08c80d3f857852b3
Diffstat (limited to 'test/ExceptionHandle')
-rw-r--r-- | test/ExceptionHandle/ExceptionHandle.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/ExceptionHandle/ExceptionHandle.java b/test/ExceptionHandle/ExceptionHandle.java new file mode 100644 index 0000000000..94c6f5b8eb --- /dev/null +++ b/test/ExceptionHandle/ExceptionHandle.java @@ -0,0 +1,27 @@ +// Copyright 2011 Google Inc. All Rights Reserved. +import java.io.IOException; + +public class ExceptionHandle { + int f() throws Exception { + try { + g(1); + } catch (IOException e) { + return 1; + } catch (Exception e) { + return 2; + } + try { + g(2); + } catch (IOException e) { + return 3; + } + return 0; + } + void g(int doThrow) throws Exception { + if (doThrow == 1) { + throw new Exception(); + } else if (doThrow == 2) { + throw new IOException(); + } + } +} |