Program: 16413
Project: 16413
Buggy source:
private void comparePDB2cif(String id,String chainId) throws IOException {
  String fileName="String_Node_Str" + id + "String_Node_Str";
  InputStream inStream=this.getClass().getResourceAsStream(fileName);
  assertNotNull("String_Node_Str" + fileName + "String_Node_Str",inStream);
  MMcifParser parser=new SimpleMMcifParser();
  SimpleMMcifConsumer consumer=new SimpleMMcifConsumer();
  FileParsingParameters params=new FileParsingParameters();
  params.setHeaderOnly(headerOnly);
  consumer.setFileParsingParameters(params);
  parser.addMMcifConsumer(consumer);
  try {
    parser.parse(new BufferedReader(new InputStreamReader(inStream)));
  }
 catch (  IOException e) {
    fail(e.getMessage());
  }
  parser.clearConsumers();
  Structure cifStructure=consumer.getStructure();
  assertNotNull(cifStructure);
  Structure pdbStructure=null;
  InputStream pinStream=this.getClass().getResourceAsStream("String_Node_Str" + id + "String_Node_Str");
  assertNotNull(inStream);
  PDBFileParser pdbpars=new PDBFileParser();
  pdbpars.setFileParsingParameters(params);
  pdbStructure=pdbpars.parsePDBFile(pinStream);
  assertNotNull(pdbStructure);
  try {
    assertEquals(id + "String_Node_Str",pdbStructure.isNmr(),cifStructure.isNmr());
    if (pdbStructure.isNmr()) {
      assertEquals(id + "String_Node_Str",pdbStructure.nrModels(),pdbStructure.nrModels());
      checkNMR(pdbStructure);
      checkNMR(cifStructure);
    }
    Chain a_pdb=pdbStructure.getChainByPDB(chainId);
    Chain a_cif=cifStructure.getChainByPDB(chainId);
    String pdb_SEQseq=a_pdb.getSeqResSequence();
    String cif_SEQseq=a_cif.getSeqResSequence();
    assertEquals(id + "String_Node_Str",pdb_SEQseq,cif_SEQseq);
    assertEquals(id + "String_Node_Str",a_pdb.getAtomGroups(GroupType.AMINOACID).size(),a_cif.getAtomGroups(GroupType.AMINOACID).size());
    for (int i=0; i < a_pdb.getAtomGroups(GroupType.AMINOACID).size(); i++) {
      Group gp=a_pdb.getAtomGroups(GroupType.AMINOACID).get(i);
      List<Group> cifGroups=a_cif.getAtomGroups(GroupType.AMINOACID);
      Group gc=cifGroups.get(i);
      checkGroups(gp,gc);
    }
    String pdb_seq=a_pdb.getAtomSequence();
    String cif_seq=a_cif.getAtomSequence();
    assertEquals("String_Node_Str",pdb_seq,cif_seq);
    List<DBRef> pdb_dbrefs=pdbStructure.getDBRefs();
    List<DBRef> cif_dbrefs=cifStructure.getDBRefs();
    assertEquals("String_Node_Str",pdb_dbrefs.size(),cif_dbrefs.size());
    DBRef p=pdb_dbrefs.get(0);
    DBRef c=cif_dbrefs.get(0);
    String pdb_dbref=p.toPDB();
    String cif_dbref=c.toPDB();
    assertEquals("String_Node_Str",pdb_dbref,cif_dbref);
    PDBHeader h1=pdbStructure.getPDBHeader();
    PDBHeader h2=cifStructure.getPDBHeader();
    if (!h1.toPDB().toUpperCase().equals(h2.toPDB().toUpperCase())) {
      System.err.println(h1.toPDB());
      System.err.println(h2.toPDB());
      compareString(h1.toPDB(),h2.toPDB());
    }
    assertEquals("String_Node_Str",h1.toPDB().toUpperCase(),h2.toPDB().toUpperCase());
  }
 catch (  StructureException ex) {
    fail(ex.getMessage() + "String_Node_Str" + id);
  }
}

Fixed version (ground truth):
private void comparePDB2cif(String id,String chainId) throws IOException {
  String fileName="String_Node_Str" + id + "String_Node_Str";
  InputStream inStream=this.getClass().getResourceAsStream(fileName);
  assertNotNull("String_Node_Str" + fileName + "String_Node_Str",inStream);
  MMcifParser parser=new SimpleMMcifParser();
  SimpleMMcifConsumer consumer=new SimpleMMcifConsumer();
  FileParsingParameters params=new FileParsingParameters();
  params.setHeaderOnly(headerOnly);
  consumer.setFileParsingParameters(params);
  parser.addMMcifConsumer(consumer);
  parser.parse(new BufferedReader(new InputStreamReader(inStream)));
  parser.clearConsumers();
  Structure cifStructure=consumer.getStructure();
  assertNotNull(cifStructure);
  Structure pdbStructure=null;
  InputStream pinStream=this.getClass().getResourceAsStream("String_Node_Str" + id + "String_Node_Str");
  assertNotNull(inStream);
  PDBFileParser pdbpars=new PDBFileParser();
  pdbpars.setFileParsingParameters(params);
  pdbStructure=pdbpars.parsePDBFile(pinStream);
  assertNotNull(pdbStructure);
  assertEquals(id + "String_Node_Str",pdbStructure.isNmr(),cifStructure.isNmr());
  if (pdbStructure.isNmr()) {
    assertEquals(id + "String_Node_Str",pdbStructure.nrModels(),pdbStructure.nrModels());
    checkNMR(pdbStructure);
    checkNMR(cifStructure);
  }
  Chain a_pdb=pdbStructure.getPolyChainByPDB(chainId);
  Chain a_cif=cifStructure.getPolyChainByPDB(chainId);
  String pdb_SEQseq=a_pdb.getSeqResSequence();
  String cif_SEQseq=a_cif.getSeqResSequence();
  assertEquals(id + "String_Node_Str",pdb_SEQseq,cif_SEQseq);
  assertEquals(id + "String_Node_Str",a_pdb.getAtomGroups(GroupType.AMINOACID).size(),a_cif.getAtomGroups(GroupType.AMINOACID).size());
  for (int i=0; i < a_pdb.getAtomGroups(GroupType.AMINOACID).size(); i++) {
    Group gp=a_pdb.getAtomGroups(GroupType.AMINOACID).get(i);
    List<Group> cifGroups=a_cif.getAtomGroups(GroupType.AMINOACID);
    Group gc=cifGroups.get(i);
    checkGroups(gp,gc);
  }
  String pdb_seq=a_pdb.getAtomSequence();
  String cif_seq=a_cif.getAtomSequence();
  assertEquals("String_Node_Str",pdb_seq,cif_seq);
  List<DBRef> pdb_dbrefs=pdbStructure.getDBRefs();
  List<DBRef> cif_dbrefs=cifStructure.getDBRefs();
  assertEquals("String_Node_Str",pdb_dbrefs.size(),cif_dbrefs.size());
  DBRef p=pdb_dbrefs.get(0);
  DBRef c=cif_dbrefs.get(0);
  String pdb_dbref=p.toPDB();
  String cif_dbref=c.toPDB();
  assertEquals("String_Node_Str",pdb_dbref,cif_dbref);
  PDBHeader h1=pdbStructure.getPDBHeader();
  PDBHeader h2=cifStructure.getPDBHeader();
  if (!h1.toPDB().toUpperCase().equals(h2.toPDB().toUpperCase())) {
    System.err.println(h1.toPDB());
    System.err.println(h2.toPDB());
    compareString(h1.toPDB(),h2.toPDB());
  }
  assertEquals("String_Node_Str",h1.toPDB().toUpperCase(),h2.toPDB().toUpperCase());
}