class SootASMClassWriter extends ClassWriter {

  /**
   * Constructs a new {@link ClassWriter} object.
   *
   * @param flags
   *          option flags that can be used to modify the default behavior of this class. See {@link #COMPUTE_MAXS},
   *          {@link #COMPUTE_FRAMES}.
   */
  public SootASMClassWriter(int flags) {
    super(flags);
  }

  /*
   * We need to overwrite this method here, as we are generating multiple classes that might reference each other. See
   * asm4-guide, top of page 45 for more information.
   */
  /*
   * (non-Javadoc)
   *
   * @see org.objectweb.asm.ClassWriter#getCommonSuperClass(java.lang.String, java.lang.String)
   */
  @Override
  protected String getCommonSuperClass(String type1, String type2) {<FILL_FUNCTION_BODY>}

}

    String typeName1 = type1.replace('/', '.');
    String typeName2 = type2.replace('/', '.');

    SootClass s1 = Scene.v().getSootClass(typeName1);
    SootClass s2 = Scene.v().getSootClass(typeName2);

    // If these two classes haven't been loaded yet or are phantom, we take
    // java.lang.Object as the common superclass
    final Type mergedType;
    if (s1.isPhantom() || s2.isPhantom() || s1.resolvingLevel() == SootClass.DANGLING
        || s2.resolvingLevel() == SootClass.DANGLING) {
      mergedType = Scene.v().getObjectType();
    } else {
      Type t1 = s1.getType();
      Type t2 = s2.getType();

      mergedType = t1.merge(t2, Scene.v());
    }

    if (mergedType instanceof RefType) {
      return slashify(((RefType) mergedType).getClassName());
    } else {
      throw new RuntimeException("Could not find common super class");
    }
  
<methods>public void <init>(int) ,public void <init>(org.objectweb.asm.ClassReader, int) ,public boolean hasFlags(int) ,public int newClass(java.lang.String) ,public int newConst(java.lang.Object) ,public transient int newConstantDynamic(java.lang.String, java.lang.String, org.objectweb.asm.Handle, java.lang.Object[]) ,public int newField(java.lang.String, java.lang.String, java.lang.String) ,public int newHandle(int, java.lang.String, java.lang.String, java.lang.String) ,public int newHandle(int, java.lang.String, java.lang.String, java.lang.String, boolean) ,public transient int newInvokeDynamic(java.lang.String, java.lang.String, org.objectweb.asm.Handle, java.lang.Object[]) ,public int newMethod(java.lang.String, java.lang.String, java.lang.String, boolean) ,public int newMethodType(java.lang.String) ,public int newModule(java.lang.String) ,public int newNameType(java.lang.String, java.lang.String) ,public int newPackage(java.lang.String) ,public int newUTF8(java.lang.String) ,public byte[] toByteArray() ,public final void visit(int, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) ,public final org.objectweb.asm.AnnotationVisitor visitAnnotation(java.lang.String, boolean) ,public final void visitAttribute(org.objectweb.asm.Attribute) ,public final void visitEnd() ,public final org.objectweb.asm.FieldVisitor visitField(int, java.lang.String, java.lang.String, java.lang.String, java.lang.Object) ,public final void visitInnerClass(java.lang.String, java.lang.String, java.lang.String, int) ,public final org.objectweb.asm.MethodVisitor visitMethod(int, java.lang.String, java.lang.String, java.lang.String, java.lang.String[]) ,public final org.objectweb.asm.ModuleVisitor visitModule(java.lang.String, int, java.lang.String) ,public final void visitNestHost(java.lang.String) ,public final void visitNestMember(java.lang.String) ,public final void visitOuterClass(java.lang.String, java.lang.String, java.lang.String) ,public final void visitPermittedSubclass(java.lang.String) ,public final org.objectweb.asm.RecordComponentVisitor visitRecordComponent(java.lang.String, java.lang.String, java.lang.String) ,public final void visitSource(java.lang.String, java.lang.String) ,public final org.objectweb.asm.AnnotationVisitor visitTypeAnnotation(int, org.objectweb.asm.TypePath, java.lang.String, boolean) <variables>public static final int COMPUTE_FRAMES,public static final int COMPUTE_MAXS,private int accessFlags,private int compute,private org.objectweb.asm.ByteVector debugExtension,private int enclosingClassIndex,private int enclosingMethodIndex,private org.objectweb.asm.Attribute firstAttribute,private org.objectweb.asm.FieldWriter firstField,private org.objectweb.asm.MethodWriter firstMethod,private org.objectweb.asm.RecordComponentWriter firstRecordComponent,private final int flags,private org.objectweb.asm.ByteVector innerClasses,private int interfaceCount,private int[] interfaces,private org.objectweb.asm.FieldWriter lastField,private org.objectweb.asm.MethodWriter lastMethod,private org.objectweb.asm.RecordComponentWriter lastRecordComponent,private org.objectweb.asm.AnnotationWriter lastRuntimeInvisibleAnnotation,private org.objectweb.asm.AnnotationWriter lastRuntimeInvisibleTypeAnnotation,private org.objectweb.asm.AnnotationWriter lastRuntimeVisibleAnnotation,private org.objectweb.asm.AnnotationWriter lastRuntimeVisibleTypeAnnotation,private org.objectweb.asm.ModuleWriter moduleWriter,private int nestHostClassIndex,private org.objectweb.asm.ByteVector nestMemberClasses,private int numberOfInnerClasses,private int numberOfNestMemberClasses,private int numberOfPermittedSubclasses,private org.objectweb.asm.ByteVector permittedSubclasses,private int signatureIndex,private int sourceFileIndex,private int superClass,private final org.objectweb.asm.SymbolTable symbolTable,private int thisClass,private int version