Program: 17685
Project: 17685
Buggy source:
public void performTrain(){
  TrainDialog dialog=new TrainDialog(EncogWorkBench.getInstance().getMainWindow());
  if (mlMethod != null)   dialog.setMethod(mlMethod);
  if (dialog.process()) {
    MLMethod method=dialog.getNetwork();
    MLDataSet trainingData=dialog.getTrainingSet();
    if (method == null) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    if (method instanceof ART1) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    if (trainingData == null) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    if (method instanceof HopfieldNetwork) {
      HopfieldNetwork hp=(HopfieldNetwork)method;
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      for (      MLDataPair pair : trainingData) {
        hp.addPattern(pair.getInput());
      }
      if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
        file.save();
      }
    }
 else     if (method instanceof SOM) {
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performSOM(file,trainingData);
    }
 else     if (method instanceof SVM) {
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performSVM(file,trainingData);
    }
 else     if (method instanceof CPN) {
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performCPN(file,trainingData);
    }
 else     if (method instanceof BasicNetwork || method instanceof RBFNetwork) {
      ChooseBasicNetworkTrainingMethod choose=new ChooseBasicNetworkTrainingMethod(EncogWorkBench.getInstance().getMainWindow(),method);
      if (choose.process()) {
        ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
switch (choose.getType()) {
case SCG:
          performSCG(file,trainingData);
        break;
case PropagationResilient:
      performRPROP(file,trainingData);
    break;
case PropagationBack:
  performBPROP(file,trainingData);
break;
case PropagationManhattan:
performManhattan(file,trainingData);
break;
case LevenbergMarquardt:
performLMA(file,trainingData);
break;
case Genetic:
performGenetic(file,trainingData);
break;
case Annealing:
performAnnealing(file,trainingData);
break;
case ADALINE:
performADALINE(file,trainingData);
break;
case PropagationQuick:
performQPROP(file,trainingData);
break;
case SVD:
performSVD(file,trainingData);
break;
}
}
}
 else {
EncogWorkBench.displayError("String_Node_Str","String_Node_Str" + method.getClass().getName());
}
}
}

Fixed version (ground truth):
public void performTrain(){
  TrainDialog dialog=new TrainDialog(EncogWorkBench.getInstance().getMainWindow());
  if (mlMethod != null)   dialog.setMethod(mlMethod);
  if (dialog.process()) {
    MLMethod method=dialog.getNetwork();
    MLDataSet trainingData=dialog.getTrainingSet();
    if (method == null) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    if (method instanceof ART1) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    if (trainingData == null) {
      EncogWorkBench.displayError("String_Node_Str","String_Node_Str");
      return;
    }
    if (method instanceof HopfieldNetwork) {
      HopfieldNetwork hp=(HopfieldNetwork)method;
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      for (      MLDataPair pair : trainingData) {
        hp.addPattern(pair.getInput());
      }
      if (EncogWorkBench.askQuestion("String_Node_Str","String_Node_Str")) {
        file.save();
      }
    }
 else     if (method instanceof SOM) {
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performSOM(file,trainingData);
    }
 else     if (method instanceof SVM) {
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performSVM(file,trainingData);
    }
 else     if (method instanceof CPN) {
      ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
      performCPN(file,trainingData);
    }
 else     if (method instanceof BasicNetwork || method instanceof RBFNetwork) {
      ChooseBasicNetworkTrainingMethod choose=new ChooseBasicNetworkTrainingMethod(EncogWorkBench.getInstance().getMainWindow(),method);
      if (choose.process()) {
        ProjectEGFile file=(ProjectEGFile)dialog.getComboNetwork().getSelectedValue();
switch (choose.getTheType()) {
case SCG:
          performSCG(file,trainingData);
        break;
case PropagationResilient:
      performRPROP(file,trainingData);
    break;
case PropagationBack:
  performBPROP(file,trainingData);
break;
case PropagationManhattan:
performManhattan(file,trainingData);
break;
case LevenbergMarquardt:
performLMA(file,trainingData);
break;
case Genetic:
performGenetic(file,trainingData);
break;
case Annealing:
performAnnealing(file,trainingData);
break;
case ADALINE:
performADALINE(file,trainingData);
break;
case PropagationQuick:
performQPROP(file,trainingData);
break;
case SVD:
performSVD(file,trainingData);
break;
}
}
}
 else {
EncogWorkBench.displayError("String_Node_Str","String_Node_Str" + method.getClass().getName());
}
}
}