Esempio n. 1
0
  public boolean visit(CallExpression call) throws Exception {
    FieldDeclaration constantDecl = ASTUtils.getConstantDeclaration(call);
    if (constantDecl != null) {
      // In case we are entering a nested element
      if (!declarations.empty() && declarations.peek() instanceof MethodDeclaration) {
        deferredDeclarations.add(constantDecl);
        return visitGeneral(call);
      }

      visit((FieldDeclaration) constantDecl);

    } else {
      int argsCount = 0;
      CallArgumentsList args = call.getArgs();
      if (args != null && args.getChilds() != null) {
        argsCount = args.getChilds().size();
      }

      modifyReference(
          call,
          new ReferenceInfo(
              IModelElement.METHOD,
              call.sourceStart(),
              call.sourceEnd() - call.sourceStart(),
              call.getName(),
              Integer.toString(argsCount),
              null));
    }

    return visitGeneral(call);
  }
  public boolean visit(CallExpression call) throws Exception {
    final FieldDeclaration constantDecl = ASTUtils.getConstantDeclaration(call);
    if (constantDecl != null) {
      // In case we are entering a nested element
      if (!declarations.empty() && declarations.peek() instanceof MethodDeclaration) {
        deferredDeclarations.add(constantDecl);
        return false;
      }

      visit(constantDecl);

    } else {
      int argsCount = 0;
      final CallArgumentsList args = call.getArgs();
      if (args != null && args.getChilds() != null) {
        argsCount = args.getChilds().size();
      }
      fRequestor.acceptMethodReference(
          call.getName(),
          argsCount,
          call.getCallName().sourceStart(),
          call.getCallName().sourceEnd());
    }
    return true;
  }