author | mcimadamore |
Fri, 18 Jan 2013 15:38:14 +0000 | |
changeset 15369 | 2ae199ad2e5d |
permissions | -rw-r--r-- |
15369
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
1 |
/* |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
2 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
4 |
* |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
8 |
* |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
13 |
* accompanied this code). |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
14 |
* |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
18 |
* |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
21 |
* questions. |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
22 |
*/ |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
23 |
|
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
24 |
/* |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
25 |
* @test |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
26 |
* @summary Check usages of underscore as identifier generate warnings |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
27 |
* @compile/fail/ref=WarnUnderscoreAsIdent.out -XDrawDiagnostics -Werror WarnUnderscoreAsIdent.java |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
28 |
*/ |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
29 |
package _._; |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
30 |
|
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
31 |
import _._; |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
32 |
|
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
33 |
class _ { |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
34 |
String _ = null; |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
35 |
void _(String _) { } |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
36 |
void testLocal() { |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
37 |
String _ = null; |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
38 |
} |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
39 |
void testFor() { |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
40 |
for (int _ = 0; _ < 10; _++); |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
41 |
} |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
42 |
void testTry() { |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
43 |
try { } catch (Throwable _) { } |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
44 |
} |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
45 |
void testLabel() { |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
46 |
_: |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
47 |
for (;;) { |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
48 |
break _; |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
49 |
} |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
50 |
_: |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
51 |
for (;;) { |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
52 |
continue _; |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
53 |
} |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
54 |
} |
2ae199ad2e5d
8006561: Langtools test failure: missing diags/examples
mcimadamore
parents:
diff
changeset
|
55 |
} |