Program: 31613
Project: 31613
Buggy source:
@Override public NNParams doCompute(WorkerContext<NNParams,NNParams> context){
  if (this.isDry || context.isFirstIteration()) {
    return buildEmptyNNParams(context);
  }
  if (context.getLastMasterResult() == null) {
    LOG.warn("String_Node_Str");
    return null;
  }
  LOG.debug("String_Node_Str",context.getLastMasterResult());
  double[] weights=context.getLastMasterResult().getWeights();
  if (gradient == null) {
    initGradient(this.trainingData,this.validationData,weights,this.isCrossOver);
    context.addCompletionCallBack(new WorkerCompletionCallBack<NNParams,NNParams>(){
      @Override public void callback(      WorkerContext<NNParams,NNParams> context){
        AbstractNNWorker.this.gradient.shutdown();
      }
    }
);
  }
 else {
    if (this.isCrossOver) {
      this.gradient.setSeed(System.currentTimeMillis());
    }
  }
  this.gradient.getNetwork().setWeights(weights);
  double[] gradients=null;
  for (int i=0; i < epochsPerIteration; i++) {
    gradients=this.gradient.computeGradients();
    if (this.epochsPerIteration > 1) {
      this.gradient.resetNetworkWeights();
    }
  }
  double trainError=this.gradient.getTrainError();
  long start=System.currentTimeMillis();
  double testError=this.validationData.getRecordCount() > 0 ? (this.gradient.calculateError()) : this.gradient.getTrainError();
  LOG.info("String_Node_Str",(System.currentTimeMillis() - start));
  LOG.info("String_Node_Str",new Object[]{context.getCurrentIteration(),trainError,(this.validationData.getRecordCount() > 0 ? testError : "String_Node_Str")});
  NNParams params=new NNParams();
  params.setTestError(testError);
  params.setTrainError(trainError);
  params.setGradients(gradients);
  params.setWeights(new double[0]);
  params.setTrainSize(this.trainingData.getRecordCount());
  params.setCount(count);
  return params;
}

Fixed version (ground truth):
@Override public NNParams doCompute(WorkerContext<NNParams,NNParams> context){
  if (this.isDry || context.isFirstIteration()) {
    return buildEmptyNNParams(context);
  }
  if (context.getLastMasterResult() == null) {
    LOG.warn("String_Node_Str");
    return null;
  }
  LOG.debug("String_Node_Str",context.getLastMasterResult());
  double[] weights=context.getLastMasterResult().getWeights();
  if (gradient == null) {
    initGradient(this.trainingData,this.validationData,weights,this.isCrossOver);
    context.addCompletionCallBack(new WorkerCompletionCallBack<NNParams,NNParams>(){
      @Override public void callback(      WorkerContext<NNParams,NNParams> context){
        AbstractNNWorker.this.gradient.shutdown();
      }
    }
);
  }
 else {
    if (this.isCrossOver) {
      this.gradient.setSeed(System.currentTimeMillis());
    }
  }
  this.gradient.getNetwork().setWeights(weights);
  double[] gradients=null;
  for (int i=0; i < epochsPerIteration; i++) {
    gradients=this.gradient.computeGradients(context.getCurrentIteration());
    if (this.epochsPerIteration > 1) {
      this.gradient.resetNetworkWeights();
    }
  }
  double trainError=this.gradient.getTrainError();
  long start=System.currentTimeMillis();
  double testError=this.validationData.getRecordCount() > 0 ? (this.gradient.calculateError()) : this.gradient.getTrainError();
  LOG.info("String_Node_Str",(System.currentTimeMillis() - start));
  LOG.info("String_Node_Str",new Object[]{context.getCurrentIteration(),trainError,(this.validationData.getRecordCount() > 0 ? testError : "String_Node_Str")});
  NNParams params=new NNParams();
  params.setTestError(testError);
  params.setTrainError(trainError);
  params.setGradients(gradients);
  params.setWeights(new double[0]);
  params.setTrainSize(this.trainingData.getRecordCount());
  params.setCount(count);
  return params;
}