// Use the same loader, allowing the new class access to
// same package protected members.
loader = (Loader) parent;
break getLoader;
}
SoftReference ref = (SoftReference) cLoaders.get(parent);
if (ref != null) {
loader = (Loader) ref.get();
if (loader != null && loader.isValid()) {
break getLoader;
}
ref.clear();
}
loader = parent == null ? new Loader() : new Loader(parent);
cLoaders.put(parent, new SoftReference(loader));
}
if (explicit) {
reserveCheck: {
for (int i=0; i<2; i++) {
if (loader.reserveName(name)) {
try {
loader.loadClass(name);
} catch (ClassNotFoundException e) {
break reserveCheck;
}
}
if (i > 0) {
throw new IllegalStateException
("Class name already reserved: " + name);
}
// Make a new loader and try again.
loader = parent == null ? new Loader() : new Loader(parent);
}
// Save new loader.
cLoaders.put(parent, new SoftReference(loader));
}
} else {
for (int tryCount = 0; tryCount < 1000; tryCount++) {
name = null;