Program: 17135
Project: 17135
Buggy source:
public void actionPerformed(ActionEvent evt){
  final JFileChooser fc=new JFileChooser();
  int returnVal=fc.showOpenDialog(null);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file=fc.getSelectedFile();
    try {
      InputStreamProvider ip=new InputStreamProvider();
      InputStream stream=ip.getInputStream(file);
      BufferedReader in=new BufferedReader(new InputStreamReader(stream));
      StringBuffer xml=new StringBuffer();
      String str;
      while ((str=in.readLine()) != null) {
        xml.append(str);
      }
      in.close();
      AFPChain[] afps=AFPChainXMLParser.parseMultiXML(xml.toString());
      AFPChain afpChain=afps[0];
      UserConfiguration config=WebStartMain.getWebStartConfig();
      AtomCache cache=new AtomCache(config.getPdbFilePath(),config.isSplit());
      Atom[] ca1=cache.getAtoms(afpChain.getName1());
      Atom[] ca2=cache.getAtoms(afpChain.getName2());
      AFPChainXMLParser.rebuildAFPChain(afpChain,ca1,ca2);
      Chain c1=ca1[0].getParent().getParent();
      Chain c2=ca2[0].getParent().getParent();
      List<Group> hetatms=c1.getAtomGroups("String_Node_Str");
      List<Group> nucs1=c1.getAtomGroups("String_Node_Str");
      List<Group> hetatms2=new ArrayList<Group>();
      List<Group> nucs2=new ArrayList<Group>();
      if ((afpChain.getBlockNum() - 1) == 0) {
        hetatms2=c2.getAtomGroups("String_Node_Str");
        nucs2=c2.getAtomGroups("String_Node_Str");
      }
      StructureAlignmentJmol jmol=StructureAlignmentDisplay.display(afpChain,ca1,ca2,hetatms,nucs1,hetatms2,nucs2);
      DisplayAFP.showAlignmentImage(afpChain,ca1,ca2,jmol);
    }
 catch (    Exception e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null,"String_Node_Str" + e.getMessage());
    }
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent evt){
  final JFileChooser fc=new JFileChooser();
  int returnVal=fc.showOpenDialog(null);
  if (returnVal == JFileChooser.APPROVE_OPTION) {
    File file=fc.getSelectedFile();
    try {
      InputStreamProvider ip=new InputStreamProvider();
      InputStream stream=ip.getInputStream(file);
      BufferedReader in=new BufferedReader(new InputStreamReader(stream));
      StringBuffer xml=new StringBuffer();
      String str;
      while ((str=in.readLine()) != null) {
        xml.append(str);
      }
      in.close();
      AFPChain[] afps=AFPChainXMLParser.parseMultiXML(xml.toString());
      AFPChain afpChain=afps[0];
      UserConfiguration config=WebStartMain.getWebStartConfig();
      AtomCache cache=new AtomCache(config.getPdbFilePath(),config.isSplit());
      Atom[] ca1=cache.getAtoms(afpChain.getName1());
      Atom[] ca2=cache.getAtoms(afpChain.getName2());
      AFPChainXMLParser.rebuildAFPChain(afpChain,ca1,ca2);
      Chain c1=ca1[0].getParent().getParent();
      Chain c2=ca2[0].getParent().getParent();
      StructureAlignmentJmol jmol=StructureAlignmentDisplay.display(afpChain,ca1,ca2);
      DisplayAFP.showAlignmentImage(afpChain,ca1,ca2,jmol);
    }
 catch (    Exception e) {
      e.printStackTrace();
      JOptionPane.showMessageDialog(null,"String_Node_Str" + e.getMessage());
    }
  }
}