Trial trial = experiment.getTrials()[currentTrial];
Trial[] trials = experiment.getTrials(); Trial trial = null; if (currentTrial < trials.length) { trial = trials[currentTrial]; } else { if (log.isWarnEnabled()) log.warn("unsetTrialValues, bug 2071/2. currentTrial=" + currentTrial + ", trials.length= " + trials.length); trial = trials[0]; currentTrial--; }
  private void unsetTrialValues() {    if (experiment == null || !usingExperiment)      return;    if (currentTrial < 0)      return;    Trial trial = experiment.getTrials()[currentTrial];    Property[] properties = trial.getParameters();    for (int i = 0; i < properties.length; i++)       properties[i].setValue(null);  }