assert (superDescs != null);
assert (superDescs.size() > 0);
// The ASM model is to chain a bunch of visitors together.
ClassWriter writer = new ClassWriter(0);
ClassVisitor v = writer;
// v = new CheckClassAdapter(v);
// v = new TraceClassVisitor(v, new PrintWriter(System.out));
String[] interfaces;
// TODO(bov): something better than linear?
if (superDescs.contains("java/lang/Object")) {
interfaces = null;
} else {
interfaces = superDescs.toArray(new String[superDescs.size()]);
}
v.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC | Opcodes.ACC_INTERFACE, desc,
null, "java/lang/Object", interfaces);
v.visitEnd();
return writer.toByteArray();
}