Beispiel #1
0
  /**
   * Recompiles the module.
   *
   * <p>Prerequisite: either {@link #precompile} or {@link #initWithoutPrecompile} should have been
   * called first.
   *
   * <p>Sets the job's result and returns normally whether the compile succeeds or not.
   *
   * @param job should already be in the "in progress" state.
   */
  synchronized Job.Result recompile(Job job) {

    Job.Result result;
    try {
      result = compile(job);
    } catch (UnableToCompleteException e) {
      // No point in logging a stack trace for this exception
      job.getLogger().log(TreeLogger.Type.WARN, "recompile failed");
      result = new Result(null, null, e);
    } catch (Throwable error) {
      job.getLogger().log(TreeLogger.Type.WARN, "recompile failed", error);
      result = new Result(null, null, error);
    }

    job.onFinished(result);
    return result;
  }
Beispiel #2
0
 /**
  * Compiles the first time, while Super Dev Mode is starting up. Either this method or {@link
  * #initWithoutPrecompile} should be called first.
  */
 synchronized Job.Result precompile(Job job) throws UnableToCompleteException {
   Result result = compile(job);
   job.onFinished(result);
   assert result.isOk();
   return result;
 }