Program: 141894
Project: 141894
Buggy source:
public void visitMROp(MapReduceOper mr) throws VisitorException {
  splan.UDFs.addAll(mr.UDFs);
  updateUDFs(mr.mapPlan);
  new PhyPlanSetter(mr.mapPlan).visit();
  new PhyPlanSetter(mr.reducePlan).visit();
  StormOper mo=getSOp(StormOper.OpType.MAP,getAlias(mr.mapPlan,false));
  mo.mapKeyType=mr.mapKeyType;
  splan.add(mo);
  String mapAlias=mo.name();
  System.out.println("String_Node_Str" + mapAlias + "String_Node_Str");
  if (pc.getProperties().getProperty(mapAlias + "String_Node_Str","String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
    mo.shuffleBefore(true);
  }
  if (pc.getProperties().getProperty(mapAlias + "String_Node_Str",null) != null) {
    mo.setParallelismHint(Integer.parseInt(pc.getProperties().getProperty(mapAlias + "String_Node_Str")));
  }
  for (  PhysicalOperator po : mr.mapPlan.getRoots()) {
    POLoad pl=(POLoad)po;
    if (pl instanceof NOPLoad) {
      continue;
    }
    String fn=pl.getLFile().getFileName();
    if (!rootMap.containsKey(fn) && pl.getLoadFunc() instanceof SpoutWrapper) {
      StormOper spout=getSOp(StormOper.OpType.SPOUT,po.getAlias());
      SpoutWrapper sw=((SpoutWrapper)pl.getLoadFunc());
      spout.setParallelismHint(sw.getParallelismHint());
      spout.setSpout(sw.getSpout());
      spout.setTupleConverter(sw.getTupleConverter());
      splan.add(spout);
      splan.addPLSpoutLink(spout,pl);
      rootMap.put(fn,spout);
    }
    if (rootMap.containsKey(fn)) {
      try {
        splan.connect(rootMap.get(fn),mo);
      }
 catch (      PlanException e) {
        e.printStackTrace();
      }
    }
 else {
      List<StormOper> wait=missingRoots.get(po);
      if (wait == null) {
        wait=new ArrayList<StormOper>();
        missingRoots.put(fn,wait);
      }
      wait.add(mo);
    }
  }
  mo.setPlan(mr.mapPlan);
  if (mr.combinePlan.size() > 0) {
    mo.isCombined=true;
  }
  if (mr.reducePlan.size() == 0) {
    setupStore(mr.mapPlan.getLeaves(),mo);
    return;
  }
  StormOper po;
  String red_alias;
  if (mr.reducePlan.getRoots().get(0) instanceof POPackage) {
    red_alias=getAlias(mr.mapPlan,false);
  }
 else {
    red_alias=(mr.combinePlan.size() > 0) ? getAlias(mr.combinePlan,false) : getAlias(mr.reducePlan,true);
  }
  String window_opts=StormOper.getWindowOpts(pc,red_alias);
  if (mr.combinePlan.size() == 0 || window_opts != null) {
    po=getSOp(StormOper.OpType.BASIC_PERSIST,red_alias);
    po.setWindowOptions(window_opts);
  }
 else {
    po=getSOp(StormOper.OpType.COMBINE_PERSIST,getAlias(mr.combinePlan,false));
    po.setPlan(mr.combinePlan);
    po.mapKeyType=mr.mapKeyType;
  }
  if (mr.getRequestedParallelism() > 0) {
    po.setParallelismHint(mr.getRequestedParallelism());
  }
  splan.add(po);
  if (!po.getStateFactory(pc).getClass().getName().startsWith("String_Node_Str")) {
    StateFactory sf=po.getStateFactory(pc);
    splan.UDFs.add(sf.getClass().getName());
    if (IUDFExposer.class.isInstance(sf)) {
      IUDFExposer ex=(IUDFExposer)sf;
      splan.UDFs.addAll(ex.getUDFs());
    }
  }
  try {
    splan.connect(mo,po);
  }
 catch (  PlanException e) {
    e.printStackTrace();
  }
  StormOper rdo=getSOp(StormOper.OpType.REDUCE_DELTA,getAlias(mr.reducePlan,false));
  splan.add(rdo);
  try {
    splan.connect(po,rdo);
  }
 catch (  PlanException e) {
    e.printStackTrace();
  }
  rdo.setPlan(mr.reducePlan);
  rdo.setWindowOptions(window_opts);
  setupStore(mr.reducePlan.getLeaves(),rdo);
}

Fixed version (ground truth):
public void visitMROp(MapReduceOper mr) throws VisitorException {
  splan.UDFs.addAll(mr.UDFs);
  updateUDFs(mr.mapPlan);
  new PhyPlanSetter(mr.mapPlan).visit();
  new PhyPlanSetter(mr.reducePlan).visit();
  StormOper mo=getSOp(StormOper.OpType.MAP,getAlias(mr.mapPlan,false));
  mo.mapKeyType=mr.mapKeyType;
  splan.add(mo);
  String mapAlias=mo.name();
  log.info("String_Node_Str" + mapAlias + "String_Node_Str");
  if (pc.getProperties().getProperty(mapAlias + "String_Node_Str","String_Node_Str").equalsIgnoreCase("String_Node_Str")) {
    mo.shuffleBefore(true);
  }
  if (pc.getProperties().getProperty(mapAlias + "String_Node_Str",null) != null) {
    mo.setParallelismHint(Integer.parseInt(pc.getProperties().getProperty(mapAlias + "String_Node_Str")));
  }
  for (  PhysicalOperator po : mr.mapPlan.getRoots()) {
    POLoad pl=(POLoad)po;
    if (pl instanceof NOPLoad) {
      continue;
    }
    String fn=pl.getLFile().getFileName();
    if (!rootMap.containsKey(fn) && pl.getLoadFunc() instanceof SpoutWrapper) {
      StormOper spout=getSOp(StormOper.OpType.SPOUT,po.getAlias());
      SpoutWrapper sw=((SpoutWrapper)pl.getLoadFunc());
      spout.setParallelismHint(sw.getParallelismHint());
      spout.setSpout(sw.getSpout());
      spout.setTupleConverter(sw.getTupleConverter());
      splan.add(spout);
      splan.addPLSpoutLink(spout,pl);
      rootMap.put(fn,spout);
    }
    if (rootMap.containsKey(fn)) {
      try {
        splan.connect(rootMap.get(fn),mo);
      }
 catch (      PlanException e) {
        e.printStackTrace();
      }
    }
 else {
      List<StormOper> wait=missingRoots.get(po);
      if (wait == null) {
        wait=new ArrayList<StormOper>();
        missingRoots.put(fn,wait);
      }
      wait.add(mo);
    }
  }
  mo.setPlan(mr.mapPlan);
  if (mr.combinePlan.size() > 0) {
    mo.isCombined=true;
  }
  if (mr.reducePlan.size() == 0) {
    setupStore(mr.mapPlan.getLeaves(),mo);
    return;
  }
  StormOper po;
  String red_alias;
  if (mr.reducePlan.getRoots().get(0) instanceof POPackage) {
    red_alias=getAlias(mr.mapPlan,false);
  }
 else {
    red_alias=(mr.combinePlan.size() > 0) ? getAlias(mr.combinePlan,false) : getAlias(mr.reducePlan,true);
  }
  String window_opts=StormOper.getWindowOpts(pc,red_alias);
  if (mr.combinePlan.size() == 0 || window_opts != null) {
    po=getSOp(StormOper.OpType.BASIC_PERSIST,red_alias);
    po.setWindowOptions(window_opts);
  }
 else {
    po=getSOp(StormOper.OpType.COMBINE_PERSIST,getAlias(mr.combinePlan,false));
    po.setPlan(mr.combinePlan);
    po.mapKeyType=mr.mapKeyType;
  }
  if (mr.getRequestedParallelism() > 0) {
    po.setParallelismHint(mr.getRequestedParallelism());
  }
  splan.add(po);
  if (!po.getStateFactory(pc).getClass().getName().startsWith("String_Node_Str")) {
    StateFactory sf=po.getStateFactory(pc);
    splan.UDFs.add(sf.getClass().getName());
    if (IUDFExposer.class.isInstance(sf)) {
      IUDFExposer ex=(IUDFExposer)sf;
      splan.UDFs.addAll(ex.getUDFs());
    }
  }
  try {
    splan.connect(mo,po);
  }
 catch (  PlanException e) {
    e.printStackTrace();
  }
  StormOper rdo=getSOp(StormOper.OpType.REDUCE_DELTA,getAlias(mr.reducePlan,false));
  splan.add(rdo);
  try {
    splan.connect(po,rdo);
  }
 catch (  PlanException e) {
    e.printStackTrace();
  }
  rdo.setPlan(mr.reducePlan);
  rdo.setWindowOptions(window_opts);
  setupStore(mr.reducePlan.getLeaves(),rdo);
}