Program: 16306
Project: 16306
Buggy source:
public void formBondsFromStructConn(List<StructConn> structConn){
  final String symop="String_Node_Str";
  List<Bond> ssbonds=new ArrayList<>();
  for (  StructConn conn : structConn) {
    if (!BOND_TYPES_TO_PARSE.contains(conn.getConn_type_id()))     continue;
    String chainId1;
    String chainId2;
    chainId1=conn.getPtnr1_label_asym_id();
    chainId2=conn.getPtnr2_label_asym_id();
    String insCode1="String_Node_Str";
    if (!conn.getPdbx_ptnr1_PDB_ins_code().equals("String_Node_Str"))     insCode1=conn.getPdbx_ptnr1_PDB_ins_code();
    String insCode2="String_Node_Str";
    if (!conn.getPdbx_ptnr2_PDB_ins_code().equals("String_Node_Str"))     insCode2=conn.getPdbx_ptnr2_PDB_ins_code();
    String seqId1=conn.getPtnr1_auth_seq_id();
    String seqId2=conn.getPtnr2_auth_seq_id();
    String resName1=conn.getPtnr1_label_comp_id();
    String resName2=conn.getPtnr2_label_comp_id();
    String atomName1=conn.getPtnr1_label_atom_id();
    String atomName2=conn.getPtnr2_label_atom_id();
    String altLoc1="String_Node_Str";
    if (!conn.getPdbx_ptnr1_label_alt_id().equals("String_Node_Str"))     altLoc1=conn.getPdbx_ptnr1_label_alt_id();
    String altLoc2="String_Node_Str";
    if (!conn.getPdbx_ptnr2_label_alt_id().equals("String_Node_Str"))     altLoc2=conn.getPdbx_ptnr2_label_alt_id();
    if (!conn.getPtnr1_symmetry().equals(symop) || !conn.getPtnr2_symmetry().equals(symop)) {
      logger.info("String_Node_Str",atomName1,seqId1,insCode1,atomName2,seqId2,insCode2);
      continue;
    }
    String altLocStr1=altLoc1.isEmpty() ? "String_Node_Str" : "String_Node_Str" + altLoc1 + "String_Node_Str";
    String altLocStr2=altLoc2.isEmpty() ? "String_Node_Str" : "String_Node_Str" + altLoc2 + "String_Node_Str";
    Atom a1=null;
    Atom a2=null;
    try {
      a1=getAtomFromRecord(atomName1,altLoc1,resName1,chainId1,seqId1,insCode1);
    }
 catch (    StructureException e) {
      logger.warn("String_Node_Str",seqId1,insCode1,resName1,chainId1,atomName1,altLocStr1);
      continue;
    }
    try {
      a2=getAtomFromRecord(atomName2,altLoc2,resName2,chainId2,seqId2,insCode2);
    }
 catch (    StructureException e) {
      logger.warn("String_Node_Str",seqId2,insCode2,resName2,chainId2,atomName2,altLocStr2);
      continue;
    }
    if (a1 == null) {
      logger.warn("String_Node_Str",atomName1,altLocStr1,seqId1,insCode1,resName1,chainId1);
      continue;
    }
    if (a2 == null) {
      logger.warn("String_Node_Str",atomName2,altLocStr2,seqId2,insCode2,resName2,chainId2);
      continue;
    }
    Bond bond=new BondImpl(a1,a2,1);
    if (conn.getConn_type_id().equals("String_Node_Str")) {
      ssbonds.add(bond);
    }
  }
  structure.setSSBonds(ssbonds);
}

Fixed version (ground truth):
public void formBondsFromStructConn(List<StructConn> structConn){
  final String symop="String_Node_Str";
  List<Bond> ssbonds=new ArrayList<>();
  for (  StructConn conn : structConn) {
    if (!BOND_TYPES_TO_PARSE.contains(conn.getConn_type_id()))     continue;
    String chainId1;
    String chainId2;
    chainId1=conn.getPtnr1_label_asym_id();
    chainId2=conn.getPtnr2_label_asym_id();
    String insCode1="String_Node_Str";
    if (!conn.getPdbx_ptnr1_PDB_ins_code().equals("String_Node_Str"))     insCode1=conn.getPdbx_ptnr1_PDB_ins_code();
    String insCode2="String_Node_Str";
    if (!conn.getPdbx_ptnr2_PDB_ins_code().equals("String_Node_Str"))     insCode2=conn.getPdbx_ptnr2_PDB_ins_code();
    String seqId1=conn.getPtnr1_auth_seq_id();
    String seqId2=conn.getPtnr2_auth_seq_id();
    String resName1=conn.getPtnr1_label_comp_id();
    String resName2=conn.getPtnr2_label_comp_id();
    String atomName1=conn.getPtnr1_label_atom_id();
    String atomName2=conn.getPtnr2_label_atom_id();
    String altLoc1="String_Node_Str";
    if (!conn.getPdbx_ptnr1_label_alt_id().equals("String_Node_Str"))     altLoc1=conn.getPdbx_ptnr1_label_alt_id();
    String altLoc2="String_Node_Str";
    if (!conn.getPdbx_ptnr2_label_alt_id().equals("String_Node_Str"))     altLoc2=conn.getPdbx_ptnr2_label_alt_id();
    if (!conn.getPtnr1_symmetry().equals(symop) || !conn.getPtnr2_symmetry().equals(symop)) {
      logger.info("String_Node_Str",atomName1,seqId1,insCode1,atomName2,seqId2,insCode2);
      continue;
    }
    String altLocStr1=altLoc1.isEmpty() ? "String_Node_Str" : "String_Node_Str" + altLoc1 + "String_Node_Str";
    String altLocStr2=altLoc2.isEmpty() ? "String_Node_Str" : "String_Node_Str" + altLoc2 + "String_Node_Str";
    Map<Integer,Atom> a1=null;
    Map<Integer,Atom> a2=null;
    try {
      a1=getAtomFromRecord(atomName1,altLoc1,resName1,chainId1,seqId1,insCode1);
    }
 catch (    StructureException e) {
      logger.warn("String_Node_Str",seqId1,insCode1,resName1,chainId1,atomName1,altLocStr1);
      continue;
    }
    try {
      a2=getAtomFromRecord(atomName2,altLoc2,resName2,chainId2,seqId2,insCode2);
    }
 catch (    StructureException e) {
      logger.warn("String_Node_Str",seqId2,insCode2,resName2,chainId2,atomName2,altLocStr2);
      continue;
    }
    if (a1 == null) {
      logger.warn("String_Node_Str",atomName1,altLocStr1,seqId1,insCode1,resName1,chainId1);
      continue;
    }
    if (a2 == null) {
      logger.warn("String_Node_Str",atomName2,altLocStr2,seqId2,insCode2,resName2,chainId2);
      continue;
    }
    for (int i=0; i < structure.nrModels(); i++) {
      Bond bond=null;
      if (a1.containsKey(i) && a2.containsKey(i)) {
        bond=new BondImpl(a1.get(i),a2.get(i),1);
      }
      if (bond != null) {
        if (conn.getConn_type_id().equals("String_Node_Str")) {
          ssbonds.add(bond);
        }
      }
    }
  }
  structure.setSSBonds(ssbonds);
}