-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
12 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
public class NestedTryCatchFlow { | ||
int test_nested_try_catch_2(int param) { | ||
try { | ||
try { | ||
try { | ||
if (param == 10) | ||
return 0; | ||
if (param == 20 || param == 25 || param == 27 || param == 28) { | ||
throw new IllegalArgumentException("Illegal arguments provided"); | ||
} | ||
if (param == 30) { | ||
throw new IllegalStateException("Illegal state exception"); | ||
} | ||
return 1; | ||
} catch (IllegalArgumentException e) { | ||
if (param == 25 || param == 27 || param == 28) { | ||
throw new IllegalStateException("Illegal state exception 2"); | ||
} | ||
return 2; | ||
} catch (IllegalStateException e) { | ||
return 3; | ||
} | ||
} catch (IllegalStateException e) { | ||
if (param == 25) { | ||
throw new ArrayIndexOutOfBoundsException(); | ||
} | ||
if (param == 27) { | ||
throw new IllegalArgumentException("Illegal arguments provided 2"); | ||
} | ||
return 4; | ||
} | ||
} catch (ArrayIndexOutOfBoundsException e) { | ||
return 5; | ||
} catch (RuntimeException e) { | ||
return 6; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters