Lines 330-336
Link Here
|
330 |
*/ |
330 |
*/ |
331 |
protected Package getPackageFast(String name, String sname, boolean recurse) { |
331 |
protected Package getPackageFast(String name, String sname, boolean recurse) { |
332 |
synchronized (packages) { |
332 |
synchronized (packages) { |
333 |
Package pkg = (Package)packages.get(name); |
333 |
Object obj = packages.get(name); |
|
|
334 |
if (obj == JUST_DEFINING_PACKAGE) { |
335 |
return null; |
336 |
} |
337 |
Package pkg = (Package)obj; |
334 |
if (pkg != null) { |
338 |
if (pkg != null) { |
335 |
return pkg; |
339 |
return pkg; |
336 |
} |
340 |
} |
Lines 359-364
Link Here
|
359 |
} |
363 |
} |
360 |
} |
364 |
} |
361 |
|
365 |
|
|
|
366 |
/** this is not value you want to find */ |
367 |
private static Object JUST_DEFINING_PACKAGE = new Object(); |
368 |
|
362 |
/** This is here just for locking serialization purposes. |
369 |
/** This is here just for locking serialization purposes. |
363 |
* Delegates to super.definePackage with proper locking. |
370 |
* Delegates to super.definePackage with proper locking. |
364 |
* Also tracks the package in our private cache, since |
371 |
* Also tracks the package in our private cache, since |
Lines 369-374
Link Here
|
369 |
String implVersion, String implVendor, URL sealBase ) |
376 |
String implVersion, String implVendor, URL sealBase ) |
370 |
throws IllegalArgumentException { |
377 |
throws IllegalArgumentException { |
371 |
synchronized (packages) { |
378 |
synchronized (packages) { |
|
|
379 |
packages.put(name, JUST_DEFINING_PACKAGE); |
372 |
Package pkg = super.definePackage (name, specTitle, specVersion, specVendor, implTitle, |
380 |
Package pkg = super.definePackage (name, specTitle, specVersion, specVendor, implTitle, |
373 |
implVersion, implVendor, sealBase); |
381 |
implVersion, implVendor, sealBase); |
374 |
packages.put(name, pkg); |
382 |
packages.put(name, pkg); |