langtools/test/tools/javac/annotations/typeAnnotations/classfile/Scopes.java
author akulyakh
Thu, 21 May 2015 11:41:04 -0700
changeset 30730 d3ce7619db2c
parent 21041 99f5e5e97425
child 30846 2b3f379840f0
permissions -rw-r--r--
8076543: Add @modules as needed to the langtools tests Reviewed-by: jjg, shurailine
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21041
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 21041
diff changeset
     2
 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
21041
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     4
 *
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     8
 *
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    13
 * accompanied this code).
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    14
 *
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    18
 *
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    21
 * questions.
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    22
 */
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    23
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    24
import java.lang.annotation.*;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    25
import java.io.*;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    26
import java.net.URL;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    27
import java.util.List;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    28
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    29
import com.sun.tools.classfile.*;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    30
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    31
/*
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    32
 * @test
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    33
 * @bug 6843077 8006775
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    34
 * @summary Qualified inner type annotation accessible to the class.
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 21041
diff changeset
    35
 * @modules jdk.compiler/com.sun.tools.classfile
21041
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    36
 */
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    37
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    38
@Scopes.UniqueInner
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    39
public class Scopes<T extends @Scopes.UniqueInner Object> extends ClassfileTestHelper{
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    40
    public static void main(String[] args) throws Exception {
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    41
        new Scopes().run();
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    42
    }
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    43
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    44
    public void run() throws Exception {
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    45
        expected_tinvisibles = 1;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    46
        expected_invisibles = 1;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    47
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    48
        ClassFile cf = getClassFile("Scopes.class");
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    49
        test(cf);
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    50
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    51
        countAnnotations();
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    52
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    53
        if (errors > 0)
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    54
            throw new Exception(errors + " errors found");
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    55
        System.out.println("PASSED");
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    56
    }
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    57
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    58
    @Target({ElementType.TYPE_USE})
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    59
    @interface UniqueInner { };
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    60
}