}));
}
final ProxyManagerImpl mgr = new ProxyManagerImpl();
Class cls;
BCClass bc;
for (int i = 0; i < types.size(); i++) {
cls = Class.forName((String) types.get(i));
try {
if (Class.forName(getProxyClassName(cls, false), true,
GeneratedClasses.getMostDerivedLoader(cls, Proxy.class))
!= null)
continue;
} catch (Throwable t) {
// expected if the class hasn't been generated
}
if (Collection.class.isAssignableFrom(cls))
bc = mgr.generateProxyCollectionBytecode(cls, false);
else if (Map.class.isAssignableFrom(cls))
bc = mgr.generateProxyMapBytecode(cls, false);
else if (Date.class.isAssignableFrom(cls))
bc = mgr.generateProxyDateBytecode(cls, false);
else if (Calendar.class.isAssignableFrom(cls))
bc = mgr.generateProxyCalendarBytecode(cls, false);
else {
final Class fCls = cls;
// TODO Move this to J2DOPrivHelper
bc = AccessController
.doPrivileged(new PrivilegedAction<BCClass>() {
public BCClass run() {
return mgr.generateProxyBeanBytecode(fCls, false);
}
});
}
System.out.println(bc.getName());
bc.write(new File(dir, bc.getClassName() + ".class"));
}
}