File: FieldTest.java

package info (click to toggle)
libnb-javaparser-java 9%2B2018-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 65,320 kB
  • sloc: java: 440,096; xml: 6,359; sh: 865; makefile: 314
file content (209 lines) | stat: -rw-r--r-- 9,482 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 */

/*
 * @test
 * @bug 8049238
 * @summary Checks Signature attribute for fields.
 * @library /tools/lib /tools/javac/lib ../lib
 * @modules jdk.compiler/com.sun.tools.javac.api
 *          jdk.compiler/com.sun.tools.javac.main
 *          jdk.jdeps/com.sun.tools.classfile
 * @build toolbox.ToolBox InMemoryFileManager TestResult TestBase
 * @build FieldTest Driver ExpectedSignature ExpectedSignatureContainer
 * @run main Driver FieldTest
 */

import java.util.Comparator;
import java.util.List;
import java.util.Map;

@ExpectedSignature(descriptor = "FieldTest", signature = "<T:Ljava/lang/Object;>Ljava/lang/Object;")
public class FieldTest<T> {

    @ExpectedSignature(descriptor = "typeInList", signature = "Ljava/util/List<TT;>;")
    List<T> typeInList;

    @ExpectedSignature(descriptor = "boundsType", signature = "Ljava/util/List<Ljava/util/Map<+TT;-TT;>;>;")
    List<Map<? extends T, ? super T>> boundsType;

    @ExpectedSignature(descriptor = "type", signature = "TT;")
    T type;

    @ExpectedSignature(descriptor = "typeInArray", signature = "[TT;")
    T[] typeInArray;

    @ExpectedSignature(descriptor = "byteArrayInList", signature = "Ljava/util/List<[B>;")
    List<byte[]> byteArrayInList;

    @ExpectedSignature(descriptor = "shortArrayInList", signature = "Ljava/util/List<[S>;")
    List<short[]> shortArrayInList;

    @ExpectedSignature(descriptor = "intArrayInList", signature = "Ljava/util/List<[I>;")
    List<int[]> intArrayInList;

    @ExpectedSignature(descriptor = "longArrayInList", signature = "Ljava/util/List<[J>;")
    List<long[]> longArrayInList;

    @ExpectedSignature(descriptor = "charArrayInList", signature = "Ljava/util/List<[C>;")
    List<char[]> charArrayInList;

    @ExpectedSignature(descriptor = "booleanArrayInList", signature = "Ljava/util/List<[Z>;")
    List<boolean[]> booleanArrayInList;

    @ExpectedSignature(descriptor = "floatArrayInList", signature = "Ljava/util/List<[F>;")
    List<float[]> floatArrayInList;

    @ExpectedSignature(descriptor = "doubleArrayInList", signature = "Ljava/util/List<[D>;")
    List<double[]> doubleArrayInList;

    @ExpectedSignature(descriptor = "integerInList", signature = "Ljava/util/List<Ljava/lang/Integer;>;")
    List<Integer> integerInList;

    @ExpectedSignature(descriptor = "typeInMultiArray", signature = "[[TT;")
    T[][] typeInMultiArray;

    @ExpectedSignature(descriptor = "arrayOfClasses", signature = "[Ljava/util/List<TT;>;")
    List<T>[] arrayOfClasses;

    @ExpectedSignature(descriptor = "extendsWildCard", signature = "Ljava/util/List<+TT;>;")
    List<? extends T> extendsWildCard;

    @ExpectedSignature(descriptor = "superWildCard", signature = "Ljava/util/Comparator<-TT;>;")
    Comparator<? super T> superWildCard;

    @ExpectedSignature(descriptor = "extendsSuperWildCard",
            signature = "Ljava/util/List<+Ljava/util/Comparator<-TT;>;>;")
    List<? extends Comparator<? super T>> extendsSuperWildCard;

    @ExpectedSignature(descriptor = "wildCard", signature = "Ljava/util/Comparator<*>;")
    Comparator<?> wildCard;

    @ExpectedSignature(descriptor = "boundsBooleanArray", signature = "Ljava/util/Map<+[Z-[Z>;")
    Map<? extends boolean[], ? super boolean[]> boundsBooleanArray;

    @ExpectedSignature(descriptor = "boundsByteArray", signature = "Ljava/util/Map<+[B-[B>;")
    Map<? extends byte[], ? super byte[]> boundsByteArray;

    @ExpectedSignature(descriptor = "boundsShortArray", signature = "Ljava/util/Map<+[S-[S>;")
    Map<? extends short[], ? super short[]> boundsShortArray;

    @ExpectedSignature(descriptor = "boundsIntArray", signature = "Ljava/util/Map<+[I-[I>;")
    Map<? extends int[], ? super int[]> boundsIntArray;

    @ExpectedSignature(descriptor = "boundsLongArray", signature = "Ljava/util/Map<+[J-[J>;")
    Map<? extends long[], ? super long[]> boundsLongArray;

    @ExpectedSignature(descriptor = "boundsCharArray", signature = "Ljava/util/Map<+[C-[C>;")
    Map<? extends char[], ? super char[]> boundsCharArray;

    @ExpectedSignature(descriptor = "boundsFloatArray", signature = "Ljava/util/Map<+[F-[F>;")
    Map<? extends float[], ? super float[]> boundsFloatArray;

    @ExpectedSignature(descriptor = "boundsDoubleArray", signature = "Ljava/util/Map<+[D-[D>;")
    Map<? extends double[], ? super double[]> boundsDoubleArray;

    @ExpectedSignature(descriptor = "boundsObjectArray",
            signature = "Ljava/util/Map<+[Ljava/lang/Object;-[Ljava/lang/Object;>;")
    Map<? extends Object[], ? super Object[]> boundsObjectArray;

    boolean booleanNoSignatureAttribute;
    byte byteNoSignatureAttribute;
    char charNoSignatureAttribute;
    short shortNoSignatureAttribute;
    int intNoSignatureAttribute;
    long longNoSignatureAttribute;
    float floatNoSignatureAttribute;
    double doubleNoSignatureAttribute;

    List listNoSignatureAttribute;

    @ExpectedSignature(descriptor = "staticByteArrayInList", signature = "Ljava/util/List<[B>;")
    static List<byte[]> staticByteArrayInList;

    @ExpectedSignature(descriptor = "staticShortArrayInList", signature = "Ljava/util/List<[S>;")
    static List<short[]> staticShortArrayInList;

    @ExpectedSignature(descriptor = "staticIntArrayInList", signature = "Ljava/util/List<[I>;")
    static List<int[]> staticIntArrayInList;

    @ExpectedSignature(descriptor = "staticLongArrayInList", signature = "Ljava/util/List<[J>;")
    static List<long[]> staticLongArrayInList;

    @ExpectedSignature(descriptor = "staticCharArrayInList", signature = "Ljava/util/List<[C>;")
    static List<char[]> staticCharArrayInList;

    @ExpectedSignature(descriptor = "staticBooleanArrayInList", signature = "Ljava/util/List<[Z>;")
    static List<boolean[]> staticBooleanArrayInList;

    @ExpectedSignature(descriptor = "staticFloatArrayInList", signature = "Ljava/util/List<[F>;")
    static List<float[]> staticFloatArrayInList;

    @ExpectedSignature(descriptor = "staticDoubleArrayInList", signature = "Ljava/util/List<[D>;")
    static List<double[]> staticDoubleArrayInList;

    @ExpectedSignature(descriptor = "staticIntegerInList", signature = "Ljava/util/List<Ljava/lang/Integer;>;")
    static List<Integer> staticIntegerInList;

    @ExpectedSignature(descriptor = "staticWildCard", signature = "Ljava/util/Comparator<*>;")
    static Comparator<?> staticWildCard;

    @ExpectedSignature(descriptor = "staticBoundsBooleanArray", signature = "Ljava/util/Map<+[Z-[Z>;")
    static Map<? extends boolean[], ? super boolean[]> staticBoundsBooleanArray;

    @ExpectedSignature(descriptor = "staticBoundsByteArray", signature = "Ljava/util/Map<+[B-[B>;")
    static Map<? extends byte[], ? super byte[]> staticBoundsByteArray;

    @ExpectedSignature(descriptor = "staticBoundsShortArray", signature = "Ljava/util/Map<+[S-[S>;")
    static Map<? extends short[], ? super short[]> staticBoundsShortArray;

    @ExpectedSignature(descriptor = "staticBoundsIntArray", signature = "Ljava/util/Map<+[I-[I>;")
    static Map<? extends int[], ? super int[]> staticBoundsIntArray;

    @ExpectedSignature(descriptor = "staticBoundsLongArray", signature = "Ljava/util/Map<+[J-[J>;")
    static Map<? extends long[], ? super long[]> staticBoundsLongArray;

    @ExpectedSignature(descriptor = "staticBoundsCharArray", signature = "Ljava/util/Map<+[C-[C>;")
    static Map<? extends char[], ? super char[]> staticBoundsCharArray;

    @ExpectedSignature(descriptor = "staticBoundsFloatArray", signature = "Ljava/util/Map<+[F-[F>;")
    static Map<? extends float[], ? super float[]> staticBoundsFloatArray;

    @ExpectedSignature(descriptor = "staticBoundsDoubleArray", signature = "Ljava/util/Map<+[D-[D>;")
    static Map<? extends double[], ? super double[]> staticBoundsDoubleArray;

    @ExpectedSignature(descriptor = "staticBoundsObjectArray",
            signature = "Ljava/util/Map<+[Ljava/lang/Object;-[Ljava/lang/Object;>;")
    static Map<? extends Object[], ? super Object[]> staticBoundsObjectArray;

    static boolean staticBooleanNoSignatureAttribute;
    static byte staticByteNoSignatureAttribute;
    static char staticCharNoSignatureAttribute;
    static short staticShortNoSignatureAttribute;
    static int staticIntNoSignatureAttribute;
    static long staticLongNoSignatureAttribute;
    static float staticFloatNoSignatureAttribute;
    static double staticDoubleNoSignatureAttribute;

    static List staticListNoSignatureAttribute;
}