Program: 131750
Project: 131750
Buggy source:
public static Object getTrainer(CommandLine cmd) throws ParseException {
  final String algorithm=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final int iterations=Command.getOptionValue(cmd,"String_Node_Str",10);
  final double convergenceRatio=Command.getOptionValue(cmd,"String_Node_Str",0.99999);
  final String modelName=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final String parserName=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final String deltaGenerator=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final double interval=Command.getOptionValue(cmd,"String_Node_Str",0.01);
  final double factor=Command.getOptionValue(cmd,"String_Node_Str",1.1);
  final int numPerSide=Command.getOptionValue(cmd,"String_Node_Str",2);
  final IlpFormulation formulation=getOptionValue(cmd,"String_Node_Str",IlpFormulation.DP_PROJ);
  final double lambda=Command.getOptionValue(cmd,"String_Node_Str",0.1);
  final int numThreads=Command.getOptionValue(cmd,"String_Node_Str",2);
  final String ilpSolver=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final double ilpWorkMemMegs=Command.getOptionValue(cmd,"String_Node_Str",512.0);
  final double epsilon=Command.getOptionValue(cmd,"String_Node_Str",0.1);
  final String branch=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final String relaxation=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final int maxSimplexIterations=Command.getOptionValue(cmd,"String_Node_Str",2100000000);
  final int maxDwIterations=Command.getOptionValue(cmd,"String_Node_Str",1000);
  final int maxSetSizeToConstrain=Command.getOptionValue(cmd,"String_Node_Str",2);
  final int maxCutRounds=Command.getOptionValue(cmd,"String_Node_Str",100);
  final double minSumForCuts=Command.getOptionValue(cmd,"String_Node_Str",1.01);
  final String dwTempDir=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  DmvRelaxation relax=null;
  if (cmd.hasOption("String_Node_Str") || algorithm.equals("String_Node_Str")) {
    File dwTemp=dwTempDir.equals("String_Node_Str") ? null : new File(dwTempDir);
    if (relaxation.equals("String_Node_Str")) {
      DmvDantzigWolfeRelaxation dw=new DmvDantzigWolfeRelaxation(dwTemp,maxCutRounds,new CutCountComputer());
      dw.setMaxSimplexIterations(maxSimplexIterations);
      dw.setMaxDwIterations(maxDwIterations);
      dw.setMaxSetSizeToConstrain(maxSetSizeToConstrain);
      dw.setMinSumForCuts(minSumForCuts);
      relax=dw;
    }
 else     if (relaxation.equals("String_Node_Str")) {
      DmvDantzigWolfeRelaxationResolution dw=new DmvDantzigWolfeRelaxationResolution(dwTemp);
      dw.setMaxSimplexIterations(maxSimplexIterations);
      dw.setMaxDwIterations(maxDwIterations);
      relax=dw;
    }
 else     if (relaxation.equals("String_Node_Str")) {
      throw new RuntimeException("String_Node_Str");
    }
 else {
      throw new ParseException("String_Node_Str" + relaxation);
    }
    if (cmd.hasOption("String_Node_Str")) {
      return relax;
    }
  }
  Trainer trainer=null;
  if (algorithm.equals("String_Node_Str")) {
    ViterbiParser parser;
    if (modelName.equals("String_Node_Str")) {
      evalParser=new DmvCkyParser();
      IlpSolverFactory ilpSolverFactory=null;
      if (parserName.startsWith("String_Node_Str")) {
        IlpSolverId ilpSolverId=IlpSolverId.getById(ilpSolver);
        ilpSolverFactory=new IlpSolverFactory(ilpSolverId,numThreads,ilpWorkMemMegs);
        ilpSolverFactory.setBlockFileWriter(new DeltaParseBlockFileWriter(formulation));
      }
      if (parserName.equals("String_Node_Str")) {
        parser=new DmvCkyParser();
      }
 else       if (parserName.equals("String_Node_Str")) {
        parser=new IlpViterbiSentenceParser(formulation,ilpSolverFactory);
      }
 else       if (parserName.equals("String_Node_Str")) {
        parser=new IlpViterbiParser(formulation,ilpSolverFactory);
      }
 else       if (parserName.equals("String_Node_Str") || parserName.equals("String_Node_Str")) {
        DeltaGenerator deltaGen;
        if (deltaGenerator.equals("String_Node_Str")) {
          deltaGen=new FixedIntervalDeltaGenerator(interval,numPerSide);
        }
 else         if (deltaGenerator.equals("String_Node_Str")) {
          deltaGen=new FactorDeltaGenerator(factor,numPerSide);
        }
 else {
          throw new ParseException("String_Node_Str" + deltaGenerator);
        }
        if (parserName.equals("String_Node_Str")) {
          parser=new IlpViterbiParserWithDeltas(formulation,ilpSolverFactory,deltaGen);
        }
 else         if (parserName.equals("String_Node_Str")) {
          parser=new InitializedIlpViterbiParserWithDeltas(formulation,ilpSolverFactory,deltaGen,ilpSolverFactory);
        }
 else {
          throw new ParseException("String_Node_Str" + parserName);
        }
      }
 else {
        throw new ParseException("String_Node_Str" + parserName);
      }
    }
 else {
      throw new ParseException("String_Node_Str" + modelName);
    }
    MStep<DepTreebank> mStep;
    ModelFactory modelFactory;
    if (modelName.equals("String_Node_Str")) {
      mStep=new DmvMStep(lambda);
      modelFactory=new DmvModelFactory(new DmvUniformWeightGenerator());
    }
 else {
      throw new ParseException("String_Node_Str" + modelName);
    }
    trainer=new ViterbiTrainer(parser,mStep,modelFactory,iterations,convergenceRatio);
  }
 else   if (algorithm.equals("String_Node_Str")) {
    if (modelName.equals("String_Node_Str")) {
      DmvBoundsDeltaFactory brancher;
      if (branch.equals("String_Node_Str")) {
        brancher=new FullStrongBranchingDeltaFactory();
      }
 else       if (branch.equals("String_Node_Str")) {
        brancher=new RegretDmvBoundsDeltaFactory();
      }
 else       if (branch.equals("String_Node_Str")) {
        brancher=new RandomDmvBoundsDeltaFactory(true);
      }
 else       if (branch.equals("String_Node_Str")) {
        brancher=new RandomDmvBoundsDeltaFactory(false);
      }
 else {
        throw new ParseException("String_Node_Str" + branch);
      }
      trainer=new BnBDmvTrainer(epsilon,brancher,relax);
    }
 else {
      throw new ParseException("String_Node_Str" + modelName);
    }
  }
 else {
    throw new ParseException("String_Node_Str" + algorithm);
  }
  return trainer;
}

Fixed version (ground truth):
public static Object getTrainer(CommandLine cmd) throws ParseException {
  final String algorithm=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final int iterations=Command.getOptionValue(cmd,"String_Node_Str",10);
  final double convergenceRatio=Command.getOptionValue(cmd,"String_Node_Str",0.99999);
  final String modelName=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final String parserName=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final String deltaGenerator=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final double interval=Command.getOptionValue(cmd,"String_Node_Str",0.01);
  final double factor=Command.getOptionValue(cmd,"String_Node_Str",1.1);
  final int numPerSide=Command.getOptionValue(cmd,"String_Node_Str",2);
  final IlpFormulation formulation=getOptionValue(cmd,"String_Node_Str",IlpFormulation.DP_PROJ);
  final double lambda=Command.getOptionValue(cmd,"String_Node_Str",0.1);
  final int numThreads=Command.getOptionValue(cmd,"String_Node_Str",2);
  final String ilpSolver=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final double ilpWorkMemMegs=Command.getOptionValue(cmd,"String_Node_Str",512.0);
  final double epsilon=Command.getOptionValue(cmd,"String_Node_Str",0.1);
  final String branch=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final String relaxation=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  final int maxSimplexIterations=Command.getOptionValue(cmd,"String_Node_Str",2100000000);
  final int maxDwIterations=Command.getOptionValue(cmd,"String_Node_Str",1000);
  final int maxSetSizeToConstrain=Command.getOptionValue(cmd,"String_Node_Str",2);
  final int maxCutRounds=Command.getOptionValue(cmd,"String_Node_Str",100);
  final double minSumForCuts=Command.getOptionValue(cmd,"String_Node_Str",1.01);
  final String dwTempDir=Command.getOptionValue(cmd,"String_Node_Str","String_Node_Str");
  DmvRelaxation relax=null;
  if (cmd.hasOption("String_Node_Str") || algorithm.equals("String_Node_Str")) {
    File dwTemp=dwTempDir.equals("String_Node_Str") ? null : new File(dwTempDir);
    if (relaxation.equals("String_Node_Str")) {
      DmvDantzigWolfeRelaxation dw=new DmvDantzigWolfeRelaxation(dwTemp,maxCutRounds,new CutCountComputer());
      dw.setMaxSimplexIterations(maxSimplexIterations);
      dw.setMaxDwIterations(maxDwIterations);
      dw.setMaxSetSizeToConstrain(maxSetSizeToConstrain);
      dw.setMinSumForCuts(minSumForCuts);
      relax=dw;
    }
 else     if (relaxation.equals("String_Node_Str")) {
      DmvDantzigWolfeRelaxationResolution dw=new DmvDantzigWolfeRelaxationResolution(dwTemp);
      dw.setMaxSimplexIterations(maxSimplexIterations);
      dw.setMaxDwIterations(maxDwIterations);
      relax=dw;
    }
 else     if (relaxation.equals("String_Node_Str")) {
      throw new RuntimeException("String_Node_Str");
    }
 else {
      throw new ParseException("String_Node_Str" + relaxation);
    }
    if (cmd.hasOption("String_Node_Str")) {
      return relax;
    }
  }
  if (modelName.equals("String_Node_Str")) {
    evalParser=new DmvCkyParser();
  }
  Trainer trainer=null;
  if (algorithm.equals("String_Node_Str")) {
    ViterbiParser parser;
    if (modelName.equals("String_Node_Str")) {
      IlpSolverFactory ilpSolverFactory=null;
      if (parserName.startsWith("String_Node_Str")) {
        IlpSolverId ilpSolverId=IlpSolverId.getById(ilpSolver);
        ilpSolverFactory=new IlpSolverFactory(ilpSolverId,numThreads,ilpWorkMemMegs);
        ilpSolverFactory.setBlockFileWriter(new DeltaParseBlockFileWriter(formulation));
      }
      if (parserName.equals("String_Node_Str")) {
        parser=new DmvCkyParser();
      }
 else       if (parserName.equals("String_Node_Str")) {
        parser=new IlpViterbiSentenceParser(formulation,ilpSolverFactory);
      }
 else       if (parserName.equals("String_Node_Str")) {
        parser=new IlpViterbiParser(formulation,ilpSolverFactory);
      }
 else       if (parserName.equals("String_Node_Str") || parserName.equals("String_Node_Str")) {
        DeltaGenerator deltaGen;
        if (deltaGenerator.equals("String_Node_Str")) {
          deltaGen=new FixedIntervalDeltaGenerator(interval,numPerSide);
        }
 else         if (deltaGenerator.equals("String_Node_Str")) {
          deltaGen=new FactorDeltaGenerator(factor,numPerSide);
        }
 else {
          throw new ParseException("String_Node_Str" + deltaGenerator);
        }
        if (parserName.equals("String_Node_Str")) {
          parser=new IlpViterbiParserWithDeltas(formulation,ilpSolverFactory,deltaGen);
        }
 else         if (parserName.equals("String_Node_Str")) {
          parser=new InitializedIlpViterbiParserWithDeltas(formulation,ilpSolverFactory,deltaGen,ilpSolverFactory);
        }
 else {
          throw new ParseException("String_Node_Str" + parserName);
        }
      }
 else {
        throw new ParseException("String_Node_Str" + parserName);
      }
    }
 else {
      throw new ParseException("String_Node_Str" + modelName);
    }
    MStep<DepTreebank> mStep;
    ModelFactory modelFactory;
    if (modelName.equals("String_Node_Str")) {
      mStep=new DmvMStep(lambda);
      modelFactory=new DmvModelFactory(new DmvUniformWeightGenerator());
    }
 else {
      throw new ParseException("String_Node_Str" + modelName);
    }
    trainer=new ViterbiTrainer(parser,mStep,modelFactory,iterations,convergenceRatio);
  }
 else   if (algorithm.equals("String_Node_Str")) {
    if (modelName.equals("String_Node_Str")) {
      DmvBoundsDeltaFactory brancher;
      if (branch.equals("String_Node_Str")) {
        brancher=new FullStrongBranchingDeltaFactory();
      }
 else       if (branch.equals("String_Node_Str")) {
        brancher=new RegretDmvBoundsDeltaFactory();
      }
 else       if (branch.equals("String_Node_Str")) {
        brancher=new RandomDmvBoundsDeltaFactory(true);
      }
 else       if (branch.equals("String_Node_Str")) {
        brancher=new RandomDmvBoundsDeltaFactory(false);
      }
 else {
        throw new ParseException("String_Node_Str" + branch);
      }
      trainer=new BnBDmvTrainer(epsilon,brancher,relax);
    }
 else {
      throw new ParseException("String_Node_Str" + modelName);
    }
  }
 else {
    throw new ParseException("String_Node_Str" + algorithm);
  }
  return trainer;
}