Package com.google.dart.engine.context

Examples of com.google.dart.engine.context.AnalysisResult


    long getEnd = System.currentTimeMillis();
    if (task == null && validateCacheConsistency()) {
      task = getNextAnalysisTask();
    }
    if (task == null) {
      return new AnalysisResult(getChangeNotices(true), getEnd - getStart, null, -1L);
    }
    String taskDescription = task.toString();
    if (!reportedLoop && !recentTasks.add(taskDescription)) {
      @SuppressWarnings("resource")
      PrintStringWriter writer = new PrintStringWriter();
      writer.print("Performing repeated task: ");
      writer.println(taskDescription);
      for (String description : recentTasks) {
        writer.print("  ");
        writer.println(description);
      }
      logInformation(writer.toString());
    }
    notifyAboutToPerformTask(taskDescription);
    if (TRACE_PERFORM_TASK) {
      System.out.println(taskDescription);
    }
    long performStart = System.currentTimeMillis();
    try {
      task.perform(resultRecorder);
    } catch (ObsoleteSourceAnalysisException exception) {
      AnalysisEngine.getInstance().getLogger().logInformation(
          "Could not perform analysis task: " + taskDescription,
          exception);
    } catch (AnalysisException exception) {
      if (!(exception.getCause() instanceof IOException)) {
        AnalysisEngine.getInstance().getLogger().logError(
            "Internal error while performing the task: " + task,
            exception);
      }
    }
    long performEnd = System.currentTimeMillis();
    ChangeNotice[] notices = getChangeNotices(false);
    int noticeCount = notices.length;
    for (int i = 0; i < noticeCount; i++) {
      ChangeNotice notice = notices[i];
      Source source = notice.getSource();
      // TODO(brianwilkerson) Figure out whether the compilation unit is always resolved, or whether
      // we need to decide whether to invoke the "parsed" or "resolved" method. This might be better
      // done when recording task results in order to reduce the chance of errors.
//      if (notice.getCompilationUnit() != null) {
//        notifyResolvedDart(source, notice.getCompilationUnit());
//      } else if (notice.getHtmlUnit() != null) {
//        notifyResolvedHtml(source, notice.getHtmlUnit());
//      }
      notifyErrors(source, notice.getErrors(), notice.getLineInfo());
    }
    return new AnalysisResult(notices, getEnd - getStart, task.getClass().getName(), performEnd
        - performStart);
  }
View Full Code Here


  public AnalysisResult performAnalysisTask() {
    InstrumentationBuilder instrumentation = Instrumentation.builder("Analysis-performAnalysisTask");
    checkThread(instrumentation);
    try {
      instrumentation.metric("contextId", contextId);
      AnalysisResult result = basis.performAnalysisTask();
      if (result.getChangeNotices() != null) {
        instrumentation.metric("ChangeNotice-count", result.getChangeNotices().length);
      }
      return result;
    } finally {
      instrumentation.log(15); //Log if >= 15ms
    }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.context.AnalysisResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.