1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/com/sun/javadoc/testTypeAnnotations/typeannos/MethodReturnType.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,78 @@ 1.4 +/* 1.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + */ 1.26 + 1.27 +package typeannos; 1.28 + 1.29 +import java.lang.annotation.*; 1.30 + 1.31 +/* 1.32 + * This class is replicated from test/tools/javac/annotations/typeAnnotations/newlocations. 1.33 + */ 1.34 +class MtdDefaultScope { 1.35 + MtdParameterized<String, String> unannotated() { return null; } 1.36 + MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; } 1.37 + MtdParameterized<String, @MRtnA String> secondTypeArg() { return null; } 1.38 + MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; } 1.39 + 1.40 + MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String> 1.41 + nestedMtdParameterized() { return null; } 1.42 + 1.43 + public <T> @MRtnA String method() { return null; } 1.44 + 1.45 + @MRtnA String [] array1() { return null; } 1.46 + @MRtnA String @MRtnB [] array1Deep() { return null; } 1.47 + @MRtnA String [] [] array2() { return null; } 1.48 + @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; } 1.49 + String @MRtnA [] [] array2First() { return null; } 1.50 + String [] @MRtnB [] array2Second() { return null; } 1.51 + 1.52 + // Old-style array syntax 1.53 + String array2FirstOld() @MRtnA [] { return null; } 1.54 + String array2SecondOld() [] @MRtnB [] { return null; } 1.55 +} 1.56 + 1.57 +class MtdModifiedScoped { 1.58 + public final MtdParameterized<String, String> unannotated() { return null; } 1.59 + public final MtdParameterized<@MRtnA String, String> firstTypeArg() { return null; } 1.60 + public final MtdParameterized<String, @MRtnA String> secondTypeArg() { return null; } 1.61 + public final MtdParameterized<@MRtnA String, @MRtnB String> bothTypeArgs() { return null; } 1.62 + 1.63 + public final MtdParameterized<@MRtnA MtdParameterized<@MRtnA String, @MRtnB String>, @MRtnB String> 1.64 + nestedMtdParameterized() { return null; } 1.65 + 1.66 + public final @MRtnA String [] array1() { return null; } 1.67 + public final @MRtnA String @MRtnB [] array1Deep() { return null; } 1.68 + public final @MRtnA String [] [] array2() { return null; } 1.69 + public final @MRtnA String @MRtnA [] @MRtnB [] array2Deep() { return null; } 1.70 + public final String @MRtnA [] [] array2First() { return null; } 1.71 + public final String [] @MRtnB [] array2Second() { return null; } 1.72 +} 1.73 + 1.74 +class MtdParameterized<K, V> { } 1.75 + 1.76 +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 1.77 +@Documented 1.78 +@interface MRtnA { } 1.79 +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 1.80 +@Documented 1.81 +@interface MRtnB { }