If tree refers to a class instance creation expression
add all free variables of the freshly created class.
198609
public void visitNewClass(JCNewClass tree) {
            ClassSymbol c = (ClassSymbol)tree.constructor.owner;
            addFreeVars(c);
            super.visitNewClass(tree);
        }
1095253
public void addTree(@Nonnull final ExpressionTree tree) {
    assertNotNull("Tree is null", tree);
    if (last.isEmptySlot()) {
      final ExpressionTreeElement thatTreeRoot = tree.getRoot();
      if (!thatTreeRoot.isEmptySlot()) {
        last = thatTreeRoot;
        last.makeMaxPriority();
      }
    } else {
      last = last.addSubTree(tree);
    }
  }
187494
private void buildMultiJoinTree(TableAlias left, ClassDescriptor cld, String name, boolean useOuterJoin)
    {
        DescriptorRepository repository = cld.getRepository();
        Class[] multiJoinedClasses = repository.getSubClassesMultipleJoinedTables(cld, false);

        for (int i = 0; i < multiJoinedClasses.length; i++)
        {
            ClassDescriptor subCld = repository.getDescriptorFor(multiJoinedClasses[i]);
            SuperReferenceDescriptor srd = subCld.getSuperReference();
            if (srd != null)
            {
                FieldDescriptor[] leftFields = subCld.getPkFields();
                FieldDescriptor[] rightFields = srd.getForeignKeyFieldDescriptors(subCld);
                TableAlias base_alias = getTableAliasForPath(name, null, null);

                String aliasName = String.valueOf(getAliasChar()) + m_aliasCount++;
                TableAlias right = new TableAlias(subCld, aliasName, false, null);

                Join join1to1 = new Join(left, leftFields, right, rightFields, useOuterJoin, "subClass");
                base_alias.addJoin(join1to1);

                buildMultiJoinTree(right, subCld, name, useOuterJoin);
            }
        }
    }
671470
private Optional<RightProvenance> createProvenanceElements(IQTree rightTree,
                                                               ImmutableSubstitution<? extends ImmutableTerm> selectedSubstitution,
                                                               ImmutableSet<Variable> leftVariables,
                                                               VariableGenerator variableGenerator) {
        if (selectedSubstitution.getImmutableMap().entrySet().stream()
                .filter(e -> !leftVariables.contains(e.getKey()))
                .map(Map.Entry::getValue)
                .anyMatch(value -> value.getVariableStream()
                        .allMatch(leftVariables::contains)
                        || value.isGround())) {

            VariableNullability rightVariableNullability = rightTree.getVariableNullability();

            Optional<Variable> nonNullableRightVariable = rightTree.getVariables().stream()
                    .filter(v -> !leftVariables.contains(v))
                    .filter(v -> !rightVariableNullability.isPossiblyNullable(v))
                    .findFirst();

            if (nonNullableRightVariable.isPresent()) {
                return Optional.of(new RightProvenance(nonNullableRightVariable.get()));
            }
            /*
             * Otherwise, creates a fresh variable and its construction node
             */
            else {
                Variable provenanceVariable = variableGenerator.generateNewVariable();

                ImmutableSet<Variable> newRightProjectedVariables =
                        Stream.concat(
                                    Stream.of(provenanceVariable),
                                    rightTree.getVariables().stream())
                                .collect(ImmutableCollectors.toSet());

                ConstructionNode newRightConstructionNode = iqFactory.createConstructionNode(
                        newRightProjectedVariables,
                        substitutionFactory.getSubstitution(provenanceVariable,
                                termFactory.getProvenanceSpecialConstant()));

                return Optional.of(new RightProvenance(provenanceVariable, newRightConstructionNode));
            }
        }
        else {
            return Optional.empty();
        }
    }
793824
def _add(self, codeobj):
        """"""
        assert isinstance(codeobj, (CodeNamespace, CodeClass,
                                    CodeFunction, CodeVariable))
        self.children.append(codeobj)
1259064
function addChildrenRecursively(node) {
            if (!node || ts.isToken(node)) {
                return;
            }
            switch (node.kind) {
                case 148 /* Constructor */:
                    // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it.
                    var ctr = node;
                    addNodeWithRecursiveChild(ctr, ctr.body);
                    // Parameter properties are children of the class, not the constructor.
                    for (var _i = 0, _a = ctr.parameters; _i < _a.length; _i++) {
                        var param = _a[_i];
                        if (ts.isParameterPropertyDeclaration(param)) {
                            addLeafNode(param);
                        }
                    }
                    break;
                case 147 /* MethodDeclaration */:
                case 149 /* GetAccessor */:
                case 150 /* SetAccessor */:
                case 146 /* MethodSignature */:
                    if (!ts.hasDynamicName(node)) {
                        addNodeWithRecursiveChild(node, node.body);
                    }
                    break;
                case 145 /* PropertyDeclaration */:
                case 144 /* PropertySignature */:
                    if (!ts.hasDynamicName(node)) {
                        addLeafNode(node);
                    }
                    break;
                case 231 /* ImportClause */:
                    var importClause = node;
                    // Handle default import case e.g.:
                    //    import d from "mod";
                    if (importClause.name) {
                        addLeafNode(importClause);
                    }
                    // Handle named bindings in imports e.g.:
                    //    import * as NS from "mod";
                    //    import {a, b as B} from "mod";
                    var namedBindings = importClause.namedBindings;
                    if (namedBindings) {
                        if (namedBindings.kind === 232 /* NamespaceImport */) {
                            addLeafNode(namedBindings);
                        }
                        else {
                            for (var _b = 0, _c = namedBindings.elements; _b < _c.length; _b++) {
                                var element = _c[_b];
                                addLeafNode(element);
                            }
                        }
                    }
                    break;
                case 169 /* BindingElement */:
                case 218 /* VariableDeclaration */:
                    var decl = node;
                    var name_38 = decl.name;
                    if (ts.isBindingPattern(name_38)) {
                        addChildrenRecursively(name_38);
                    }
                    else if (decl.initializer && isFunctionOrClassExpression(decl.initializer)) {
                        // For `const x = function() {}`, just use the function node, not the const.
                        addChildrenRecursively(decl.initializer);
                    }
                    else {
                        addNodeWithRecursiveChild(decl, decl.initializer);
                    }
                    break;
                case 180 /* ArrowFunction */:
                case 220 /* FunctionDeclaration */:
                case 179 /* FunctionExpression */:
                    addNodeWithRecursiveChild(node, node.body);
                    break;
                case 224 /* EnumDeclaration */:
                    startNode(node);
                    for (var _d = 0, _e = node.members; _d < _e.length; _d++) {
                        var member = _e[_d];
                        if (!isComputedProperty(member)) {
                            addLeafNode(member);
                        }
                    }
                    endNode();
                    break;
                case 221 /* ClassDeclaration */:
                case 192 /* ClassExpression */:
                case 222 /* InterfaceDeclaration */:
                    startNode(node);
                    for (var _f = 0, _g = node.members; _f < _g.length; _f++) {
                        var member = _g[_f];
                        addChildrenRecursively(member);
                    }
                    endNode();
                    break;
                case 225 /* ModuleDeclaration */:
                    addNodeWithRecursiveChild(node, getInteriorModule(node).body);
                    break;
                case 238 /* ExportSpecifier */:
                case 229 /* ImportEqualsDeclaration */:
                case 153 /* IndexSignature */:
                case 151 /* CallSignature */:
                case 152 /* ConstructSignature */:
                case 223 /* TypeAliasDeclaration */:
                    addLeafNode(node);
                    break;
                default:
                    if (node.jsDocComments) {
                        for (var _h = 0, _j = node.jsDocComments; _h < _j.length; _h++) {
                            var jsDocComment = _j[_h];
                            for (var _k = 0, _l = jsDocComment.tags; _k < _l.length; _k++) {
                                var tag = _l[_k];
                                if (tag.kind === 279 /* JSDocTypedefTag */) {
                                    addLeafNode(tag);
                                }
                            }
                        }
                    }
                    ts.forEachChild(node, addChildrenRecursively);
            }
        }
913637
function _addNewEntries(treeData, added) {
        added.forEach(function (filePath) {
            var isFolder = _.last(filePath) === "/";

            filePath = isFolder ? filePath.substr(0, filePath.length - 1) : filePath;

            var parentPath = FileUtils.getDirectoryPath(filePath),
                parentObjectPath = _filePathToObjectPath(treeData, parentPath),
                basename = FileUtils.getBaseName(filePath);

            if (parentObjectPath) {
                // Verify that the children are loaded
                var childrenPath = _.clone(parentObjectPath);
                childrenPath.push("children");
                if (treeData.getIn(childrenPath) === null) {
                    return;
                }

                treeData = _createPlaceholder(treeData, parentPath, basename, isFolder, {
                    notInCreateMode: true,
                    doNotOpen: true
                });
            }
        });

        return treeData;
    }
524998
public static void addGeneratedConstructor(ClassNode classNode, ConstructorNode consNode) {
        classNode.addConstructor(consNode);
        markAsGenerated(classNode, consNode);
    }
772238
def add_tree(self, tree, parent=None):
        
        if tree.path in self.path_db:
            self.remove_tree_by_path(tree.path)

        # index all indexable attributes
        for index in tree.indexes:
            if not getattr(tree, index):
                continue

            self._add_to(
                getattr(self, index + "_db"),
                getattr(tree, index),
                tree,
            )

        if parent:
            self._add_to(self.parent_db, tree.path, parent)

        # make sure, that all sub-trees starts with path of parent tree
        for sub_tree in tree.sub_trees:
            assert sub_tree.path.startswith(tree.path)

        for sub_tree in tree.sub_trees:
            self.add_tree(sub_tree, parent=tree)
805560
def make_tree(statement, filename="<aexec>", symbol="single", local={}):
    """"""
    # Create tree
    tree = ast.parse(CORO_CODE, filename, symbol)
    # Check expression statement
    if isinstance(statement, ast.Expr):
        tree.body[0].body[0].value.elts[0] = statement.value
    else:
        tree.body[0].body.insert(0, statement)
    # Check and return coroutine
    exec(compile(tree, filename, symbol))
    return tree
1018823
def _createbound(obj):
    """"""
    # Start by allowing objects to define custom unbound reference hooks
    try:
        kls = obj._unboundreference_()
    except AttributeError:
        kls = type(obj)
    
    unbound = _createunbound(kls)
    def valueget():
        return obj
    for t in (BoundBitfieldNode, BoundStructureNode, BoundArrayNode):
        if isinstance(unbound, t._unboundtype):
            kls = t
            break
    else:
        kls = BoundSimpleNode
    
    child = kls(unbound, valueget)
    return child
334032
public void swapInnerClassesForParents ()
    {
        ImportSet declarers = new ImportSet();
        Iterator<String> i = _imports.iterator();
        while (i.hasNext()) {
            String name = i.next();
            int dollar = name.indexOf('$');
            if (dollar >= 0) {
                i.remove();
                declarers.add(name.substring(0, dollar));
            }
        }

        addAll(declarers);
    }
165969
private void addArcInitialization(EnumDeclaration node) {
    String enumClassName = nameTable.getFullName(node.getTypeElement());
    List<Statement> stmts = node.getClassInitStatements().subList(0, 0);
    int i = 0;
    for (EnumConstantDeclaration constant : node.getEnumConstants()) {
      VariableElement varElement = constant.getVariableElement();
      ClassInstanceCreation creation = new ClassInstanceCreation(constant.getExecutablePair());
      TreeUtil.copyList(constant.getArguments(), creation.getArguments());
      Expression constName = options.stripEnumConstants()
          ? new StringLiteral("JAVA_LANG_ENUM_NAME_STRIPPED", typeUtil)
          : new NativeExpression(
            UnicodeUtils.format("JreEnumConstantName(%s_class_(), %d)", enumClassName, i),
            typeUtil.getJavaString().asType());
      creation.addArgument(constName);
      creation.addArgument(new NumberLiteral(i++, typeUtil));
      creation.setHasRetainedResult(true);
      stmts.add(new ExpressionStatement(new Assignment(new SimpleName(varElement), creation)));
    }
  }
442228
def add_from_string(self, strdata):
        """"""
        if self.tree is None:
            self.tree = tree = ET.ElementTree(ET.fromstring(strdata))
            self.root = tree.getroot()
            self.objects = {}
        else:
            # TODO: append to current tree
            pass
377188
@SuppressWarnings("unchecked")
    private void addPrivateFieldsAccessors(ClassNode node) {
        Set<ASTNode> accessedFields = (Set<ASTNode>) node.getNodeMetaData(StaticTypesMarker.PV_FIELDS_ACCESS);
        if (accessedFields==null) return;
        Map<String, MethodNode> privateConstantAccessors = (Map<String, MethodNode>) node.getNodeMetaData(PRIVATE_FIELDS_ACCESSORS);
        if (privateConstantAccessors!=null) {
            // already added
            return;
        }
        int acc = -1;
        privateConstantAccessors = new HashMap<String, MethodNode>();
        final int access = Opcodes.ACC_STATIC | Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC;
        for (FieldNode fieldNode : node.getFields()) {
            if (accessedFields.contains(fieldNode)) {

                acc++;
                Parameter param = new Parameter(node.getPlainNodeReference(), "$that");
                Expression receiver = fieldNode.isStatic()?new ClassExpression(node):new VariableExpression(param);
                Statement stmt = new ExpressionStatement(new PropertyExpression(
                        receiver,
                        fieldNode.getName()
                ));
                MethodNode accessor = node.addMethod("pfaccess$"+acc, access, fieldNode.getOriginType(), new Parameter[]{param}, ClassNode.EMPTY_ARRAY, stmt);
                privateConstantAccessors.put(fieldNode.getName(), accessor);
            }
        }
        node.setNodeMetaData(PRIVATE_FIELDS_ACCESSORS, privateConstantAccessors);
    }
1031342
def create(cls, expr, binds):
        
        return cls(expr=expr, binds=binds, dtype=bool_dtype)
328514
protected void makeMethodDoc(MethodSymbol meth, TreePath treePath) {
        MethodDocImpl result = (MethodDocImpl)methodMap.get(meth);
        if (result != null) {
            if (treePath != null) result.setTreePath(treePath);
        } else {
            result = new MethodDocImpl(this, meth, treePath);
            methodMap.put(meth, result);
        }
    }