langtools/test/tools/javac/annotations/typeAnnotations/failures/TypeVariableCycleTest.java
author jjg
Tue, 15 Oct 2013 15:57:13 -0700
changeset 21041 99f5e5e97425
parent 19660 7cc9663100f1
permissions -rw-r--r--
8026564: import changes from type-annotations forest Reviewed-by: jjg Contributed-by: wdietl@gmail.com, steve.sides@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19660
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     1
/*
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     2
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     4
 *
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     8
 *
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    13
 * accompanied this code).
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    14
 *
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    18
 *
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    21
 * questions.
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    22
 */
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    23
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    24
/*
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    25
 * @test
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    26
 * @bug 8023768
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    27
 * @summary Type annotations on a type variable, where the bound of
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    28
 *   the type variable is an annotated type variable,
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    29
 *   need to be processed correctly.
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    30
 * @author Werner Dietl
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    31
 * @compile TypeVariableCycleTest.java
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    32
 */
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    33
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    34
import java.lang.annotation.*;
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    35
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    36
class TypeVariableCycleTest<CTV> {
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    37
    <MTV extends  @TA CTV> MTV cast(CTV p) {
21041
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents: 19660
diff changeset
    38
        return (@TB MTV) p;
19660
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    39
    }
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    40
}
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    41
21041
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents: 19660
diff changeset
    42
@Target(ElementType.TYPE_USE)
19660
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    43
@interface TA {}
7cc9663100f1 8023768: Use the unannotatedType in cyclicity checks.
jjg
parents:
diff changeset
    44
21041
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents: 19660
diff changeset
    45
@Target(ElementType.TYPE_USE)
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents: 19660
diff changeset
    46
@interface TB {}