Esempio n. 1
0
  /**
   * called from within a job
   *
   * @param monitor
   */
  public void evaluateChecks(
      Collection<ITypingCheck> checks, IProject project, IProgressMonitor monitor) {
    SubProgressMonitor monitor2 = new SubProgressMonitor(monitor, 1);
    monitor2.beginTask("Evaluating type checks...", checks.size() + 10);

    // called from within a job!
    IEvaluationStrategy strategy = null;

    try {
      strategy = EvaluationStrategyManager.getInstance().getEvaluationStrategy(project);
      // cannot check anything without a strategy
      if (strategy == null) return;
    } catch (FeatureModelNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    monitor2.worked(10);

    int i = 0;
    for (ITypingCheck check : checks) {
      i++;
      if (i % 25 == 0) {
        monitor2.subTask("Evaluating type check " + i + "/" + checks.size());
        monitor2.worked(25);
      }

      boolean isWelltyped = check.evaluate(strategy);

      if (!isWelltyped) markIlltyped(check);
      else markWelltyped(check);
    }

    monitor2.done();
  }
Esempio n. 2
0
  protected void clearEvaluationStrategyCache(IProject project) {
    IEvaluationStrategy strategy;

    FeatureModel featureModel = FeatureModelManager.getInstance().getFeatureModel();
    try {
      strategy = EvaluationStrategyManager.getInstance().getEvaluationStrategy(project);
      strategy.clearCache(featureModel);
    } catch (FeatureModelNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }