Program: 17099
Project: 17099
Buggy source:
private void runPairwise(){
  String name1=params.getPdb1();
  String file1=params.getFile1();
  if (name1 == null && file1 == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (file1 == null) {
    if (name1.length() < 4) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  String name2=params.getPdb2();
  String file2=params.getFile2();
  if (name2 == null && file2 == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (file2 == null) {
    if (name2.length() < 4) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  Structure structure1=null;
  Structure structure2=null;
  String path=params.getPdbFilePath();
  if (file1 == null || file2 == null) {
    if (path == null) {
      throw new RuntimeException("String_Node_Str");
    }
    AtomCache cache=new AtomCache(path,params.isPdbDirSplit());
    cache.setAutoFetch(params.isAutoFetch());
    structure1=getStructure(cache,name1,file1);
    structure2=getStructure(cache,name2,file2);
  }
 else {
    structure1=getStructure(null,name1,file1);
    structure2=getStructure(null,name2,file2);
  }
  if (structure1 == null) {
    System.err.println("String_Node_Str");
    return;
  }
  if (structure2 == null) {
    System.err.println("String_Node_Str");
    return;
  }
  try {
    Atom[] ca1;
    Atom[] ca2;
    List<Group> hetatms1=new ArrayList<Group>();
    List<Group> nucs1=new ArrayList<Group>();
    List<Group> hetatms2=new ArrayList<Group>();
    List<Group> nucs2=new ArrayList<Group>();
    ca1=StructureTools.getAtomCAArray(structure1);
    ca2=StructureTools.getAtomCAArray(structure2);
    if (params.isShow3d()) {
      hetatms1=structure1.getChain(0).getAtomGroups("String_Node_Str");
      nucs1=structure1.getChain(0).getAtomGroups("String_Node_Str");
    }
    StructureAlignment algorithm=getAlgorithm();
    Object jparams=getParameters();
    AFPChain afpChain;
    afpChain=algorithm.align(ca1,ca2,jparams);
    afpChain.setName1(name1);
    afpChain.setName2(name2);
    if (params.isShow3d()) {
      if ((afpChain.getBlockNum() - 1) == 0) {
        hetatms2=structure2.getChain(0).getAtomGroups("String_Node_Str");
        nucs2=structure2.getChain(0).getAtomGroups("String_Node_Str");
      }
      if (!GuiWrapper.isGuiModuleInstalled()) {
        System.err.println("String_Node_Str");
      }
 else {
        try {
          Object jmol=GuiWrapper.display(afpChain,ca1,ca2,hetatms1,nucs1,hetatms2,nucs2);
          GuiWrapper.showAlignmentImage(afpChain,ca1,ca2,jmol);
        }
 catch (        Exception e) {
          System.err.println(e.getMessage());
          e.printStackTrace();
        }
      }
    }
    if (params.getOutFile() != null) {
      String output=null;
      if (params.isOutputPDB()) {
        if (!GuiWrapper.isGuiModuleInstalled()) {
          System.err.println("String_Node_Str");
          output=AFPChainXMLConverter.toXML(afpChain,ca1,ca2);
        }
 else {
          Structure tmp=AFPAlignmentDisplay.createArtificalStructure(afpChain,ca1,ca2);
          output="String_Node_Str" + afpChain.getAlgorithmName() + "String_Node_Str"+ afpChain.getVersion()+ "String_Node_Str";
          output+=afpChain.getName1() + "String_Node_Str" + afpChain.getName2();
          output+=newline;
          output+=tmp.toPDB();
        }
      }
 else {
        output=AFPChainXMLConverter.toXML(afpChain,ca1,ca2);
      }
      FileOutputStream out;
      PrintStream p;
      try {
        out=new FileOutputStream(params.getOutFile());
        p=new PrintStream(out);
        p.println(output);
        p.close();
      }
 catch (      Exception e) {
        System.err.println("String_Node_Str" + params.getOutFile());
      }
    }
    if (params.isPrintXML()) {
      String fatcatXML=AFPChainXMLConverter.toXML(afpChain,ca1,ca2);
      System.out.println(fatcatXML);
    }
    if (params.isPrintFatCat()) {
      System.out.println(afpChain.toFatcat(ca1,ca2));
    }
    if (params.isPrintCE()) {
      System.out.println(afpChain.toCE(ca1,ca2));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return;
  }
}

Fixed version (ground truth):
private void runPairwise(){
  String name1=params.getPdb1();
  String file1=params.getFile1();
  if (name1 == null && file1 == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (file1 == null) {
    if (name1.length() < 4) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  String name2=params.getPdb2();
  String file2=params.getFile2();
  if (name2 == null && file2 == null) {
    throw new RuntimeException("String_Node_Str");
  }
  if (file2 == null) {
    if (name2.length() < 4) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  Structure structure1=null;
  Structure structure2=null;
  String path=params.getPdbFilePath();
  if (file1 == null || file2 == null) {
    if (path == null) {
      throw new RuntimeException("String_Node_Str");
    }
    AtomCache cache=new AtomCache(path,params.isPdbDirSplit());
    cache.setAutoFetch(params.isAutoFetch());
    structure1=getStructure(cache,name1,file1);
    structure2=getStructure(cache,name2,file2);
  }
 else {
    structure1=getStructure(null,name1,file1);
    structure2=getStructure(null,name2,file2);
  }
  if (structure1 == null) {
    System.err.println("String_Node_Str");
    return;
  }
  if (structure2 == null) {
    System.err.println("String_Node_Str");
    return;
  }
  try {
    Atom[] ca1;
    Atom[] ca2;
    List<Group> hetatms1=new ArrayList<Group>();
    List<Group> nucs1=new ArrayList<Group>();
    List<Group> hetatms2=new ArrayList<Group>();
    List<Group> nucs2=new ArrayList<Group>();
    ca1=StructureTools.getAtomCAArray(structure1);
    ca2=StructureTools.getAtomCAArray(structure2);
    if (params.isShow3d()) {
      hetatms1=structure1.getChain(0).getAtomGroups("String_Node_Str");
      nucs1=structure1.getChain(0).getAtomGroups("String_Node_Str");
    }
    StructureAlignment algorithm=getAlgorithm();
    Object jparams=getParameters();
    AFPChain afpChain;
    afpChain=algorithm.align(ca1,ca2,jparams);
    afpChain.setName1(name1);
    afpChain.setName2(name2);
    if (params.isShow3d()) {
      if (!GuiWrapper.isGuiModuleInstalled()) {
        System.err.println("String_Node_Str");
      }
 else {
        try {
          Object jmol=GuiWrapper.display(afpChain,ca1,ca2);
          GuiWrapper.showAlignmentImage(afpChain,ca1,ca2,jmol);
        }
 catch (        Exception e) {
          System.err.println(e.getMessage());
          e.printStackTrace();
        }
      }
    }
    if (params.getOutFile() != null) {
      String output=null;
      if (params.isOutputPDB()) {
        if (!GuiWrapper.isGuiModuleInstalled()) {
          System.err.println("String_Node_Str");
          output=AFPChainXMLConverter.toXML(afpChain,ca1,ca2);
        }
 else {
          Structure tmp=AFPAlignmentDisplay.createArtificalStructure(afpChain,ca1,ca2);
          output="String_Node_Str" + afpChain.getAlgorithmName() + "String_Node_Str"+ afpChain.getVersion()+ "String_Node_Str";
          output+=afpChain.getName1() + "String_Node_Str" + afpChain.getName2();
          output+=newline;
          output+=tmp.toPDB();
        }
      }
 else {
        output=AFPChainXMLConverter.toXML(afpChain,ca1,ca2);
      }
      FileOutputStream out;
      PrintStream p;
      try {
        out=new FileOutputStream(params.getOutFile());
        p=new PrintStream(out);
        p.println(output);
        p.close();
      }
 catch (      Exception e) {
        System.err.println("String_Node_Str" + params.getOutFile());
      }
    }
    if (params.isPrintXML()) {
      String fatcatXML=AFPChainXMLConverter.toXML(afpChain,ca1,ca2);
      System.out.println(fatcatXML);
    }
    if (params.isPrintFatCat()) {
      System.out.println(afpChain.toFatcat(ca1,ca2));
    }
    if (params.isPrintCE()) {
      System.out.println(afpChain.toCE(ca1,ca2));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return;
  }
}