ASTNode (ASTNode first, ASTNode last, ASTNode anchor, Boolean before) { ASTNode afterLast = last.getTreeNext(); ASTNode next; for (ASTNode child = first; child != afterLast; child = next) { next = child.getTreeNext(); if (child.getElementType() == GroovyStubElementTypes.CONSTRUCTOR) { ASTNode oldIdentifier = child.findChildByType(GroovyTokenTypes.mIDENT); ASTNode newIdentifier = ((GrTypeDefinition)getParent()).getNameIdentifierGroovy().getNode().copyElement(); child.replaceChild(oldIdentifier, newIdentifier); } } return super.addInternal(first, last, anchor, before); }