Program: 38642
Project: 38642
Buggy source:
public static void runNMCS(InputHandler inputHandler,OutputHandler outputHandler,ArgumentHandler argumentHandler) throws IOException, CDKException, CloneNotSupportedException {
  IIteratingChemObjectReader reader=inputHandler.getAllTargets();
  String targetType=argumentHandler.getTargetType();
  if (reader == null) {
    throw new IOException("String_Node_Str" + targetType);
  }
  List<IAtomContainer> atomContainerSet=new ArrayList<IAtomContainer>();
  while (reader.hasNext()) {
    IAtomContainer target=(IAtomContainer)reader.next();
    atomContainerSet.add(target);
  }
  Comparator<IAtomContainer> comparator=new AtomContainerComparator();
  Collections.sort(atomContainerSet,comparator);
  IAtomContainer mcsAtomContainer=null;
  boolean matchBonds=argumentHandler.isMatchBondType();
  boolean matchRings=argumentHandler.isMatchRingType();
  boolean removeHydrogens=argumentHandler.isApplyHRemoval();
  int filter=argumentHandler.getChemFilter();
  List<IAtomContainer> targets=new ArrayList<IAtomContainer>();
  for (  IAtomContainer target : atomContainerSet) {
    boolean flag=ConnectivityChecker.isConnected(target);
    if (!flag) {
      System.err.println("String_Node_Str" + target.getProperty(CDKConstants.TITLE) + "String_Node_Str");
      continue;
    }
 else {
      if (target.getProperty(CDKConstants.TITLE) != null) {
        target.setID((String)target.getProperty(CDKConstants.TITLE));
        argumentHandler.setTargetMolOutName(target.getID() == null ? "String_Node_Str" : target.getID());
      }
    }
    if (removeHydrogens) {
      target=new AtomContainer(AtomContainerManipulator.removeHydrogens(target));
    }
    if (mcsAtomContainer != null) {
      flag=ConnectivityChecker.isConnected(mcsAtomContainer);
      if (!flag) {
        System.err.println("String_Node_Str" + mcsAtomContainer.getProperty(CDKConstants.TITLE) + "String_Node_Str");
        return;
      }
 else       if (mcsAtomContainer.getProperty(CDKConstants.TITLE) != null) {
        String mcsFilenName=mcsAtomContainer.getProperty(CDKConstants.TITLE).equals("String_Node_Str") ? "String_Node_Str" : (String)mcsAtomContainer.getProperty(CDKConstants.TITLE);
        mcsAtomContainer.setID(mcsFilenName);
        argumentHandler.setQueryMolOutName(mcsAtomContainer.getID());
      }
      if (removeHydrogens) {
        mcsAtomContainer=new AtomContainer(AtomContainerManipulator.removeHydrogens(mcsAtomContainer));
      }
    }
    inputHandler.configure(target,targetType);
    if (mcsAtomContainer == null) {
      mcsAtomContainer=target;
      targets.add(target);
    }
 else {
      BaseMapping smsd=run(mcsAtomContainer,target,filter,matchBonds,matchRings);
      target=target.getBuilder().newInstance(IAtomContainer.class,smsd.getFirstAtomMapping().getTarget());
      targets.add(target);
      Map<Integer,Integer> mapping=getIndexMapping(smsd.getFirstAtomMapping());
      IAtomContainer subgraph=getSubgraph(target,mapping);
      mcsAtomContainer=new AtomContainer(subgraph);
    }
  }
  inputHandler.configure(mcsAtomContainer,targetType);
  if (argumentHandler.shouldOutputSubgraph()) {
    String outpath=argumentHandler.getOutputFilepath();
    String outtype=argumentHandler.getOutputFiletype();
    outputHandler.writeMol(outtype,mcsAtomContainer,outpath);
  }
  if (mcsAtomContainer != null && argumentHandler.isImage()) {
    List<Map<Integer,Integer>> mappings=new ArrayList<Map<Integer,Integer>>();
    List<IAtomContainer> secondRoundTargets=new ArrayList<IAtomContainer>();
    IChemObjectBuilder builder=DefaultChemObjectBuilder.getInstance();
    for (    IAtomContainer target : targets) {
      BaseMapping smsd=run(mcsAtomContainer,target,filter,matchBonds,matchRings);
      mappings.add(getIndexMapping(smsd.getFirstAtomMapping()));
      secondRoundTargets.add(builder.newInstance(IAtomContainer.class,smsd.getFirstAtomMapping().getTarget()));
    }
    String name=inputHandler.getTargetName();
    outputHandler.writeCircleImage(mcsAtomContainer,secondRoundTargets,name,mappings);
  }
}

Fixed version (ground truth):
public static void runNMCS(InputHandler inputHandler,OutputHandler outputHandler,ArgumentHandler argumentHandler) throws IOException, CDKException, CloneNotSupportedException {
  IIteratingChemObjectReader reader=inputHandler.getAllTargets();
  String targetType=argumentHandler.getTargetType();
  if (reader == null) {
    throw new IOException("String_Node_Str" + targetType);
  }
  List<IAtomContainer> atomContainerSet=new ArrayList<IAtomContainer>();
  while (reader.hasNext()) {
    IAtomContainer target=(IAtomContainer)reader.next();
    atomContainerSet.add(target);
  }
  Comparator<IAtomContainer> comparator=new AtomContainerComparator();
  Collections.sort(atomContainerSet,comparator);
  IAtomContainer mcsAtomContainer=null;
  boolean matchBonds=argumentHandler.isMatchBondType();
  boolean matchRings=argumentHandler.isMatchRingType();
  boolean removeHydrogens=argumentHandler.isApplyHRemoval();
  int filter=argumentHandler.getChemFilter();
  List<IAtomContainer> targets=new ArrayList<IAtomContainer>();
  for (  IAtomContainer target : atomContainerSet) {
    boolean flag=ConnectivityChecker.isConnected(target);
    String name=(String)target.getProperty(CDKConstants.TITLE);
    if (!flag) {
      System.err.println("String_Node_Str" + target.getProperty(CDKConstants.TITLE) + "String_Node_Str");
      continue;
    }
 else {
      if (target.getProperty(CDKConstants.TITLE) != null) {
        target.setID((String)target.getProperty(CDKConstants.TITLE));
        argumentHandler.setTargetMolOutName(target.getID() == null ? "String_Node_Str" : target.getID());
      }
    }
    if (removeHydrogens) {
      target=new AtomContainer(AtomContainerManipulator.removeHydrogens(target));
      target.setProperty(CDKConstants.TITLE,name);
      target.setID(name);
    }
    if (mcsAtomContainer != null) {
      flag=ConnectivityChecker.isConnected(mcsAtomContainer);
      if (!flag) {
        System.err.println("String_Node_Str" + mcsAtomContainer.getProperty(CDKConstants.TITLE) + "String_Node_Str");
        return;
      }
 else       if (mcsAtomContainer.getProperty(CDKConstants.TITLE) != null) {
        String mcsFilenName=mcsAtomContainer.getProperty(CDKConstants.TITLE).equals("String_Node_Str") ? "String_Node_Str" : (String)mcsAtomContainer.getProperty(CDKConstants.TITLE);
        mcsAtomContainer.setID(mcsFilenName);
        argumentHandler.setQueryMolOutName(mcsAtomContainer.getID());
      }
      if (removeHydrogens) {
        mcsAtomContainer=new AtomContainer(AtomContainerManipulator.removeHydrogens(mcsAtomContainer));
      }
    }
    inputHandler.configure(target,targetType);
    if (mcsAtomContainer == null) {
      mcsAtomContainer=target;
      targets.add(target);
    }
 else {
      BaseMapping smsd=run(mcsAtomContainer,target,filter,matchBonds,matchRings);
      target=target.getBuilder().newInstance(IAtomContainer.class,smsd.getFirstAtomMapping().getTarget());
      targets.add(target);
      Map<Integer,Integer> mapping=getIndexMapping(smsd.getFirstAtomMapping());
      IAtomContainer subgraph=getSubgraph(target,mapping);
      mcsAtomContainer=new AtomContainer(subgraph);
    }
  }
  inputHandler.configure(mcsAtomContainer,targetType);
  if (argumentHandler.shouldOutputSubgraph()) {
    String outpath=argumentHandler.getOutputFilepath();
    String outtype=argumentHandler.getOutputFiletype();
    outputHandler.writeMol(outtype,mcsAtomContainer,outpath);
  }
  if (mcsAtomContainer != null && argumentHandler.isImage()) {
    List<Map<Integer,Integer>> mappings=new ArrayList<Map<Integer,Integer>>();
    List<IAtomContainer> secondRoundTargets=new ArrayList<IAtomContainer>();
    IChemObjectBuilder builder=DefaultChemObjectBuilder.getInstance();
    for (    IAtomContainer target : targets) {
      BaseMapping smsd=run(mcsAtomContainer,target,filter,matchBonds,matchRings);
      mappings.add(getIndexMapping(smsd.getFirstAtomMapping()));
      secondRoundTargets.add(builder.newInstance(IAtomContainer.class,smsd.getFirstAtomMapping().getTarget()));
    }
    String name=inputHandler.getTargetName();
    outputHandler.writeCircleImage(mcsAtomContainer,secondRoundTargets,name,mappings);
  }
}