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 import java.io.*;
25 import java.lang.annotation.Retention;
26 import java.lang.annotation.RetentionPolicy;
27 import java.net.URL;
28 import java.util.List;
29
30 import com.sun.tools.classfile.*;
31
32 /*
33 * @test NoTargetAnnotations
34 * @summary test that annotations with no Target meta type is emitted
35 * only once as declaration annotation
36 * @modules jdk.compiler/com.sun.tools.classfile
37 */
38 public class NoTargetAnnotations {
39
40 public static void main(String[] args) throws Exception {
41 new NoTargetAnnotations().run();
42 }
43
44 public void run() throws Exception {
45 ClassFile cf = getClassFile("NoTargetAnnotations$Test.class");
46 for (Field f : cf.fields) {
47 test(cf, f);
48 testDeclaration(cf, f);
49 }
50 for (Method m: cf.methods) {
51 test(cf, m);
52 testDeclaration(cf, m);
53 }
54
55 countAnnotations();
56
|
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 import java.io.*;
25 import java.lang.annotation.Retention;
26 import java.lang.annotation.RetentionPolicy;
27 import java.net.URL;
28 import java.util.List;
29
30 import com.sun.tools.classfile.*;
31
32 /*
33 * @test NoTargetAnnotations
34 * @summary test that annotations with no Target meta type is emitted
35 * only once as declaration annotation
36 * @modules jdk.jdeps/com.sun.tools.classfile
37 */
38 public class NoTargetAnnotations {
39
40 public static void main(String[] args) throws Exception {
41 new NoTargetAnnotations().run();
42 }
43
44 public void run() throws Exception {
45 ClassFile cf = getClassFile("NoTargetAnnotations$Test.class");
46 for (Field f : cf.fields) {
47 test(cf, f);
48 testDeclaration(cf, f);
49 }
50 for (Method m: cf.methods) {
51 test(cf, m);
52 testDeclaration(cf, m);
53 }
54
55 countAnnotations();
56
|