1 /* 2 * Copyright (c) 2019, 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 */ 23 24 package pkg; 25 26 import javax.annotation.processing.Generated; 27 28 /** 29 * Test class for rendering of method signatures. This provides some pathologically 30 * complex method signatures that require special handling. Other features are 31 * covered by other tests. 32 */ 33 public class C { 34 35 /** 36 * Annotated constructor. 37 */ 38 @Generated(value = "GeneratedConstructor") 39 public C() {} 40 41 42 public interface F0<T> { 43 T apply() throws Exception; 44 } 45 46 public static class With8Types<T1, T2, T3, T4, T5, T6, T7, T8> { } 47 48 49 /** 50 * Simple method. 51 * 52 * @param i param 1 53 * @param s param 2 54 * @param b param 3 55 */ 56 public static void simpleMethod(int i, String s, boolean b) {} 57 58 59 /** 60 * Annotated method. 61 * 62 * @param i param 1 63 * @param s param 2 64 * @param b param 3 65 */ 66 @Generated( 67 value = "SomeGeneratedName", 68 date = "a date", 69 comments = "some comment about the method below") 70 public static void annotatedMethod(int i, String s, boolean b) {} 71 72 73 /** 74 * Generic method with eight type args. 75 * 76 * @param <T1> type 1 77 * @param <T2> type 2 78 * @param <T3> type 3 79 * @param <T4> type 4 80 * @param <T5> type 5 81 * @param <T6> type 6 82 * @param <T7> type 7 83 * @param <T8> type 8 84 * @param t1 param 1 85 * @param t2 param 2 86 * @param t3 param 3 87 * @param t4 param 4 88 * @param t5 param 5 89 * @param t6 param 6 90 * @param t7 param 7 91 * @param t8 param 8 92 * @return null 93 */ 94 public static 95 <T1 extends AutoCloseable, 96 T2 extends AutoCloseable, 97 T3 extends AutoCloseable, 98 T4 extends AutoCloseable, 99 T5 extends AutoCloseable, 100 T6 extends AutoCloseable, 101 T7 extends AutoCloseable, 102 T8 extends AutoCloseable> 103 With8Types<T1, T2, T3, T4, T5, T6, T7, T8> bigGenericMethod( 104 F0<? extends T1> t1, 105 F0<? extends T2> t2, 106 F0<? extends T3> t3, 107 F0<? extends T4> t4, 108 F0<? extends T5> t5, 109 F0<? extends T6> t6, 110 F0<? extends T7> t7, 111 F0<? extends T8> t8) 112 throws IllegalArgumentException, IllegalStateException { return null; } 113 114 115 /** 116 * Generic method with eight type args and annotation. 117 * 118 * @param <T1> type 1 119 * @param <T2> type 2 120 * @param <T3> type 3 121 * @param <T4> type 4 122 * @param <T5> type 5 123 * @param <T6> type 6 124 * @param <T7> type 7 125 * @param <T8> type 8 126 * @param t1 param 1 127 * @param t2 param 2 128 * @param t3 param 3 129 * @param t4 param 4 130 * @param t5 param 5 131 * @param t6 param 6 132 * @param t7 param 7 133 * @param t8 param 8 134 * @return null 135 */ 136 @Generated( 137 value = "SomeGeneratedName", 138 date = "a date", 139 comments = "some comment about the method below") 140 public static 141 <T1 extends AutoCloseable, 142 T2 extends AutoCloseable, 143 T3 extends AutoCloseable, 144 T4 extends AutoCloseable, 145 T5 extends AutoCloseable, 146 T6 extends AutoCloseable, 147 T7 extends AutoCloseable, 148 T8 extends AutoCloseable> 149 With8Types<T1, T2, T3, T4, T5, T6, T7, T8> bigGenericAnnotatedMethod( 150 F0<? extends T1> t1, 151 F0<? extends T2> t2, 152 F0<? extends T3> t3, 153 F0<? extends T4> t4, 154 F0<? extends T5> t5, 155 F0<? extends T6> t6, 156 F0<? extends T7> t7, 157 F0<? extends T8> t8) 158 throws IllegalArgumentException, IllegalStateException { return null; } 159 }