01: package test;
02:
03: public class MethodFallThroughExitPoints {
04:
05: public void simpleFallThroughExitPoint() {
06: }
07:
08: public void fallThroughExitPointWithIf() {
09: if (Boolean.getBoolean(""))
10: return;
11: }
12:
13: public void notFallThroughIfWithElse() {
14: if (Boolean.getBoolean(""))
15: return;
16: else
17: return;
18: }
19:
20: public void fallThroughExitPointWithTryCatch() {
21: try {
22: return;
23: } catch (RuntimeException t) {
24: return;
25: } catch (Error t) {
26: }
27: }
28:
29: public void notFallThroughTryCatchWithReturns() {
30: try {
31: return;
32: } catch (RuntimeException t) {
33: return;
34: } catch (Error t) {
35: return;
36: }
37: }
38:
39: public void notFallThroughFinallyWithReturn() {
40: try {
41: } catch (Throwable t) {
42: } finally {
43: return;
44: }
45: }
46:
47: public void notFallThroughThrow() {
48: throw new IllegalStateException();
49: }
50:
51: }
|