String newName = nameReplacements.get(oldName);
nc.replaceClassName(oldName, newName);
}
nc.setName(o.getName());
final byte[] data = nc.toBytecode();
classes.put(o.getName(), new ClassData(o.getName(), new Date().getTime(), new ContentSource() {
@Override
public byte[] getData() throws IOException {
return data;
}
}));
}
for (Class<?> o : addedClasses) {
CtClass nc = pool.get(o.getName());
if (nc.isFrozen()) {
nc.defrost();
}
for (String newName : nameReplacements.keySet()) {
String oldName = nameReplacements.get(newName);
nc.replaceClassName(newName, oldName);
}
final byte[] data = nc.toBytecode();
classes.put(o.getName(), new ClassData(o.getName(), new Date().getTime(), new ContentSource() {
@Override
public byte[] getData() throws IOException {
return data;
}
}));