langtools/test/tools/javac/6464451/BigFinally.java
author jjg
Wed, 20 May 2009 19:10:06 -0700
changeset 2983 1d164c36212a
parent 10 06bc494ca11e
child 5520 86e4b9a9da40
permissions -rw-r--r--
6843648: tools/javac/versions/check.sh is broken Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
 * have any questions.
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
 * @test
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
 * @bug     6464451
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
 * @summary javac in 5.0ux can not compile try-finally block which has a lot of "return"
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
 * @author  Wei Tao
2983
1d164c36212a 6843648: tools/javac/versions/check.sh is broken
jjg
parents: 10
diff changeset
    29
 * @compile -source 5 -target 5 BigFinally.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
 * @clean BigFinally
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
 * @compile/fail BigFinally.java
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
public class BigFinally {
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
    static public int func(int i) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
            if(i == 1) return 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
        } finally {
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
            try {
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
                if(i == 2) return 2;
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
                if(i == 3 ) return 3;
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
                if(i == 4 ) return 4;
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
                if(i == 5 ) return 5;
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
                if(i == 6 ) return 6;
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
                if(i == 7 ) return 7;
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
                if(i == 8 ) return 8;
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
                if(i == 9 ) return 9;
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
                if(i == 10 ) return 10;
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
                if(i == 11 ) return 11;
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
                if(i == 12 ) return 12;
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
                if(i == 13 ) return 13;
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
                if(i == 14 ) return 14;
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
                if(i == 15 ) return 15;
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
                if(i == 16 ) return 16;
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
                if(i == 17 ) return 17;
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
                if(i == 18 ) return 18;
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
                if(i == 19 ) return 19;
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
                if(i == 20 ) return 20;
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
                if(i == 21 ) return 21;
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
                if(i == 22 ) return 22;
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
                if(i == 23 ) return 23;
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
                if(i == 24 ) return 24;
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
                if(i == 25 ) return 25;
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
                if(i == 26 ) return 26;
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
                if(i == 27 ) return 27;
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
                if(i == 28 ) return 28;
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
                if(i == 29 ) return 29;
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
                if(i == 30 ) return 30;
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
                if(i == 31 ) return 31;
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
                if(i == 32 ) return 32;
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
                if(i == 33 ) return 33;
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
                if(i == 34 ) return 34;
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
                if(i == 35 ) return 35;
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
                if(i == 36 ) return 36;
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
                if(i == 37 ) return 37;
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
                if(i == 38 ) return 38;
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
                if(i == 39 ) return 39;
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
                if(i == 40 ) return 40;
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
                if(i == 41 ) return 41;
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
                if(i == 42 ) return 42;
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
                if(i == 43 ) return 43;
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
                if(i == 44 ) return 44;
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
                if(i == 45 ) return 45;
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
                if(i == 46 ) return 46;
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
                if(i == 47 ) return 47;
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
                if(i == 48 ) return 48;
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
                if(i == 49 ) return 49;
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
                if(i == 50 ) return 50;
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
                if(i == 51 ) return 51;
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
                if(i == 52 ) return 52;
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
                if(i == 53 ) return 53;
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
                if(i == 54 ) return 54;
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
                if(i == 55 ) return 55;
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
                if(i == 56 ) return 56;
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
                if(i == 57 ) return 57;
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
                if(i == 58 ) return 58;
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
                if(i == 59 ) return 59;
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
                if(i == 60 ) return 60;
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
                if(i == 61 ) return 61;
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
                if(i == 62 ) return 62;
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
                if(i == 63 ) return 63;
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
                if(i == 64 ) return 64;
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
                if(i == 65 ) return 65;
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
                if(i == 66 ) return 66;
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
                if(i == 67 ) return 67;
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
                if(i == 68 ) return 68;
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
                if(i == 69 ) return 69;
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
                if(i == 70 ) return 70;
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
                if(i == 71 ) return 71;
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
                if(i == 72 ) return 72;
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
                if(i == 73 ) return 73;
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
                if(i == 74 ) return 74;
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
                if(i == 75 ) return 75;
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
                if(i == 76 ) return 76;
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
                if(i == 77 ) return 77;
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
                if(i == 78 ) return 78;
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
                if(i == 79 ) return 79;
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
                if(i == 80 ) return 80;
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
                if(i == 81 ) return 81;
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
                if(i == 82 ) return 82;
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
                if(i == 83 ) return 83;
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
                if(i == 84 ) return 84;
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
                if(i == 85 ) return 85;
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
                if(i == 86 ) return 86;
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
                if(i == 87 ) return 87;
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
                if(i == 88 ) return 88;
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
                if(i == 89 ) return 89;
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
                if(i == 90 ) return 90;
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
                if(i == 91 ) return 91;
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
                if(i == 92 ) return 92;
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
                if(i == 93 ) return 93;
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
                if(i == 94 ) return 94;
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
                if(i == 95 ) return 95;
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
                if(i == 96 ) return 96;
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
                if(i == 97 ) return 97;
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
                if(i == 98 ) return 98;
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
                if(i == 99 ) return 99;
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
                if(i == 100 ) return 100;
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
            } finally {
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
                int x = 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
                x += 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
                x += 2;
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
                x += 3;
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
                x += 4;
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
                x += 5;
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
                x += 6;
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
                x += 7;
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
                x += 8;
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
                x += 9;
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
                x += 10;
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
                x += 11;
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
                x += 12;
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
                x += 13;
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
                x += 14;
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
                x += 15;
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
                x += 16;
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
                x += 17;
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
                x += 18;
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
                x += 19;
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
                x += 20;
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
                x += 21;
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
                x += 22;
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
                x += 23;
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
                x += 24;
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
                x += 25;
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
                x += 26;
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
                x += 27;
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
                x += 28;
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
                x += 29;
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
                x += 30;
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
                x += 31;
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
                x += 32;
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
                x += 33;
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
                x += 34;
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
                x += 35;
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
                x += 36;
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
                x += 37;
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
                x += 38;
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
                x += 39;
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
                x += 40;
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
                x += 41;
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
                x += 42;
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
                x += 43;
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
                x += 44;
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
                x += 45;
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
                x += 46;
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
                x += 47;
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
                x += 48;
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
                x += 49;
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
                x += 50;
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
                x += 51;
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
                x += 52;
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
                x += 53;
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
                x += 54;
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
                x += 55;
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
                x += 56;
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
                x += 57;
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
                x += 58;
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
                x += 59;
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
                x += 60;
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
                x += 61;
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
                x += 62;
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
                x += 63;
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
                x += 64;
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
                x += 65;
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
                x += 66;
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
                x += 67;
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
                x += 68;
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
                x += 69;
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
                x += 70;
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
                x += 71;
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
                x += 72;
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
                x += 73;
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
                x += 74;
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
                x += 75;
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
                x += 76;
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
                x += 77;
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
                x += 78;
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
                x += 79;
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
                x += 80;
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
                x += 81;
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
                x += 82;
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
                x += 83;
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
                x += 84;
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
                x += 85;
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
                x += 86;
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
                x += 87;
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
                x += 88;
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
                x += 89;
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
                x += 90;
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
                x += 91;
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
                x += 92;
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
                x += 93;
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
                x += 94;
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
                x += 95;
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
                x += 96;
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
                x += 97;
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
                x += 98;
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
                x += 99;
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
                x += 100;
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
        return 0;
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
}