author | akulyakh |
Thu, 21 May 2015 11:41:04 -0700 | |
changeset 30730 | d3ce7619db2c |
parent 21704 | e215a6216604 |
permissions | -rw-r--r-- |
21704 | 1 |
/* |
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
21704
diff
changeset
|
2 |
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
21704 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
/* |
|
25 |
* @test /nodynamiccopyright/ |
|
26 |
* @bug 8027310 |
|
27 |
* @summary Ensure no exceptions on unresolvable annotations |
|
30730
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
21704
diff
changeset
|
28 |
* @modules jdk.compiler/com.sun.tools.javac.api |
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
21704
diff
changeset
|
29 |
* jdk.compiler/com.sun.tools.javac.file |
d3ce7619db2c
8076543: Add @modules as needed to the langtools tests
akulyakh
parents:
21704
diff
changeset
|
30 |
* jdk.compiler/com.sun.tools.javac.util |
21704 | 31 |
* @build Processor |
32 |
* @run main Processor Source.java |
|
33 |
*/ |
|
34 |
||
35 |
import java.util.List; |
|
36 |
||
37 |
@Anno("TYPE") |
|
38 |
public class Source { |
|
39 |
@Anno("TYPE") |
|
40 |
class Inner { |
|
41 |
class InnerInner { |
|
42 |
public @Anno("CONSTRUCTOR") InnerInner(@Anno("TYPE_USE") Source. @Anno("TYPE_USE") Inner Inner.this, |
|
43 |
@Anno("PARAMETER") java.lang. @Anno("TYPE_USE") Runnable p) { |
|
44 |
Runnable r = () -> { |
|
45 |
@Anno("TYPE_USE") Object tested = null; |
|
46 |
@Anno("TYPE_USE") boolean isAnnotated = tested instanceof @Anno("TYPE_USE") String; |
|
47 |
}; |
|
48 |
||
49 |
@Anno("TYPE_USE") Object tested = (@Anno("TYPE_USE") String @Anno("TYPE_USE") []) null; |
|
50 |
@Anno("TYPE_USE") boolean isAnnotated = tested instanceof@Anno("TYPE_USE") String; |
|
51 |
||
52 |
tested = new java.lang. @Anno("TYPE_USE") Object(); |
|
53 |
tested = new @Anno("TYPE_USE") Object(); |
|
54 |
} |
|
55 |
} |
|
56 |
} |
|
57 |
||
58 |
{ |
|
59 |
Runnable r = () -> { |
|
60 |
@Anno("TYPE_USE") Object tested = null; |
|
61 |
@Anno("TYPE_USE") boolean isAnnotated = tested instanceof @Anno("TYPE_USE") String; |
|
62 |
}; |
|
63 |
||
64 |
@Anno("TYPE_USE") Object tested = (@Anno("TYPE_USE") String @Anno("TYPE_USE") []) null; |
|
65 |
@Anno("TYPE_USE") boolean isAnnotated = tested instanceof@Anno("TYPE_USE") String; |
|
66 |
||
67 |
tested = new java.lang. @Anno("TYPE_USE") Object(); |
|
68 |
tested = new @Anno("TYPE_USE") Object(); |
|
69 |
} |
|
70 |
||
71 |
@Anno("TYPE") |
|
72 |
@Anno("ANNOTATION_TYPE") |
|
73 |
@interface A { } |
|
74 |
abstract class Parameterized<@Anno("TYPE_PARAMETER") T extends @Anno("TYPE_USE") CharSequence & |
|
75 |
@Anno("TYPE_USE") Runnable> |
|
76 |
implements @Anno("TYPE_USE") List<@Anno("TYPE_USE") Runnable> { } |
|
77 |
} |