private void addNewConstructorWithInitializing(ASTRewrite rewrite, TypeDeclaration typeDeclaration) throws JavaModelException { MethodDeclaration newConstructor= getAST().newMethodDeclaration(); newConstructor.setConstructor(true); newConstructor.setExtraDimensions(0); newConstructor.setModifiers(getModifiersForDefaultConstructor(typeDeclaration)); newConstructor.setName(getAST().newSimpleName(typeDeclaration.getName().getIdentifier())); addFieldInitializationToConstructor(rewrite, newConstructor);
private void addNewConstructorWithInitializing(ASTRewrite rewrite, TypeDeclaration typeDeclaration) throws CoreException { String constructorSource = format(getNewConstructorSource(typeDeclaration), 0); BodyDeclaration newConstructor= (BodyDeclaration)rewrite.createPlaceholder(constructorSource, ASTRewrite.BODY_DECLARATION);
    private void addNewConstructorWithInitializing(ASTRewrite rewrite, TypeDeclaration typeDeclaration) throws JavaModelException {        MethodDeclaration newConstructor= getAST().newMethodDeclaration();        newConstructor.setConstructor(true);        newConstructor.setExtraDimensions(0);        newConstructor.setModifiers(getModifiersForDefaultConstructor(typeDeclaration));        newConstructor.setName(getAST().newSimpleName(typeDeclaration.getName().getIdentifier()));        addFieldInitializationToConstructor(rewrite, newConstructor);        rewrite.markAsInserted(newConstructor);        int constructorInsertIndex= computeInsertIndexForNewConstructor(typeDeclaration);        typeDeclaration.bodyDeclarations().add(constructorInsertIndex, newConstructor);    }