test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java

Wed, 27 Apr 2016 01:34:52 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:34:52 +0800
changeset 0
959103a6100f
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/
changeset: 2573:53ca196be1ae
tag: jdk8u25-b17

     1 /*
     2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     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  */
    24 package typeannos;
    26 import java.lang.annotation.*;
    28 /*
    29  * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations.
    30  */
    31 class MtdDefaultScope {
    32     MtdParameterized<String, String> unannotated() { return null; }
    33     MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; }
    34     MtdParameterized<String, @MRtnA String> secondTypeArg() { return null; }
    35     MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; }
    37     MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String>
    38     nestedMtdParameterized() { return null; }
    40     public <T> @MRtnA String method() { return null; }
    42     @MRtnA String [] array1() { return null; }
    43     @MRtnA String @MRtnB [] array1Deep() { return null; }
    44     @MRtnA String [] [] array2() { return null; }
    45     @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; }
    46     String @MRtnA [] [] array2First() { return null; }
    47     String [] @MRtnB [] array2Second() { return null; }
    49     // Old-style array syntax
    50     String array2FirstOld() @MRtnA [] { return null; }
    51     String array2SecondOld() [] @MRtnB [] { return null; }
    52 }
    54 class MtdModifiedScoped {
    55     public final MtdParameterized<String, String> unannotated() { return null; }
    56     public final MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; }
    57     public final MtdParameterized<String, @MRtnA String> secondTypeArg() { return null; }
    58     public final MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; }
    60     public final MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String>
    61     nestedMtdParameterized() { return null; }
    63     public final @MRtnA String [] array1() { return null; }
    64     public final @MRtnA String @MRtnB [] array1Deep() { return null; }
    65     public final @MRtnA String [] [] array2() { return null; }
    66     public final @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; }
    67     public final String @MRtnA [] [] array2First() { return null; }
    68     public final String [] @MRtnB [] array2Second() { return null; }
    69 }
    71 class MtdParameterized<K, V> { }
    73 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
    74 @Documented
    75 @interface MRtnA { }
    76 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
    77 @Documented
    78 @interface MRtnB { }

mercurial