Scan a method for self call sites.

@param node
the CallGraphNode for the method to be scanned
350214
private void scan(CallGraphNode node) throws CFGBuilderException {
        Method method = node.getMethod();
        CFG cfg = classContext.getCFG(method);

        if (method.isSynchronized()) {
            hasSynchronization = true;
        }

        Iterator<BasicBlock> i = cfg.blockIterator();
        while (i.hasNext()) {
            BasicBlock block = i.next();
            Iterator<InstructionHandle> j = block.instructionIterator();
            while (j.hasNext()) {
                InstructionHandle handle = j.next();

                Instruction ins = handle.getInstruction();
                if (ins instanceof InvokeInstruction) {
                    InvokeInstruction inv = (InvokeInstruction) ins;
                    Method called = isSelfCall(inv);
                    if (called != null) {
                        // Add edge to call graph
                        CallSite callSite = new CallSite(method, block, handle);
                        callGraph.createEdge(node, callGraph.getNodeForMethod(called), callSite);

                        // Add to called method set
                        calledMethodSet.add(called);
                    }
                } else if (ins instanceof MONITORENTER || ins instanceof MONITOREXIT) {
                    hasSynchronization = true;
                }
            }
        }
    }
338410
public void setNodes(java.util.Collection<Node> nodes) {
        if (nodes == null) {
            this.nodes = null;
            return;
        }

        this.nodes = new java.util.ArrayList<Node>(nodes);
    }
423846
private void doSelectNode(final Message<JsonObject> message) {
    final Object key = message.body().getValue("key");
    if (key == null) {
      message.reply(new JsonObject().putString("status", "error").putString("message", "No key specified."));
    } else {
      context.execute(new Action<String>() {
        @Override
        public String perform() {
          String address = nodeSelectors.get(key);
          if (address != null) {
            return address;
          }
          Collection<String> nodes = groups.get(group);
          int index = new Random().nextInt(nodes.size());
          int i = 0;
          for (String node : nodes) {
            if (i == index) {
              nodeSelectors.put(key, node);
              return node;
            }
            i++;
          }
          return null;
        }
      }, new Handler<AsyncResult<String>>() {
        @Override
        public void handle(AsyncResult<String> result) {
          if (result.failed()) {
            message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage()));
          } else if (result.result() == null) {
            message.reply(new JsonObject().putString("status", "error").putString("message", "No nodes to select."));
          } else {
            message.reply(new JsonObject().putString("status", "ok").putString("result", result.result()));
          }
        }
      });
    }
  }
862780
private Implementation.SpecialMethodInvocation invokeSuper(MethodGraph.Node node) {
        return node.getSort().isResolved()
                ? Implementation.SpecialMethodInvocation.Simple.of(node.getRepresentative(), instrumentedType.getSuperClass().asErasure())
                : Implementation.SpecialMethodInvocation.Illegal.INSTANCE;
    }
981534
@Override
    public void addBatch(com.impetus.kundera.graph.Node node)
    {
        if (node != null)
        {
            nodes.add(node);
        }
        if (batchSize > 0 && batchSize == nodes.size())
        {
            executeBatch();
            nodes.clear();
        }
    }
233712
static <K extends Comparable<K>> void checkNode(Node<K> node) {
        node.checkNode(null, null);
    }
190870
function isMethodCall(node) {
                    var nodeParentType = node.parent.type,
                        nodeParentParentParentType = node.parent.parent.parent.type;

                    if (nodeParentType === "CallExpression" && nodeParentParentParentType === "BlockStatement" && !variable) {
                        return true;
                    } else {
                        return false;
                    }
                }
602754
public synchronized void remapNode(@NonNull Node node) {
        version++;

        if (buildMode == MeshBuildMode.MESH) {
            node.getUpstreamNode().removeFromDownstreams(node);

            boolean m = false;
            for (val n : sortedNodes) {
                // we dont want to remap node to itself
                if (!Objects.equals(n, node) && n.status().equals(NodeStatus.ONLINE)) {
                    n.addDownstreamNode(node);
                    m = true;
                    break;
                }
            }

            // if we were unable to find good enough node - we'll map this node to the rootNode
            if (!m) {
                rootNode.addDownstreamNode(node);
            }

            // i hope we won't deadlock here? :)
            synchronized (this) {
                Collections.sort(sortedNodes);
            }
        } else if (buildMode == MeshBuildMode.PLAIN) {
            // nothing to do here
        }
    }
1306113
function(node) {
      if (!node.parent) {
        return false;
      }
      return new RegExp('^(' + pragma + '\\.)?' + createClass + '$').test(sourceCode.getText(node.parent.callee));
    }
456359
protected function check(MethodNode $method, AbstractNode $node)
    {
        $params = $method->getParameters();
        foreach ($params as $param) {
            $this->checkParameter($param, $node);
        }
    }
1287215
function isCallToMethod(node, version, method) {
    return methodDataUtil.isAliasOfMethod(version, method, astUtil.getMethodName(node))
}
596960
@Deprecated
    public static void addReturnIfNeeded(MethodNode node) {
        ReturnAdder adder = new ReturnAdder();
        adder.visitMethod(node);
    }
586860
public boolean visit(MethodInvocation node)
    {
        if (!StringUtils.contains(node.toString(), "."))
        {
            // it must be a local method. ignore.
            return true;
        }
        List<String> qualifiedInstances = new ArrayList<>();
        List<String> argumentsQualified = new ArrayList<>();
        // get qualified arguments of the method
        IMethodBinding resolveTypeBinding = node.resolveMethodBinding();
        final ResolutionStatus resolutionStatus;
        int columnNumber = compilationUnit.getColumnNumber(node.getName().getStartPosition());
        int length = node.getName().getLength();
        if (resolveTypeBinding != null)
        {
            resolutionStatus = ResolutionStatus.RESOLVED;
            ITypeBinding[] argumentTypeBindings = resolveTypeBinding.getParameterTypes();
            List<Expression> arguments = node.arguments();
            int index = 0;
            for (ITypeBinding type : argumentTypeBindings)
            {
                argumentsQualified.add(type.getQualifiedName());

                if (type.isEnum())
                {
                    // there is different number of passed arguments and possible arguments from declaration
                    if (arguments.size() > index)
                    {
                        Expression expression = arguments.get(index);
                        processTypeAsEnum(type, expression, resolutionStatus,
                                compilationUnit.getLineNumber(node.getName().getStartPosition()),
                                columnNumber,
                                length, extractDefinitionLine(node.toString()));
                    }
                    index++;
                }
            }

            // find the interface declaring the method
            if (resolveTypeBinding != null && resolveTypeBinding.getDeclaringClass() != null)
            {
                ITypeBinding declaringClass = resolveTypeBinding.getDeclaringClass();
                qualifiedInstances.add(declaringClass.getQualifiedName());
                ITypeBinding[] interfaces = declaringClass.getInterfaces();
                // Now find all the implemented interfaces having the method called.
                for (ITypeBinding possibleInterface : interfaces)
                {
                    IMethodBinding[] declaredMethods = possibleInterface.getDeclaredMethods();
                    if (declaredMethods.length != 0)
                    {
                        for (IMethodBinding interfaceMethod : declaredMethods)
                        {
                            if (interfaceMethod.getName().equals(node.getName().toString()))
                            {
                                List<String> interfaceMethodArguments = new ArrayList<>();
                                for (ITypeBinding type : interfaceMethod.getParameterTypes())
                                {
                                    interfaceMethodArguments.add(type.getQualifiedName());
                                }
                                if (interfaceMethodArguments.equals(argumentsQualified))
                                {
                                    qualifiedInstances.add(possibleInterface.getQualifiedName());
                                }
                            }
                        }
                    }
                }
            }

        }
        else
        {
            resolutionStatus = ResolutionStatus.RECOVERED;
            String nodeName = StringUtils.removeStart(node.toString(), "this.");
            String objRef = StringUtils.substringBefore(nodeName, "." + node.getName().toString());
            if (state.getNameInstance().containsKey(objRef))
            {
                objRef = state.getNameInstance().get(objRef);
            }
            objRef = resolveClassname(objRef).result;

            @SuppressWarnings("unchecked")
            List<Expression> arguments = node.arguments();
            for (Expression expression : arguments)
            {
                ITypeBinding argumentBinding = expression.resolveTypeBinding();
                if (argumentBinding != null)
                {
                    argumentsQualified.add(argumentBinding.getQualifiedName());

                    if (argumentBinding.isEnum())
                    {
                        // FIXME -- Test
                        String constantEnum = expression.toString();
                        if (constantEnum != null)
                        {
                            processTypeAsEnum(argumentBinding, expression, ResolutionStatus.RESOLVED, compilationUnit.getLineNumber(node.getName().getStartPosition()),
                                    columnNumber, length, extractDefinitionLine(node.toString()));
                        }
                    }
                }
                else
                {
                    PackageAndClassName argumentQualifiedGuess = PackageAndClassName.parseFromQualifiedName(expression.toString());
                    argumentsQualified.add(argumentQualifiedGuess.toString());
                }
            }
            qualifiedInstances.add(objRef);
        }

        for (String qualifiedInstance : qualifiedInstances)
        {
            PackageAndClassName packageAndClassName = PackageAndClassName.parseFromQualifiedName(qualifiedInstance);
            MethodType methodCall = new MethodType(qualifiedInstance, packageAndClassName.packageName, packageAndClassName.className,
                        node.getName().toString(), argumentsQualified);
            processMethod(methodCall, resolutionStatus, TypeReferenceLocation.METHOD_CALL,
                        compilationUnit.getLineNumber(node.getName().getStartPosition()),
                        columnNumber, length, node.toString());
        }

        return super.visit(node);
    }
1298540
private void writeNode(Node node) {
        try {
            this.pStmtNodesC.setLong(1, node.getId());
            this.pStmtNodesC.setDouble(2, node.getLatitude());
            this.pStmtNodesC.setDouble(3, node.getLongitude());

            this.pStmtNodesC.addBatch();

            if (this.nNodes % BATCH_LIMIT == 0) {
                this.pStmtNodesC.executeBatch();

                this.pStmtNodesC.clearBatch();
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
734260
@Override
    public void addBatch(Node node)
    {
        if (node != null)
        {
            nodes.add(node);
        }

        onBatchLimit();

    }
512679
private void addSeeds(SiteNode node) {
		// Add the current node
		addSeed(node);

		// If the "scanChildren" option is enabled, add them
		if (scanChildren) {
			@SuppressWarnings("unchecked")
			Enumeration<TreeNode> en = node.children();
			while (en.hasMoreElements()) {
				SiteNode sn = (SiteNode) en.nextElement();
				addSeeds(sn);
			}
		}
	}
1082342
public void buildDeprecationInfo(XMLNode node, Content methodDocTree) {
        writer.addDeprecated(
                (MethodDoc) methods.get(currentMethodIndex), methodDocTree);
    }