class CtNewClass extends CtClassType {
    /* true if the class is an interface.
     */
    protected boolean hasConstructor;

    CtNewClass(String name, ClassPool cp,
               boolean isInterface, CtClass superclass) {
        super(name, cp);
        wasChanged = true;
        String superName;
        if (isInterface || superclass == null)
            superName = null;
        else
            superName = superclass.getName();

        classfile = new ClassFile(isInterface, name, superName);
        if (isInterface && superclass != null)
            classfile.setInterfaces(new String[] { superclass.getName() });

        setModifiers(Modifier.setPublic(getModifiers()));
        hasConstructor = isInterface;
    }

    @Override
    protected void extendToString(StringBuffer buffer) {
        if (hasConstructor)
            buffer.append("hasConstructor ");

        super.extendToString(buffer);
    }

    @Override
    public void addConstructor(CtConstructor c)
        throws CannotCompileException
    {
        hasConstructor = true;
        super.addConstructor(c);
    }

    @Override
    public void toBytecode(DataOutputStream out)
        throws CannotCompileException, IOException
    {
        if (!hasConstructor)
            try {
                inheritAllConstructors();
                hasConstructor = true;
            }
            catch (NotFoundException e) {
                throw new CannotCompileException(e);
            }

        super.toBytecode(out);
    }

    /**
     * Adds constructors inhrited from the super class.
     *
     * <p>After this method is called, the class inherits all the
     * constructors from the super class.  The added constructor
     * calls the super's constructor with the same signature.
     */
    public void inheritAllConstructors()
        throws CannotCompileException, NotFoundException
    {<FILL_FUNCTION_BODY>}

    private boolean isInheritable(int mod, CtClass superclazz) {
        if (Modifier.isPrivate(mod))
            return false;

        if (Modifier.isPackage(mod)) {
            String pname = getPackageName();
            String pname2 = superclazz.getPackageName();
            if (pname == null)
                return pname2 == null;
            return pname.equals(pname2);
        }

        return true;
    }
}

        CtClass superclazz;
        CtConstructor[] cs;

        superclazz = getSuperclass();
        cs = superclazz.getDeclaredConstructors();

        int n = 0;
        for (int i = 0; i < cs.length; ++i) {
            CtConstructor c = cs[i];
            int mod = c.getModifiers();
            if (isInheritable(mod, superclazz)) {
                CtConstructor cons
                    = CtNewConstructor.make(c.getParameterTypes(),
                                            c.getExceptionTypes(), this);
                cons.setModifiers(mod & (Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE));
                addConstructor(cons);
                ++n;
            }
        }

        if (n < 1)
            throw new CannotCompileException(
                        "no inheritable constructor in " + superclazz.getName());

    
<methods>public void addConstructor(org.hotswap.agent.javassist.CtConstructor) throws org.hotswap.agent.javassist.CannotCompileException,public void addField(org.hotswap.agent.javassist.CtField, java.lang.String) throws org.hotswap.agent.javassist.CannotCompileException,public void addField(org.hotswap.agent.javassist.CtField, org.hotswap.agent.javassist.CtField.Initializer) throws org.hotswap.agent.javassist.CannotCompileException,public void addInterface(org.hotswap.agent.javassist.CtClass) ,public void addMethod(org.hotswap.agent.javassist.CtMethod) throws org.hotswap.agent.javassist.CannotCompileException,public void defrost() ,public void freeze() ,public org.hotswap.agent.javassist.compiler.AccessorMaker getAccessorMaker() ,public java.lang.Object getAnnotation(Class<?>) throws java.lang.ClassNotFoundException,public java.lang.Object[] getAnnotations() throws java.lang.ClassNotFoundException,public byte[] getAttribute(java.lang.String) ,public java.lang.Object[] getAvailableAnnotations() ,public org.hotswap.agent.javassist.bytecode.ClassFile getClassFile2() ,public org.hotswap.agent.javassist.bytecode.ClassFile getClassFile3(boolean) ,public org.hotswap.agent.javassist.CtConstructor getClassInitializer() ,public org.hotswap.agent.javassist.ClassPool getClassPool() ,public org.hotswap.agent.javassist.CtConstructor getConstructor(java.lang.String) throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtConstructor[] getConstructors() ,public org.hotswap.agent.javassist.CtBehavior[] getDeclaredBehaviors() ,public org.hotswap.agent.javassist.CtConstructor[] getDeclaredConstructors() ,public org.hotswap.agent.javassist.CtField getDeclaredField(java.lang.String) throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtField getDeclaredField(java.lang.String, java.lang.String) throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtField[] getDeclaredFields() ,public org.hotswap.agent.javassist.CtMethod getDeclaredMethod(java.lang.String) throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtMethod getDeclaredMethod(java.lang.String, org.hotswap.agent.javassist.CtClass[]) throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtMethod[] getDeclaredMethods() ,public org.hotswap.agent.javassist.CtMethod[] getDeclaredMethods(java.lang.String) throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtClass getDeclaringClass() throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtBehavior getEnclosingBehavior() throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtField getField(java.lang.String, java.lang.String) throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtField[] getFields() ,public java.lang.String getGenericSignature() ,public org.hotswap.agent.javassist.CtClass[] getInterfaces() throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtMethod getMethod(java.lang.String, java.lang.String) throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtMethod[] getMethods() ,public int getModifiers() ,public org.hotswap.agent.javassist.CtClass[] getNestedClasses() throws org.hotswap.agent.javassist.NotFoundException,public org.hotswap.agent.javassist.CtClass getSuperclass() throws org.hotswap.agent.javassist.NotFoundException,public java.lang.String getSuperclassName() throws org.hotswap.agent.javassist.NotFoundException,public java.net.URL getURL() throws org.hotswap.agent.javassist.NotFoundException,public boolean hasAnnotation(java.lang.String) ,public void instrument(org.hotswap.agent.javassist.CodeConverter) throws org.hotswap.agent.javassist.CannotCompileException,public void instrument(org.hotswap.agent.javassist.expr.ExprEditor) throws org.hotswap.agent.javassist.CannotCompileException,public boolean isAnnotation() ,public boolean isEnum() ,public boolean isFrozen() ,public boolean isInnerClass() throws org.hotswap.agent.javassist.NotFoundException,public boolean isInterface() ,public boolean isModified() ,public org.hotswap.agent.javassist.CtConstructor makeClassInitializer() throws org.hotswap.agent.javassist.CannotCompileException,public org.hotswap.agent.javassist.CtClass makeNestedClass(java.lang.String, boolean) ,public java.lang.String makeUniqueName(java.lang.String) ,public void prune() ,public void rebuildClassFile() ,public void removeConstructor(org.hotswap.agent.javassist.CtConstructor) throws org.hotswap.agent.javassist.NotFoundException,public void removeField(org.hotswap.agent.javassist.CtField) throws org.hotswap.agent.javassist.NotFoundException,public void removeMethod(org.hotswap.agent.javassist.CtMethod) throws org.hotswap.agent.javassist.NotFoundException,public void replaceClassName(org.hotswap.agent.javassist.ClassMap) throws java.lang.RuntimeException,public void replaceClassName(java.lang.String, java.lang.String) throws java.lang.RuntimeException,public void setAttribute(java.lang.String, byte[]) ,public void setGenericSignature(java.lang.String) ,public void setInterfaces(org.hotswap.agent.javassist.CtClass[]) ,public void setModifiers(int) ,public void setName(java.lang.String) throws java.lang.RuntimeException,public void setSuperclass(org.hotswap.agent.javassist.CtClass) throws org.hotswap.agent.javassist.CannotCompileException,public boolean stopPruning(boolean) ,public boolean subclassOf(org.hotswap.agent.javassist.CtClass) ,public boolean subtypeOf(org.hotswap.agent.javassist.CtClass) throws org.hotswap.agent.javassist.NotFoundException,public void toBytecode(java.io.DataOutputStream) throws org.hotswap.agent.javassist.CannotCompileException, java.io.IOException<variables>private static final int GET_THRESHOLD,private org.hotswap.agent.javassist.compiler.AccessorMaker accessors,org.hotswap.agent.javassist.ClassPool classPool,org.hotswap.agent.javassist.bytecode.ClassFile classfile,private boolean doPruning,private org.hotswap.agent.javassist.FieldInitLink fieldInitializers,boolean gcConstPool,private int getCount,private Map<org.hotswap.agent.javassist.CtMethod,java.lang.String> hiddenMethods,private Reference<org.hotswap.agent.javassist.CtMember.Cache> memberCache,byte[] rawClassfile,private int uniqueNumberSeed,boolean wasChanged,private boolean wasFrozen,boolean wasPruned