author | martin |
Tue, 15 Sep 2015 21:56:04 -0700 | |
changeset 32649 | 2ee9017c7597 |
parent 29986 | 97167d851fc4 |
child 36511 | 9d0388c6b336 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
15534
19228f4aedb4
8007113: Upgrade AnnotatedElement.isAnnotionPresent to be a default method
darcy
parents:
14676
diff
changeset
|
2 |
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.lang; |
|
27 |
||
16051
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
28 |
import java.lang.reflect.AnnotatedElement; |
2 | 29 |
|
30 |
import java.io.File; |
|
31 |
import java.io.FileInputStream; |
|
32 |
import java.io.IOException; |
|
33 |
import java.net.URL; |
|
34 |
import java.net.MalformedURLException; |
|
35 |
import java.security.AccessController; |
|
36 |
import java.security.PrivilegedAction; |
|
37 |
||
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
38 |
import java.util.concurrent.ConcurrentHashMap; |
2 | 39 |
import java.util.jar.JarInputStream; |
40 |
import java.util.jar.Manifest; |
|
41 |
import java.util.jar.Attributes; |
|
42 |
import java.util.jar.Attributes.Name; |
|
43 |
import java.util.Map; |
|
44 |
||
45 |
import sun.net.www.ParseUtil; |
|
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
16051
diff
changeset
|
46 |
import sun.reflect.CallerSensitive; |
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
16051
diff
changeset
|
47 |
import sun.reflect.Reflection; |
2 | 48 |
|
49 |
import java.lang.annotation.Annotation; |
|
50 |
||
51 |
/** |
|
52 |
* {@code Package} objects contain version information |
|
53 |
* about the implementation and specification of a Java package. |
|
54 |
* This versioning information is retrieved and made available |
|
55 |
* by the {@link ClassLoader} instance that |
|
56 |
* loaded the class(es). Typically, it is stored in the manifest that is |
|
57 |
* distributed with the classes. |
|
58 |
* |
|
59 |
* <p>The set of classes that make up the package may implement a |
|
60 |
* particular specification and if so the specification title, version number, |
|
61 |
* and vendor strings identify that specification. |
|
62 |
* An application can ask if the package is |
|
63 |
* compatible with a particular version, see the {@link |
|
64 |
* #isCompatibleWith isCompatibleWith} |
|
65 |
* method for details. |
|
66 |
* |
|
67 |
* <p>Specification version numbers use a syntax that consists of nonnegative |
|
68 |
* decimal integers separated by periods ".", for example "2.0" or |
|
69 |
* "1.2.3.4.5.6.7". This allows an extensible number to be used to represent |
|
70 |
* major, minor, micro, etc. versions. The version specification is described |
|
71 |
* by the following formal grammar: |
|
72 |
* <blockquote> |
|
73 |
* <dl> |
|
18546
862067c6481c
8017550: Fix doclint issues in java.lang and subpackages
darcy
parents:
16906
diff
changeset
|
74 |
* <dt><i>SpecificationVersion:</i> |
862067c6481c
8017550: Fix doclint issues in java.lang and subpackages
darcy
parents:
16906
diff
changeset
|
75 |
* <dd><i>Digits RefinedVersion<sub>opt</sub></i> |
2 | 76 |
|
18546
862067c6481c
8017550: Fix doclint issues in java.lang and subpackages
darcy
parents:
16906
diff
changeset
|
77 |
* <dt><i>RefinedVersion:</i> |
2 | 78 |
* <dd>{@code .} <i>Digits</i> |
79 |
* <dd>{@code .} <i>Digits RefinedVersion</i> |
|
80 |
* |
|
18546
862067c6481c
8017550: Fix doclint issues in java.lang and subpackages
darcy
parents:
16906
diff
changeset
|
81 |
* <dt><i>Digits:</i> |
862067c6481c
8017550: Fix doclint issues in java.lang and subpackages
darcy
parents:
16906
diff
changeset
|
82 |
* <dd><i>Digit</i> |
862067c6481c
8017550: Fix doclint issues in java.lang and subpackages
darcy
parents:
16906
diff
changeset
|
83 |
* <dd><i>Digits</i> |
2 | 84 |
* |
18546
862067c6481c
8017550: Fix doclint issues in java.lang and subpackages
darcy
parents:
16906
diff
changeset
|
85 |
* <dt><i>Digit:</i> |
2 | 86 |
* <dd>any character for which {@link Character#isDigit} returns {@code true}, |
87 |
* e.g. 0, 1, 2, ... |
|
88 |
* </dl> |
|
89 |
* </blockquote> |
|
90 |
* |
|
91 |
* <p>The implementation title, version, and vendor strings identify an |
|
92 |
* implementation and are made available conveniently to enable accurate |
|
93 |
* reporting of the packages involved when a problem occurs. The contents |
|
94 |
* all three implementation strings are vendor specific. The |
|
95 |
* implementation version strings have no specified syntax and should |
|
96 |
* only be compared for equality with desired version identifiers. |
|
97 |
* |
|
98 |
* <p>Within each {@code ClassLoader} instance all classes from the same |
|
99 |
* java package have the same Package object. The static methods allow a package |
|
100 |
* to be found by name or the set of all packages known to the current class |
|
101 |
* loader to be found. |
|
102 |
* |
|
103 |
* @see ClassLoader#definePackage |
|
25176 | 104 |
* @since 1.2 |
2 | 105 |
*/ |
106 |
public class Package implements java.lang.reflect.AnnotatedElement { |
|
107 |
/** |
|
108 |
* Return the name of this package. |
|
109 |
* |
|
9266
121fb370f179
7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents:
8543
diff
changeset
|
110 |
* @return The fully-qualified name of this package as defined in section 6.5.3 of |
121fb370f179
7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents:
8543
diff
changeset
|
111 |
* <cite>The Java™ Language Specification</cite>, |
121fb370f179
7032960: API files in java.awt need to be updated for references to JVM Spec with editions/hyperlinks
jjh
parents:
8543
diff
changeset
|
112 |
* for example, {@code java.lang} |
2 | 113 |
*/ |
114 |
public String getName() { |
|
115 |
return pkgName; |
|
116 |
} |
|
117 |
||
118 |
||
119 |
/** |
|
120 |
* Return the title of the specification that this package implements. |
|
121 |
* @return the specification title, null is returned if it is not known. |
|
122 |
*/ |
|
123 |
public String getSpecificationTitle() { |
|
124 |
return specTitle; |
|
125 |
} |
|
126 |
||
127 |
/** |
|
128 |
* Returns the version number of the specification |
|
129 |
* that this package implements. |
|
130 |
* This version string must be a sequence of nonnegative decimal |
|
131 |
* integers separated by "."'s and may have leading zeros. |
|
132 |
* When version strings are compared the most significant |
|
133 |
* numbers are compared. |
|
134 |
* @return the specification version, null is returned if it is not known. |
|
135 |
*/ |
|
136 |
public String getSpecificationVersion() { |
|
137 |
return specVersion; |
|
138 |
} |
|
139 |
||
140 |
/** |
|
141 |
* Return the name of the organization, vendor, |
|
142 |
* or company that owns and maintains the specification |
|
143 |
* of the classes that implement this package. |
|
144 |
* @return the specification vendor, null is returned if it is not known. |
|
145 |
*/ |
|
146 |
public String getSpecificationVendor() { |
|
147 |
return specVendor; |
|
148 |
} |
|
149 |
||
150 |
/** |
|
151 |
* Return the title of this package. |
|
152 |
* @return the title of the implementation, null is returned if it is not known. |
|
153 |
*/ |
|
154 |
public String getImplementationTitle() { |
|
155 |
return implTitle; |
|
156 |
} |
|
157 |
||
158 |
/** |
|
159 |
* Return the version of this implementation. It consists of any string |
|
160 |
* assigned by the vendor of this implementation and does |
|
161 |
* not have any particular syntax specified or expected by the Java |
|
162 |
* runtime. It may be compared for equality with other |
|
163 |
* package version strings used for this implementation |
|
164 |
* by this vendor for this package. |
|
165 |
* @return the version of the implementation, null is returned if it is not known. |
|
166 |
*/ |
|
167 |
public String getImplementationVersion() { |
|
168 |
return implVersion; |
|
169 |
} |
|
170 |
||
171 |
/** |
|
172 |
* Returns the name of the organization, |
|
173 |
* vendor or company that provided this implementation. |
|
174 |
* @return the vendor that implemented this package.. |
|
175 |
*/ |
|
176 |
public String getImplementationVendor() { |
|
177 |
return implVendor; |
|
178 |
} |
|
179 |
||
180 |
/** |
|
181 |
* Returns true if this package is sealed. |
|
182 |
* |
|
183 |
* @return true if the package is sealed, false otherwise |
|
184 |
*/ |
|
185 |
public boolean isSealed() { |
|
186 |
return sealBase != null; |
|
187 |
} |
|
188 |
||
189 |
/** |
|
190 |
* Returns true if this package is sealed with respect to the specified |
|
191 |
* code source url. |
|
192 |
* |
|
193 |
* @param url the code source url |
|
194 |
* @return true if this package is sealed with respect to url |
|
195 |
*/ |
|
196 |
public boolean isSealed(URL url) { |
|
197 |
return url.equals(sealBase); |
|
198 |
} |
|
199 |
||
200 |
/** |
|
201 |
* Compare this package's specification version with a |
|
202 |
* desired version. It returns true if |
|
203 |
* this packages specification version number is greater than or equal |
|
204 |
* to the desired version number. <p> |
|
205 |
* |
|
206 |
* Version numbers are compared by sequentially comparing corresponding |
|
207 |
* components of the desired and specification strings. |
|
208 |
* Each component is converted as a decimal integer and the values |
|
209 |
* compared. |
|
210 |
* If the specification value is greater than the desired |
|
211 |
* value true is returned. If the value is less false is returned. |
|
212 |
* If the values are equal the period is skipped and the next pair of |
|
213 |
* components is compared. |
|
214 |
* |
|
215 |
* @param desired the version string of the desired version. |
|
216 |
* @return true if this package's version number is greater |
|
217 |
* than or equal to the desired version number |
|
218 |
* |
|
219 |
* @exception NumberFormatException if the desired or current version |
|
220 |
* is not of the correct dotted form. |
|
221 |
*/ |
|
222 |
public boolean isCompatibleWith(String desired) |
|
223 |
throws NumberFormatException |
|
224 |
{ |
|
225 |
if (specVersion == null || specVersion.length() < 1) { |
|
226 |
throw new NumberFormatException("Empty version string"); |
|
227 |
} |
|
228 |
||
229 |
String [] sa = specVersion.split("\\.", -1); |
|
230 |
int [] si = new int[sa.length]; |
|
231 |
for (int i = 0; i < sa.length; i++) { |
|
232 |
si[i] = Integer.parseInt(sa[i]); |
|
233 |
if (si[i] < 0) |
|
234 |
throw NumberFormatException.forInputString("" + si[i]); |
|
235 |
} |
|
236 |
||
237 |
String [] da = desired.split("\\.", -1); |
|
238 |
int [] di = new int[da.length]; |
|
239 |
for (int i = 0; i < da.length; i++) { |
|
240 |
di[i] = Integer.parseInt(da[i]); |
|
241 |
if (di[i] < 0) |
|
242 |
throw NumberFormatException.forInputString("" + di[i]); |
|
243 |
} |
|
244 |
||
245 |
int len = Math.max(di.length, si.length); |
|
246 |
for (int i = 0; i < len; i++) { |
|
247 |
int d = (i < di.length ? di[i] : 0); |
|
248 |
int s = (i < si.length ? si[i] : 0); |
|
249 |
if (s < d) |
|
250 |
return false; |
|
251 |
if (s > d) |
|
252 |
return true; |
|
253 |
} |
|
254 |
return true; |
|
255 |
} |
|
256 |
||
257 |
/** |
|
258 |
* Find a package by name in the callers {@code ClassLoader} instance. |
|
259 |
* The callers {@code ClassLoader} instance is used to find the package |
|
260 |
* instance corresponding to the named class. If the callers |
|
261 |
* {@code ClassLoader} instance is null then the set of packages loaded |
|
262 |
* by the system {@code ClassLoader} instance is searched to find the |
|
263 |
* named package. <p> |
|
264 |
* |
|
265 |
* Packages have attributes for versions and specifications only if the class |
|
266 |
* loader created the package instance with the appropriate attributes. Typically, |
|
267 |
* those attributes are defined in the manifests that accompany the classes. |
|
268 |
* |
|
269 |
* @param name a package name, for example, java.lang. |
|
270 |
* @return the package of the requested name. It may be null if no package |
|
271 |
* information is available from the archive or codebase. |
|
272 |
*/ |
|
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
16051
diff
changeset
|
273 |
@CallerSensitive |
2 | 274 |
public static Package getPackage(String name) { |
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
16051
diff
changeset
|
275 |
ClassLoader l = ClassLoader.getClassLoader(Reflection.getCallerClass()); |
2 | 276 |
if (l != null) { |
277 |
return l.getPackage(name); |
|
278 |
} else { |
|
279 |
return getSystemPackage(name); |
|
280 |
} |
|
281 |
} |
|
282 |
||
283 |
/** |
|
284 |
* Get all the packages currently known for the caller's {@code ClassLoader} |
|
285 |
* instance. Those packages correspond to classes loaded via or accessible by |
|
286 |
* name to that {@code ClassLoader} instance. If the caller's |
|
287 |
* {@code ClassLoader} instance is the bootstrap {@code ClassLoader} |
|
288 |
* instance, which may be represented by {@code null} in some implementations, |
|
289 |
* only packages corresponding to classes loaded by the bootstrap |
|
290 |
* {@code ClassLoader} instance will be returned. |
|
291 |
* |
|
292 |
* @return a new array of packages known to the callers {@code ClassLoader} |
|
293 |
* instance. An zero length array is returned if none are known. |
|
294 |
*/ |
|
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
16051
diff
changeset
|
295 |
@CallerSensitive |
2 | 296 |
public static Package[] getPackages() { |
16906
44dfee24cb71
8010117: Annotate jdk caller sensitive methods with @sun.reflect.CallerSensitive
mchung
parents:
16051
diff
changeset
|
297 |
ClassLoader l = ClassLoader.getClassLoader(Reflection.getCallerClass()); |
2 | 298 |
if (l != null) { |
299 |
return l.getPackages(); |
|
300 |
} else { |
|
301 |
return getSystemPackages(); |
|
302 |
} |
|
303 |
} |
|
304 |
||
305 |
/** |
|
306 |
* Get the package for the specified class. |
|
307 |
* The class's class loader is used to find the package instance |
|
308 |
* corresponding to the specified class. If the class loader |
|
309 |
* is the bootstrap class loader, which may be represented by |
|
310 |
* {@code null} in some implementations, then the set of packages |
|
311 |
* loaded by the bootstrap class loader is searched to find the package. |
|
312 |
* <p> |
|
313 |
* Packages have attributes for versions and specifications only |
|
314 |
* if the class loader created the package |
|
315 |
* instance with the appropriate attributes. Typically those |
|
316 |
* attributes are defined in the manifests that accompany |
|
317 |
* the classes. |
|
318 |
* |
|
14014 | 319 |
* @param c the class to get the package of. |
2 | 320 |
* @return the package of the class. It may be null if no package |
321 |
* information is available from the archive or codebase. */ |
|
3959
05a07c0a273b
5062288: (reflect) Core reflection uses raw types when it could be using wildcards
darcy
parents:
715
diff
changeset
|
322 |
static Package getPackage(Class<?> c) { |
2 | 323 |
String name = c.getName(); |
324 |
int i = name.lastIndexOf('.'); |
|
325 |
if (i != -1) { |
|
326 |
name = name.substring(0, i); |
|
327 |
ClassLoader cl = c.getClassLoader(); |
|
328 |
if (cl != null) { |
|
329 |
return cl.getPackage(name); |
|
330 |
} else { |
|
331 |
return getSystemPackage(name); |
|
332 |
} |
|
333 |
} else { |
|
334 |
return null; |
|
335 |
} |
|
336 |
} |
|
337 |
||
338 |
/** |
|
339 |
* Return the hash code computed from the package name. |
|
340 |
* @return the hash code computed from the package name. |
|
341 |
*/ |
|
342 |
public int hashCode(){ |
|
343 |
return pkgName.hashCode(); |
|
344 |
} |
|
345 |
||
346 |
/** |
|
347 |
* Returns the string representation of this Package. |
|
348 |
* Its value is the string "package " and the package name. |
|
349 |
* If the package title is defined it is appended. |
|
350 |
* If the package version is defined it is appended. |
|
351 |
* @return the string representation of the package. |
|
352 |
*/ |
|
353 |
public String toString() { |
|
354 |
String spec = specTitle; |
|
355 |
String ver = specVersion; |
|
356 |
if (spec != null && spec.length() > 0) |
|
357 |
spec = ", " + spec; |
|
358 |
else |
|
359 |
spec = ""; |
|
360 |
if (ver != null && ver.length() > 0) |
|
361 |
ver = ", version " + ver; |
|
362 |
else |
|
363 |
ver = ""; |
|
364 |
return "package " + pkgName + spec + ver; |
|
365 |
} |
|
366 |
||
367 |
private Class<?> getPackageInfo() { |
|
368 |
if (packageInfo == null) { |
|
369 |
try { |
|
370 |
packageInfo = Class.forName(pkgName + ".package-info", false, loader); |
|
371 |
} catch (ClassNotFoundException ex) { |
|
372 |
// store a proxy for the package info that has no annotations |
|
373 |
class PackageInfoProxy {} |
|
374 |
packageInfo = PackageInfoProxy.class; |
|
375 |
} |
|
376 |
} |
|
377 |
return packageInfo; |
|
378 |
} |
|
379 |
||
380 |
/** |
|
381 |
* @throws NullPointerException {@inheritDoc} |
|
382 |
* @since 1.5 |
|
383 |
*/ |
|
384 |
public <A extends Annotation> A getAnnotation(Class<A> annotationClass) { |
|
385 |
return getPackageInfo().getAnnotation(annotationClass); |
|
386 |
} |
|
387 |
||
388 |
/** |
|
16051
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
389 |
* {@inheritDoc} |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
390 |
* @throws NullPointerException {@inheritDoc} |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
391 |
* @since 1.5 |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
392 |
*/ |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
393 |
@Override |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
394 |
public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) { |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
395 |
return AnnotatedElement.super.isAnnotationPresent(annotationClass); |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
396 |
} |
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
397 |
|
649a03329639
8009267: Restore isAnnotationPresent methods in public AnnotatedElement implementations
darcy
parents:
15659
diff
changeset
|
398 |
/** |
2 | 399 |
* @throws NullPointerException {@inheritDoc} |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
400 |
* @since 1.8 |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
401 |
*/ |
15659
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
402 |
@Override |
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
403 |
public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationClass) { |
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
404 |
return getPackageInfo().getAnnotationsByType(annotationClass); |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
405 |
} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
406 |
|
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
407 |
/** |
2 | 408 |
* @since 1.5 |
409 |
*/ |
|
410 |
public Annotation[] getAnnotations() { |
|
411 |
return getPackageInfo().getAnnotations(); |
|
412 |
} |
|
413 |
||
414 |
/** |
|
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
415 |
* @throws NullPointerException {@inheritDoc} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
416 |
* @since 1.8 |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
417 |
*/ |
15659
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
418 |
@Override |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
419 |
public <A extends Annotation> A getDeclaredAnnotation(Class<A> annotationClass) { |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
420 |
return getPackageInfo().getDeclaredAnnotation(annotationClass); |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
421 |
} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
422 |
|
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
423 |
/** |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
424 |
* @throws NullPointerException {@inheritDoc} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
425 |
* @since 1.8 |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
426 |
*/ |
15659
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
427 |
@Override |
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
428 |
public <A extends Annotation> A[] getDeclaredAnnotationsByType(Class<A> annotationClass) { |
e575dab44ff5
8007278: Rename j.l.r.AnnotatedElement.getAnnotations(Class) to getAnnotationsByType(Class)
jfranck
parents:
15534
diff
changeset
|
429 |
return getPackageInfo().getDeclaredAnnotationsByType(annotationClass); |
14676
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
430 |
} |
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
431 |
|
985410ec95e3
7154390: Add support for repeating annotations in j.l.r.AnnotatedElement
jfranck
parents:
14342
diff
changeset
|
432 |
/** |
2 | 433 |
* @since 1.5 |
434 |
*/ |
|
435 |
public Annotation[] getDeclaredAnnotations() { |
|
436 |
return getPackageInfo().getDeclaredAnnotations(); |
|
437 |
} |
|
438 |
||
439 |
/** |
|
440 |
* Construct a package instance with the specified version |
|
441 |
* information. |
|
14014 | 442 |
* @param name the name of the package |
2 | 443 |
* @param spectitle the title of the specification |
444 |
* @param specversion the version of the specification |
|
445 |
* @param specvendor the organization that maintains the specification |
|
446 |
* @param impltitle the title of the implementation |
|
447 |
* @param implversion the version of the implementation |
|
448 |
* @param implvendor the organization that maintains the implementation |
|
449 |
*/ |
|
450 |
Package(String name, |
|
451 |
String spectitle, String specversion, String specvendor, |
|
452 |
String impltitle, String implversion, String implvendor, |
|
453 |
URL sealbase, ClassLoader loader) |
|
454 |
{ |
|
455 |
pkgName = name; |
|
456 |
implTitle = impltitle; |
|
457 |
implVersion = implversion; |
|
458 |
implVendor = implvendor; |
|
459 |
specTitle = spectitle; |
|
460 |
specVersion = specversion; |
|
461 |
specVendor = specvendor; |
|
462 |
sealBase = sealbase; |
|
463 |
this.loader = loader; |
|
464 |
} |
|
465 |
||
466 |
/* |
|
467 |
* Construct a package using the attributes from the specified manifest. |
|
468 |
* |
|
469 |
* @param name the package name |
|
470 |
* @param man the optional manifest for the package |
|
471 |
* @param url the optional code source url for the package |
|
472 |
*/ |
|
473 |
private Package(String name, Manifest man, URL url, ClassLoader loader) { |
|
474 |
String path = name.replace('.', '/').concat("/"); |
|
475 |
String sealed = null; |
|
476 |
String specTitle= null; |
|
477 |
String specVersion= null; |
|
478 |
String specVendor= null; |
|
479 |
String implTitle= null; |
|
480 |
String implVersion= null; |
|
481 |
String implVendor= null; |
|
482 |
URL sealBase= null; |
|
483 |
Attributes attr = man.getAttributes(path); |
|
484 |
if (attr != null) { |
|
485 |
specTitle = attr.getValue(Name.SPECIFICATION_TITLE); |
|
486 |
specVersion = attr.getValue(Name.SPECIFICATION_VERSION); |
|
487 |
specVendor = attr.getValue(Name.SPECIFICATION_VENDOR); |
|
488 |
implTitle = attr.getValue(Name.IMPLEMENTATION_TITLE); |
|
489 |
implVersion = attr.getValue(Name.IMPLEMENTATION_VERSION); |
|
490 |
implVendor = attr.getValue(Name.IMPLEMENTATION_VENDOR); |
|
491 |
sealed = attr.getValue(Name.SEALED); |
|
492 |
} |
|
493 |
attr = man.getMainAttributes(); |
|
494 |
if (attr != null) { |
|
495 |
if (specTitle == null) { |
|
496 |
specTitle = attr.getValue(Name.SPECIFICATION_TITLE); |
|
497 |
} |
|
498 |
if (specVersion == null) { |
|
499 |
specVersion = attr.getValue(Name.SPECIFICATION_VERSION); |
|
500 |
} |
|
501 |
if (specVendor == null) { |
|
502 |
specVendor = attr.getValue(Name.SPECIFICATION_VENDOR); |
|
503 |
} |
|
504 |
if (implTitle == null) { |
|
505 |
implTitle = attr.getValue(Name.IMPLEMENTATION_TITLE); |
|
506 |
} |
|
507 |
if (implVersion == null) { |
|
508 |
implVersion = attr.getValue(Name.IMPLEMENTATION_VERSION); |
|
509 |
} |
|
510 |
if (implVendor == null) { |
|
511 |
implVendor = attr.getValue(Name.IMPLEMENTATION_VENDOR); |
|
512 |
} |
|
513 |
if (sealed == null) { |
|
514 |
sealed = attr.getValue(Name.SEALED); |
|
515 |
} |
|
516 |
} |
|
517 |
if ("true".equalsIgnoreCase(sealed)) { |
|
518 |
sealBase = url; |
|
519 |
} |
|
520 |
pkgName = name; |
|
521 |
this.specTitle = specTitle; |
|
522 |
this.specVersion = specVersion; |
|
523 |
this.specVendor = specVendor; |
|
524 |
this.implTitle = implTitle; |
|
525 |
this.implVersion = implVersion; |
|
526 |
this.implVendor = implVendor; |
|
527 |
this.sealBase = sealBase; |
|
528 |
this.loader = loader; |
|
529 |
} |
|
530 |
||
531 |
/* |
|
532 |
* Returns the loaded system package for the specified name. |
|
533 |
*/ |
|
534 |
static Package getSystemPackage(String name) { |
|
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
535 |
Package pkg = pkgs.get(name); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
536 |
if (pkg == null) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
537 |
name = name.replace('.', '/').concat("/"); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
538 |
String fn = getSystemPackage0(name); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
539 |
if (fn != null) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
540 |
pkg = defineSystemPackage(name, fn); |
2 | 541 |
} |
542 |
} |
|
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
543 |
return pkg; |
2 | 544 |
} |
545 |
||
546 |
/* |
|
547 |
* Return an array of loaded system packages. |
|
548 |
*/ |
|
549 |
static Package[] getSystemPackages() { |
|
550 |
// First, update the system package map with new package names |
|
551 |
String[] names = getSystemPackages0(); |
|
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
552 |
for (String name : names) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
553 |
if (!pkgs.containsKey(name)) { |
22581
e868cde95050
8032779: Update code in java.lang to use newer language features
psandoz
parents:
18546
diff
changeset
|
554 |
defineSystemPackage(name, getSystemPackage0(name)); |
2 | 555 |
} |
556 |
} |
|
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
557 |
return pkgs.values().toArray(new Package[pkgs.size()]); |
2 | 558 |
} |
559 |
||
560 |
private static Package defineSystemPackage(final String iname, |
|
561 |
final String fn) |
|
562 |
{ |
|
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
563 |
// Convert to "."-separated package name |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
564 |
String name = iname.substring(0, iname.length() - 1).replace('/', '.'); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
565 |
// Creates a cached manifest for the file name, allowing |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
566 |
// only-once, lazy reads of manifest from jar files |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
567 |
CachedManifest cachedManifest = createCachedManifest(fn); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
568 |
pkgs.putIfAbsent(name, new Package(name, cachedManifest.getManifest(), |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
569 |
cachedManifest.getURL(), null)); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
570 |
// Ensure we only expose one Package object |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
571 |
return pkgs.get(name); |
2 | 572 |
} |
573 |
||
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
574 |
private static CachedManifest createCachedManifest(String fn) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
575 |
if (!manifests.containsKey(fn)) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
576 |
manifests.putIfAbsent(fn, new CachedManifest(fn)); |
2 | 577 |
} |
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
578 |
return manifests.get(fn); |
2 | 579 |
} |
580 |
||
581 |
// The map of loaded system packages |
|
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
582 |
private static final ConcurrentHashMap<String, Package> pkgs |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
583 |
= new ConcurrentHashMap<>(); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
584 |
|
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
585 |
// Maps each directory or zip file name to its corresponding manifest, if |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
586 |
// it exists |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
587 |
private static final ConcurrentHashMap<String, CachedManifest> manifests |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
588 |
= new ConcurrentHashMap<>(); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
589 |
|
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
590 |
private static class CachedManifest { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
591 |
private static final Manifest EMPTY_MANIFEST = new Manifest(); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
592 |
private final String fileName; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
593 |
private final URL url; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
594 |
private volatile Manifest manifest; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
595 |
|
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
596 |
CachedManifest(final String fileName) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
597 |
this.fileName = fileName; |
29986
97167d851fc4
8078467: Update core libraries to use diamond with anonymous classes
darcy
parents:
27348
diff
changeset
|
598 |
this.url = AccessController.doPrivileged(new PrivilegedAction<>() { |
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
599 |
public URL run() { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
600 |
final File file = new File(fileName); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
601 |
if (file.isFile()) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
602 |
try { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
603 |
return ParseUtil.fileToEncodedURL(file); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
604 |
} catch (MalformedURLException e) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
605 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
606 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
607 |
return null; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
608 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
609 |
}); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
610 |
} |
2 | 611 |
|
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
612 |
public URL getURL() { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
613 |
return url; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
614 |
} |
2 | 615 |
|
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
616 |
public Manifest getManifest() { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
617 |
if (url == null) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
618 |
return EMPTY_MANIFEST; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
619 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
620 |
Manifest m = manifest; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
621 |
if (m != null) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
622 |
return m; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
623 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
624 |
synchronized (this) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
625 |
m = manifest; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
626 |
if (m != null) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
627 |
return m; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
628 |
} |
29986
97167d851fc4
8078467: Update core libraries to use diamond with anonymous classes
darcy
parents:
27348
diff
changeset
|
629 |
m = AccessController.doPrivileged(new PrivilegedAction<>() { |
27348
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
630 |
public Manifest run() { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
631 |
try (FileInputStream fis = new FileInputStream(fileName); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
632 |
JarInputStream jis = new JarInputStream(fis, false)) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
633 |
return jis.getManifest(); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
634 |
} catch (IOException e) { |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
635 |
return null; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
636 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
637 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
638 |
}); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
639 |
manifest = m = (m == null ? EMPTY_MANIFEST : m); |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
640 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
641 |
return m; |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
642 |
} |
1614e0fd2b9b
8060130: Simplify the synchronization of defining and getting java.lang.Package
redestad
parents:
25859
diff
changeset
|
643 |
} |
2 | 644 |
|
645 |
private static native String getSystemPackage0(String name); |
|
646 |
private static native String[] getSystemPackages0(); |
|
647 |
||
648 |
/* |
|
649 |
* Private storage for the package name and attributes. |
|
650 |
*/ |
|
651 |
private final String pkgName; |
|
652 |
private final String specTitle; |
|
653 |
private final String specVersion; |
|
654 |
private final String specVendor; |
|
655 |
private final String implTitle; |
|
656 |
private final String implVersion; |
|
657 |
private final String implVendor; |
|
658 |
private final URL sealBase; |
|
32649
2ee9017c7597
8136583: Core libraries should use blessed modifier order
martin
parents:
29986
diff
changeset
|
659 |
private final transient ClassLoader loader; |
11117
b6e68b1344d4
7116404: Miscellaneous warnings (java.rmi.**, serialization, some core classes)
alanb
parents:
9275
diff
changeset
|
660 |
private transient Class<?> packageInfo; |
2 | 661 |
} |