Program: 31755
Project: 31755
Buggy source:
@Override public void init(MasterContext<NNParams,NNParams> context){
  Properties props=context.getProps();
  try {
    SourceType sourceType=SourceType.valueOf(props.getProperty(CommonConstants.MODELSET_SOURCE_TYPE,SourceType.HDFS.toString()));
    this.modelConfig=CommonUtils.loadModelConfig(props.getProperty(CommonConstants.SHIFU_MODEL_CONFIG),sourceType);
    this.columnConfigList=CommonUtils.loadColumnConfigList(props.getProperty(CommonConstants.SHIFU_COLUMN_CONFIG),sourceType);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  int trainerId=Integer.valueOf(context.getProps().getProperty(CommonConstants.SHIFU_TRAINER_ID,"String_Node_Str"));
  GridSearch gs=new GridSearch(modelConfig.getTrain().getParams());
  validParams=this.modelConfig.getTrain().getParams();
  if (gs.hasHyperParam()) {
    validParams=gs.getParams(trainerId);
    LOG.info("String_Node_Str",validParams);
  }
  Object vtObj=validParams.get("String_Node_Str");
  if (vtObj != null) {
    try {
      validationTolerance=Double.parseDouble(vtObj.toString());
      LOG.warn("String_Node_Str",validationTolerance);
    }
 catch (    NumberFormatException ee) {
      validationTolerance=0d;
      LOG.warn("String_Node_Str",vtObj);
    }
  }
 else {
    LOG.info("String_Node_Str");
  }
  Object pObject=validParams.get(NNTrainer.PROPAGATION);
  this.propagation=pObject == null ? "String_Node_Str" : (String)pObject;
  this.rawLearningRate=Double.valueOf(validParams.get(NNTrainer.LEARNING_RATE).toString());
  Object learningDecayO=validParams.get("String_Node_Str");
  if (learningDecayO != null) {
    this.learningDecay=Double.valueOf(learningDecayO.toString());
  }
  LOG.info("String_Node_Str",learningDecay);
  Double threshold=this.modelConfig.getTrain().getConvergenceThreshold();
  this.convergenceThreshold=threshold == null ? 0d : threshold.doubleValue();
  LOG.info("String_Node_Str",this.convergenceThreshold);
  this.isContinuousEnabled=Boolean.TRUE.toString().equalsIgnoreCase(context.getProps().getProperty(CommonConstants.CONTINUOUS_TRAINING));
  Object rconstant=validParams.get(CommonConstants.LR_REGULARIZED_CONSTANT);
  this.regularizedConstant=NumberFormatUtils.getDouble(rconstant == null ? "String_Node_Str" : rconstant.toString(),0d);
  if (!context.isFirstIteration()) {
    NNParams params=context.getMasterResult();
    if (params != null && params.getWeights() != null) {
      this.globalNNParams.setWeights(params.getWeights());
    }
 else {
      params=initOrRecoverParams(context);
      this.globalNNParams.setWeights(params.getWeights());
    }
  }
}

Fixed version (ground truth):
@Override public void init(MasterContext<NNParams,NNParams> context){
  Properties props=context.getProps();
  try {
    SourceType sourceType=SourceType.valueOf(props.getProperty(CommonConstants.MODELSET_SOURCE_TYPE,SourceType.HDFS.toString()));
    this.modelConfig=CommonUtils.loadModelConfig(props.getProperty(CommonConstants.SHIFU_MODEL_CONFIG),sourceType);
    this.columnConfigList=CommonUtils.loadColumnConfigList(props.getProperty(CommonConstants.SHIFU_COLUMN_CONFIG),sourceType);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  int trainerId=Integer.valueOf(context.getProps().getProperty(CommonConstants.SHIFU_TRAINER_ID,"String_Node_Str"));
  GridSearch gs=new GridSearch(modelConfig.getTrain().getParams());
  validParams=this.modelConfig.getTrain().getParams();
  if (gs.hasHyperParam()) {
    validParams=gs.getParams(trainerId);
    LOG.info("String_Node_Str",validParams);
  }
  Object vtObj=validParams.get("String_Node_Str");
  if (vtObj != null) {
    try {
      validationTolerance=Double.parseDouble(vtObj.toString());
      LOG.warn("String_Node_Str",validationTolerance);
    }
 catch (    NumberFormatException ee) {
      validationTolerance=0d;
      LOG.warn("String_Node_Str",vtObj);
    }
  }
 else {
    LOG.info("String_Node_Str");
  }
  Object pObject=validParams.get(NNTrainer.PROPAGATION);
  this.propagation=pObject == null ? "String_Node_Str" : (String)pObject;
  this.rawLearningRate=Double.valueOf(validParams.get(NNTrainer.LEARNING_RATE).toString());
  Object dropoutRateObj=validParams.get(NNTrainer.DROPOUT_RATE);
  if (dropoutRateObj != null) {
    this.dropoutRate=Double.valueOf(dropoutRateObj.toString());
  }
  LOG.info("String_Node_Str",this.dropoutRate);
  Object learningDecayO=validParams.get("String_Node_Str");
  if (learningDecayO != null) {
    this.learningDecay=Double.valueOf(learningDecayO.toString());
  }
  LOG.info("String_Node_Str",learningDecay);
  Double threshold=this.modelConfig.getTrain().getConvergenceThreshold();
  this.convergenceThreshold=threshold == null ? 0d : threshold.doubleValue();
  LOG.info("String_Node_Str",this.convergenceThreshold);
  this.isContinuousEnabled=Boolean.TRUE.toString().equalsIgnoreCase(context.getProps().getProperty(CommonConstants.CONTINUOUS_TRAINING));
  Object rconstant=validParams.get(CommonConstants.LR_REGULARIZED_CONSTANT);
  this.regularizedConstant=NumberFormatUtils.getDouble(rconstant == null ? "String_Node_Str" : rconstant.toString(),0d);
  if (!context.isFirstIteration()) {
    NNParams params=context.getMasterResult();
    if (params != null && params.getWeights() != null) {
      this.globalNNParams.setWeights(params.getWeights());
    }
 else {
      params=initOrRecoverParams(context);
      this.globalNNParams.setWeights(params.getWeights());
    }
  }
}