public byte[] generateBytecode() {
if (bytecode == null) {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);
cw.visit(version, access, getClassDescriptor(), signature, getSuperClassDescriptor(), toInteralNames(interfaces));
for (ClassPartDescr part : classParts) part.write(this, cw);
cw.visitEnd();
bytecode = cw.toByteArray();
}
return bytecode;
}