nus-yam/ex-repair huggingface dataset:
Program: 16528
Project: 16528
Buggy source:
/** 
 * @return
 * @throws StructureException Wraps exceptions that may be thrown byindividual implementations. For example, a SCOP identifier may require that the domain definitions be available for download.
 */
private StructureIdentifier realize() throws StructureException {
  if (realized == null) {
switch (mySource) {
case CATH:
      realized=CathFactory.getCathDatabase().getDescriptionByCathId(getIdentifier());
    break;
case SCOP:
  realized=guessScopDomain(getIdentifier(),ScopFactory.getSCOP());
if (realized == null) {
  if (chainId.equals("String_Node_Str")) {
    realized=new SubstructureIdentifier(pdbId);
  }
 else {
    realized=new SubstructureIdentifier(pdbId,ResidueRange.parseMultiple(chainId));
  }
  logger.error("String_Node_Str",name,realized);
}
break;
case FILE:
try {
realized=new URLIdentifier(new File(name).toURI().toURL());
}
 catch (MalformedURLException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case URL:
try {
realized=new URLIdentifier(name);
}
 catch (MalformedURLException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case PDP:
try {
PDPProvider provider=new RemotePDPProvider(false);
realized=provider.getPDPDomain(name);
}
 catch (IOException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case PDB:
realized=new SubstructureIdentifier(getIdentifier());
break;
default :
realized=new PassthroughIdentifier(name);
break;
}
}
return realized;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws StructureException Wraps exceptions that may be thrown byindividual implementations. For example, a SCOP identifier may require that the domain definitions be available for download.
 */
private StructureIdentifier realize() throws StructureException {
  if (realized == null) {
switch (mySource) {
case CATH:
      realized=CathFactory.getCathDatabase().getDescriptionByCathId(getIdentifier());
    break;
case SCOP:
  realized=guessScopDomain(getIdentifier(),ScopFactory.getSCOP());
if (realized == null) {
  if (chainId.equals("String_Node_Str")) {
    realized=new SubstructureIdentifier(pdbId);
  }
 else {
    realized=new SubstructureIdentifier(pdbId,ResidueRange.parseMultiple(chainId));
  }
  logger.error("String_Node_Str",name,realized);
}
break;
case FILE:
try {
realized=new URLIdentifier(new File(FileDownloadUtils.expandUserHome(name)).toURI().toURL());
}
 catch (MalformedURLException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case URL:
try {
realized=new URLIdentifier(name);
}
 catch (MalformedURLException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case PDP:
try {
PDPProvider provider=new RemotePDPProvider(false);
realized=provider.getPDPDomain(name);
}
 catch (IOException e) {
throw new StructureException("String_Node_Str" + name,e);
}
break;
case PDB:
realized=new SubstructureIdentifier(getIdentifier());
break;
default :
realized=new PassthroughIdentifier(name);
break;
}
}
return realized;
}
Program: 16529
Project: 16529
Buggy source:
/** 
 * Convert a BioJava   {@link MultipleSequenceAlignment} to a forester{@link Msa}. The easiest way to convert them is writting the msa as a FASTA file and then parsing it with the forester   {@link FastaParser}.
 * @param msa BioJava MultipleSequenceAlignment
 * @return forester Msa object
 * @throws IOException 
 * @throws Exception if the conversion was not possible
 */
public static <C extends Sequence<D>,D extends Compound>Msa convert(MultipleSequenceAlignment<C,D> msa) throws IOException {
  OutputStream os=new ByteArrayOutputStream();
  FastaWriter<C,D> fastaW=new FastaWriter<C,D>(os,msa.getAlignedSequences(),new FastaHeaderFormatInterface<C,D>(){
    @Override public String getHeader(    C sequence){
      return sequence.getAccession().toString();
    }
  }
);
  fastaW.process();
  String fastaMSA=os.toString();
  return FastaParser.parseMsa(fastaMSA);
}

Fixed version (ground truth):
/** 
 * Convert a BioJava   {@link MultipleSequenceAlignment} to a forester{@link Msa}. The easiest way to convert them is writting the msa as a FASTA file and then parsing it with the forester   {@link FastaParser}.
 * @param msa BioJava MultipleSequenceAlignment
 * @return forester Msa object
 * @throws IOException if the conversion was not possible
 */
public static <C extends Sequence<D>,D extends Compound>Msa convert(MultipleSequenceAlignment<C,D> msa) throws IOException {
  OutputStream os=new ByteArrayOutputStream();
  FastaWriter<C,D> fastaW=new FastaWriter<C,D>(os,msa.getAlignedSequences(),new FastaHeaderFormatInterface<C,D>(){
    @Override public String getHeader(    C sequence){
      return sequence.getAccession().toString();
    }
  }
);
  fastaW.process();
  String fastaMSA=os.toString();
  return FastaParser.parseMsa(fastaMSA);
}
Program: 16531
Project: 16531
Buggy source:
@Override public void actionPerformed(ActionEvent ae){
  String cmd=ae.getActionCommand();
  if (multAln == null) {
    logger.error("String_Node_Str");
    return;
  }
  try {
    if (cmd.equals(MenuCreator.TEXT_ONLY)) {
      logger.warn("String_Node_Str");
    }
 else     if (cmd.equals(MenuCreator.PAIRS_ONLY)) {
      String result=MultipleAlignmentWriter.toAlignedResidues(multAln);
      MultipleAlignmentJmolDisplay.showAlignmentImage(multAln,result);
    }
 else     if (cmd.equals(MenuCreator.ALIGNMENT_PANEL)) {
      MultipleAlignmentJmolDisplay.showMultipleAligmentPanel(multAln,this);
    }
 else     if (cmd.equals(MenuCreator.FATCAT_TEXT)) {
      String result=MultipleAlignmentWriter.toFatCat(multAln) + "String_Node_Str";
      result+=MultipleAlignmentWriter.toTransformMatrices(multAln);
      MultipleAlignmentJmolDisplay.showAlignmentImage(multAln,result);
    }
 else     if (cmd.equals(MenuCreator.PHYLOGENETIC_TREE)) {
      Phylogeny kimura=MultipleAlignmentTools.getKimuraTree(multAln);
      Phylogeny blosum=MultipleAlignmentTools.getFDSBLOSUM40Tree(multAln);
      Phylogeny structural=MultipleAlignmentTools.getStructuralTree(multAln);
      Archaeopteryx.createApplication(new Phylogeny[]{kimura,blosum,structural});
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent ae){
  String cmd=ae.getActionCommand();
  if (multAln == null) {
    logger.error("String_Node_Str");
    return;
  }
  try {
    if (cmd.equals(MenuCreator.TEXT_ONLY)) {
      logger.warn("String_Node_Str");
    }
 else     if (cmd.equals(MenuCreator.PAIRS_ONLY)) {
      String result=MultipleAlignmentWriter.toAlignedResidues(multAln);
      MultipleAlignmentJmolDisplay.showAlignmentImage(multAln,result);
    }
 else     if (cmd.equals(MenuCreator.ALIGNMENT_PANEL)) {
      MultipleAlignmentJmolDisplay.showMultipleAligmentPanel(multAln,this);
    }
 else     if (cmd.equals(MenuCreator.FATCAT_TEXT)) {
      String result=MultipleAlignmentWriter.toFatCat(multAln) + "String_Node_Str";
      result+=MultipleAlignmentWriter.toTransformMatrices(multAln);
      MultipleAlignmentJmolDisplay.showAlignmentImage(multAln,result);
    }
 else     if (cmd.equals(MenuCreator.PHYLOGENETIC_TREE)) {
      Phylogeny kimura=MultipleAlignmentTools.getKimuraTree(multAln);
      Phylogeny blosum=MultipleAlignmentTools.getBLOSUM40Tree(multAln);
      Phylogeny structural=MultipleAlignmentTools.getStructuralTree(multAln);
      Archaeopteryx.createApplication(new Phylogeny[]{kimura,blosum,structural});
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}
Program: 16532
Project: 16532
Buggy source:
/** 
 * Calculate a phylogenetic tree of the MultipleAlignment using RMSD distances and the Neighbor Joining algorithm from forester.
 * @param msta MultipleAlignment of protein structures
 * @return Phylogeny phylogenetic tree
 * @throws CompoundNotFoundException
 */
public static Phylogeny getStructuralTree(MultipleAlignment msta){
  double[][] rmsdMat=MultipleAlignmentTools.getRMSDMatrix(msta).getArray();
  BasicSymmetricalDistanceMatrix rmsdDist=(BasicSymmetricalDistanceMatrix)DistanceMatrixCalculator.structuralDistance(rmsdMat,1,5,0.4);
  for (int i=0; i < msta.size(); i++)   rmsdDist.setIdentifier(i,msta.getStructureIdentifier(i).toString());
  Phylogeny tree=TreeConstructor.distanceTree(rmsdDist,TreeConstructorType.NJ);
  tree.setName("String_Node_Str");
  return tree;
}

Fixed version (ground truth):
/** 
 * Calculate a phylogenetic tree of the MultipleAlignment using RMSD distances and the Neighbor Joining algorithm from forester.
 * @param msta MultipleAlignment of protein structures
 * @return Phylogeny phylogenetic tree
 * @throws CompoundNotFoundException
 */
public static Phylogeny getStructuralTree(MultipleAlignment msta){
  double[][] rmsdMat=MultipleAlignmentTools.getRMSDMatrix(msta).getArray();
  BasicSymmetricalDistanceMatrix rmsdDist=(BasicSymmetricalDistanceMatrix)DistanceMatrixCalculator.structuralDistance(rmsdMat,1,5,0.4);
  Map<String,Integer> alreadySeen=new HashMap<String,Integer>();
  for (int i=0; i < msta.size(); i++) {
    String id=msta.getStructureIdentifier(i).toString();
    if (alreadySeen.containsKey(id)) {
      alreadySeen.put(id,alreadySeen.get(id) + 1);
      id+="String_Node_Str" + alreadySeen.get(id);
    }
 else     alreadySeen.put(id,1);
    rmsdDist.setIdentifier(i,id);
  }
  Phylogeny tree=TreeConstructor.distanceTree(rmsdDist,TreeConstructorType.NJ);
  tree.setName("String_Node_Str");
  return tree;
}
Program: 16533
Project: 16533
Buggy source:
/** 
 * Convert a MultipleAlignment into a MultipleSequenceAlignment of AminoAcid residues. This method is only valid for protein structure alignments.
 * @param msta Multiple Structure Alignment
 * @return MultipleSequenceAlignment of protein sequences
 * @throws CompoundNotFoundException
 */
public static MultipleSequenceAlignment<ProteinSequence,AminoAcidCompound> toProteinMSA(MultipleAlignment msta) throws CompoundNotFoundException {
  Group g=msta.getAtomArrays().get(0)[0].getGroup();
  if (!(g instanceof AminoAcid)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  MultipleSequenceAlignment<ProteinSequence,AminoAcidCompound> msa=new MultipleSequenceAlignment<ProteinSequence,AminoAcidCompound>();
  List<String> seqs=getSequenceAlignment(msta);
  for (int i=0; i < msta.size(); i++) {
    AccessionID id=new AccessionID(msta.getStructureIdentifier(i).toString());
    ProteinSequence pseq=new ProteinSequence(seqs.get(i));
    pseq.setAccession(id);
    msa.addAlignedSequence(pseq);
  }
  return msa;
}

Fixed version (ground truth):
/** 
 * Convert a MultipleAlignment into a MultipleSequenceAlignment of AminoAcid residues. This method is only valid for protein structure alignments.
 * @param msta Multiple Structure Alignment
 * @return MultipleSequenceAlignment of protein sequences
 * @throws CompoundNotFoundException
 */
public static MultipleSequenceAlignment<ProteinSequence,AminoAcidCompound> toProteinMSA(MultipleAlignment msta) throws CompoundNotFoundException {
  Group g=msta.getAtomArrays().get(0)[0].getGroup();
  if (!(g instanceof AminoAcid)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  MultipleSequenceAlignment<ProteinSequence,AminoAcidCompound> msa=new MultipleSequenceAlignment<ProteinSequence,AminoAcidCompound>();
  Map<String,Integer> uniqueID=new HashMap<String,Integer>();
  List<String> seqs=getSequenceAlignment(msta);
  for (int i=0; i < msta.size(); i++) {
    String id=msta.getStructureIdentifier(i).toString();
    if (uniqueID.containsKey(id)) {
      uniqueID.put(id,uniqueID.get(id) + 1);
      id+="String_Node_Str" + uniqueID.get(id);
    }
 else     uniqueID.put(id,1);
    AccessionID acc=new AccessionID(id);
    ProteinSequence pseq=new ProteinSequence(seqs.get(i));
    pseq.setAccession(acc);
    msa.addAlignedSequence(pseq);
  }
  return msa;
}
Program: 16534
Project: 16534
Buggy source:
/** 
 * Analyze the symmetries of the input Atom array using the provided parameters.
 * @param atoms representative Atom array of the Structure
 * @param param CeSymmParameters bean
 * @return CeSymmResult
 * @throws StructureException
 */
public static CeSymmResult analyze(Atom[] atoms,CESymmParameters params) throws StructureException {
  if (atoms.length < 1)   throw new IllegalArgumentException("String_Node_Str");
  if (params.getSSEThreshold() > 0) {
    Structure s=atoms[0].getGroup().getChain().getStructure();
    if (SecStrucTools.getSecStrucInfo(s).isEmpty()) {
      logger.info("String_Node_Str");
      SecStrucCalc ssp=new SecStrucCalc();
      ssp.calculate(s,true);
    }
  }
  CeSymmIterative iter=new CeSymmIterative(params);
  CeSymmResult result=iter.execute(atoms);
  if (result.isSignificant()) {
    if (params.getOptimization() && result.getSymmLevels() > 1) {
      try {
        SymmetryAxes axes=result.getAxes();
        result.setAxes(null);
        SymmOptimizer optimizer=new SymmOptimizer(result);
        MultipleAlignment optimized=optimizer.optimize();
        result.setMultipleAlignment(optimized);
        result.setAxes(axes);
      }
 catch (      RefinerFailedException e) {
        logger.info("String_Node_Str" + e.getMessage());
        return result;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Analyze the symmetries of the input Atom array using the provided parameters.
 * @param atoms representative Atom array of the Structure
 * @param param CeSymmParameters bean
 * @return CeSymmResult
 * @throws StructureException
 */
public static CeSymmResult analyze(Atom[] atoms,CESymmParameters params) throws StructureException {
  if (atoms.length < 1)   throw new IllegalArgumentException("String_Node_Str");
  if (params.getSSEThreshold() > 0) {
    Structure s=atoms[0].getGroup().getChain().getStructure();
    if (SecStrucTools.getSecStrucInfo(s).isEmpty()) {
      logger.info("String_Node_Str");
      SecStrucCalc ssp=new SecStrucCalc();
      ssp.calculate(s,true);
    }
  }
  CeSymmIterative iter=new CeSymmIterative(params);
  CeSymmResult result=iter.execute(atoms);
  if (result.isSignificant()) {
    if (params.getOptimization() && result.getSymmLevels() > 1) {
      SymmetryAxes axes=result.getAxes();
      result.setAxes(null);
      try {
        SymmOptimizer optimizer=new SymmOptimizer(result);
        MultipleAlignment optimized=optimizer.optimize();
        result.setMultipleAlignment(optimized);
        result.setAxes(axes);
      }
 catch (      RefinerFailedException e) {
        logger.info("String_Node_Str" + e.getMessage());
        result.setAxes(axes);
        return result;
      }
    }
  }
  return result;
}
Program: 16535
Project: 16535
Buggy source:
/** 
 * Tests if a PDB file can be parsed
 * @throws Exception 
 */
@Test public void testReadPDBFile() throws Exception {
  assertEquals("String_Node_Str","String_Node_Str",structure.getPDBCode());
  Chain c=structure.getChain(0);
  assertEquals("String_Node_Str",58,c.getAtomGroups(GroupType.AMINOACID).size());
  assertTrue(c.getAtomGroups(GroupType.HETATM).size() == 0);
  Chain c2=structure.getChain(1);
  assertTrue(c2.getAtomGroups(GroupType.HETATM).size() == 65);
  assertTrue(c2.getAtomGroups(GroupType.NUCLEOTIDE).size() == 0);
  List<Compound> compounds=structure.getCompounds();
  assertTrue(compounds.size() == 1);
  Compound mol=compounds.get(0);
  assertTrue(mol.getMolName().startsWith("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Tests if a PDB file can be parsed
 * @throws Exception 
 */
@Test public void testReadPDBFile() throws Exception {
  assertEquals("String_Node_Str","String_Node_Str",structure.getPDBCode());
  Chain c=structure.getChain(0);
  assertEquals("String_Node_Str",58,c.getAtomGroups(GroupType.AMINOACID).size());
  assertTrue(c.getAtomGroups(GroupType.HETATM).size() == 0);
  Chain c2=structure.getChain(1);
  assertTrue(c2.getAtomGroups(GroupType.HETATM).size() == 65);
  assertTrue(c2.getAtomGroups(GroupType.NUCLEOTIDE).size() == 0);
  List<Compound> compounds=structure.getCompounds();
  assertEquals(2,compounds.size());
  Compound mol=compounds.get(0);
  assertTrue(mol.getMolName().startsWith("String_Node_Str"));
}
Program: 16536
Project: 16536
Buggy source:
@Before public void setUp() throws IOException {
  InputStream inStream=StructureTest.class.getResourceAsStream("String_Node_Str");
  assertNotNull(inStream);
  PDBFileParser pdbpars=new PDBFileParser();
  FileParsingParameters params=new FileParsingParameters();
  params.setAlignSeqRes(true);
  pdbpars.setFileParsingParameters(params);
  structure=pdbpars.parsePDBFile(inStream);
  assertNotNull(structure);
  assertEquals("String_Node_Str",2,structure.size());
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws IOException {
  InputStream inStream=StructureTest.class.getResourceAsStream("String_Node_Str");
  assertNotNull(inStream);
  PDBFileParser pdbpars=new PDBFileParser();
  FileParsingParameters params=new FileParsingParameters();
  params.setAlignSeqRes(true);
  pdbpars.setFileParsingParameters(params);
  structure=pdbpars.parsePDBFile(inStream);
  assertNotNull(structure);
  assertEquals("String_Node_Str",2,structure.size());
}
Program: 16537
Project: 16537
Buggy source:
@Test public void testPDBHeader(){
  PDBHeader header=structure.getPDBHeader();
  String classification=header.getClassification();
  assertTrue(classification.equals("String_Node_Str"));
  String idCode=header.getIdCode();
  assertEquals("String_Node_Str" + idCode + "String_Node_Str","String_Node_Str",idCode);
  float resolution=header.getResolution();
  assertEquals("String_Node_Str" + resolution + "String_Node_Str",1.0,resolution,0.0001);
  String techShould="String_Node_Str";
  Set<ExperimentalTechnique> techniques=header.getExperimentalTechniques();
  String technique=techniques.iterator().next().getName();
  assertEquals("String_Node_Str" + technique,techShould,technique);
  List<Compound> compounds=structure.getCompounds();
  assertEquals("String_Node_Str",1,compounds.size());
  Compound comp=compounds.get(0);
  assertEquals("String_Node_Str",true,comp.getMolName().startsWith("String_Node_Str"));
  List<String> chainIds=comp.getChainIds();
  List<Chain> chains=comp.getChains();
  assertEquals("String_Node_Str",chainIds.size(),chains.size());
  assertEquals("String_Node_Str",chainIds.get(0),chains.get(0).getChainID());
}

Fixed version (ground truth):
@Test public void testPDBHeader(){
  PDBHeader header=structure.getPDBHeader();
  String classification=header.getClassification();
  assertTrue(classification.equals("String_Node_Str"));
  String idCode=header.getIdCode();
  assertEquals("String_Node_Str" + idCode + "String_Node_Str","String_Node_Str",idCode);
  float resolution=header.getResolution();
  assertEquals("String_Node_Str" + resolution + "String_Node_Str",1.0,resolution,0.0001);
  String techShould="String_Node_Str";
  Set<ExperimentalTechnique> techniques=header.getExperimentalTechniques();
  String technique=techniques.iterator().next().getName();
  assertEquals("String_Node_Str" + technique,techShould,technique);
  List<Compound> compounds=structure.getCompounds();
  assertEquals("String_Node_Str",2,compounds.size());
  Compound comp=compounds.get(0);
  assertEquals("String_Node_Str",true,comp.getMolName().startsWith("String_Node_Str"));
  List<String> chainIds=comp.getChainIds();
  List<Chain> chains=comp.getChains();
  assertEquals("String_Node_Str",chainIds.size(),chains.size());
  assertEquals("String_Node_Str",chainIds.get(0),chains.get(0).getChainID());
}
Program: 16538
Project: 16538
Buggy source:
/** 
 * Utility method that employs some heuristics to find the Compounds for this Structure in case the information is missing in PDB/mmCIF file
 * @return
 */
public List<Compound> findCompounds(){
  TreeMap<String,Compound> chainIds2entities=findCompoundsFromAlignment();
  return findUniqueCompounds(chainIds2entities);
}

Fixed version (ground truth):
/** 
 * Utility method that employs some heuristics to find the Compounds for this Structure in case the information is missing in PDB/mmCIF file
 * @return
 */
public List<Compound> findCompounds(){
  TreeMap<String,Compound> chainIds2entities=findCompoundsFromAlignment();
  List<Compound> compounds=findUniqueCompounds(chainIds2entities);
  createPurelyNonPolyCompounds(compounds);
  return compounds;
}
Program: 16540
Project: 16540
Buggy source:
private static int findMaxCompoundId(List<Compound> compounds){
  List<Integer> allIds=new ArrayList<Integer>(compounds.size());
  for (  Compound compound : compounds) {
    allIds.add(compound.getMolId());
  }
  return Collections.max(allIds);
}

Fixed version (ground truth):
private static int findMaxCompoundId(List<Compound> compounds){
  return Collections.max(compounds,new Comparator<Compound>(){
    @Override public int compare(    Compound o1,    Compound o2){
      return new Integer(o1.getMolId()).compareTo(o2.getMolId());
    }
  }
).getMolId();
}
Program: 16542
Project: 16542
Buggy source:
private void testStructureMethods(Structure sPdb,Structure sCif){
  assertEquals("String_Node_Str",sPdb.isNmr(),sCif.isNmr());
  assertEquals("String_Node_Str",sPdb.isCrystallographic(),sCif.isCrystallographic());
  assertEquals("String_Node_Str",sPdb.nrModels(),sCif.nrModels());
  assertEquals("String_Node_Str",sPdb.getPDBCode(),sCif.getPDBCode());
  assertFalse(sPdb.isBiologicalAssembly());
  assertFalse(sCif.isBiologicalAssembly());
  boolean canCompareCompoundsSize=true;
  for (  Compound compound : sCif.getCompounds()) {
    if (compound.getMolName() == null || compound.getMolName().contains("String_Node_Str")) {
      canCompareCompoundsSize=false;
      break;
    }
  }
  if (canCompareCompoundsSize)   assertEquals("String_Node_Str",sPdb.getCompounds().size(),sCif.getCompounds().size());
}

Fixed version (ground truth):
private void testStructureMethods(Structure sPdb,Structure sCif){
  assertEquals("String_Node_Str",sPdb.isNmr(),sCif.isNmr());
  assertEquals("String_Node_Str",sPdb.isCrystallographic(),sCif.isCrystallographic());
  assertEquals("String_Node_Str",sPdb.nrModels(),sCif.nrModels());
  assertEquals("String_Node_Str",sPdb.getPDBCode(),sCif.getPDBCode());
  assertFalse(sPdb.isBiologicalAssembly());
  assertFalse(sCif.isBiologicalAssembly());
  boolean canCompareCompoundsSize=true;
  for (  Compound compound : sCif.getCompounds()) {
    if (compound.getMolName() == null || compound.getMolName().contains("String_Node_Str")) {
      canCompareCompoundsSize=false;
      break;
    }
  }
  if (canCompareCompoundsSize)   assertEquals("String_Node_Str",sPdb.getCompounds().size(),sCif.getCompounds().size());
  if (!sPdb.getPDBCode().equals("String_Node_Str") && !sPdb.getPDBCode().equals("String_Node_Str"))   assertEquals("String_Node_Str",sPdb.getSSBonds().size(),sCif.getSSBonds().size());
}
Program: 16543
Project: 16543
Buggy source:
/** 
 * get residue number for first CYS. number and insertion code are joint together.
 * @return the residue number of the first CYS.
 */
public String getResnum1();

Fixed version (ground truth):
/** 
 * Get residue number for first CYS. number and insertion code are joined together.
 * @return the residue number of the first CYS.
 */
public String getResnum1();
Program: 16544
Project: 16544
Buggy source:
/** 
 * get residue number for second CYS. number and insertion code are joint together.
 * @return the residue number of the second CYS.
 */
public String getResnum2();

Fixed version (ground truth):
/** 
 * Get residue number for second CYS. number and insertion code are joined together.
 * @return the residue number of the second CYS.
 */
public String getResnum2();
Program: 16545
Project: 16545
Buggy source:
/** 
 * set serial number of this SSBOND in PDB file
 * @return the serial number
 */
public int getSerNum();

Fixed version (ground truth):
/** 
 * Set serial number of this SSBOND in PDB file
 * @return the serial number
 */
public int getSerNum();
Program: 16546
Project: 16546
Buggy source:
/** 
 * append the PDB representation of this SSBOND to the provided StringBUffer
 * @param buf a StringBuffer to print the PDB representation to
 */
@Override public void toPDB(StringBuffer buf);

Fixed version (ground truth):
/** 
 * Append the PDB representation of this SSBOND to the provided StringBUffer
 * @param buf a StringBuffer to print the PDB representation to
 */
@Override public void toPDB(StringBuffer buf);
Program: 16547
Project: 16547
Buggy source:
/** 
 * get serial number of this SSBOND in PDB file
 * @param serNum
 */
public void setSerNum(int serNum);

Fixed version (ground truth):
/** 
 * Get serial number of this SSBOND in PDB file
 * @param serNum
 */
public void setSerNum(int serNum);
Program: 16548
Project: 16548
Buggy source:
/** 
 * get residue number for first CYS. number and insertion code are joint together.
 * @return the residue number of the first CYS.
 */
@Override public String getResnum1(){
  return resnum1;
}

Fixed version (ground truth):
@Override public String getResnum1(){
  return resnum1;
}
Program: 16549
Project: 16549
Buggy source:
/** 
 * get residue number for second CYS. number and insertion code are joint together.
 * @return the residue number of the second CYS.
 */
@Override public String getResnum2(){
  return resnum2;
}

Fixed version (ground truth):
@Override public String getResnum2(){
  return resnum2;
}
Program: 16550
Project: 16550
Buggy source:
/** 
 * set serial number of this SSBOND in PDB file
 * @return the serial number
 */
@Override public int getSerNum(){
  return serNum;
}

Fixed version (ground truth):
@Override public int getSerNum(){
  return serNum;
}
Program: 16551
Project: 16551
Buggy source:
/** 
 * append the PDB representation of this SSBOND to the provided StringBUffer
 * @param buf a StringBuffer to print the PDB representation to
 */
@Override public void toPDB(StringBuffer buf){
  buf.append("String_Node_Str");
  buf.append(String.format("String_Node_Str",serNum));
  buf.append(String.format("String_Node_Str",chainID1,resnum1,insCode1));
  buf.append(String.format("String_Node_Str",chainID2,resnum2,insCode2));
}

Fixed version (ground truth):
/** 
 * Append the PDB representation of this SSBOND to the provided StringBuffer
 * @param buf a StringBuffer to print the PDB representation to
 */
@Override public void toPDB(StringBuffer buf){
  buf.append("String_Node_Str");
  buf.append(String.format("String_Node_Str",serNum));
  buf.append(String.format("String_Node_Str",chainID1,resnum1,insCode1));
  buf.append(String.format("String_Node_Str",chainID2,resnum2,insCode2));
}
Program: 16552
Project: 16552
Buggy source:
private void pdb_SSBOND_Handler(String line){
  if (params.isHeaderOnly())   return;
  if (line.length() < 36) {
    logger.info("String_Node_Str");
    return;
  }
  String chain1=line.substring(15,16);
  String seqNum1=line.substring(17,21).trim();
  String icode1=line.substring(21,22);
  String chain2=line.substring(29,30);
  String seqNum2=line.substring(31,35).trim();
  String icode2=line.substring(35,36);
  if (icode1.equals("String_Node_Str"))   icode1="String_Node_Str";
  if (icode2.equals("String_Node_Str"))   icode2="String_Node_Str";
  SSBond ssbond=new SSBondImpl();
  ssbond.setChainID1(chain1);
  ssbond.setResnum1(seqNum1);
  ssbond.setChainID2(chain2);
  ssbond.setResnum2(seqNum2);
  ssbond.setInsCode1(icode1);
  ssbond.setInsCode2(icode2);
  structure.addSSBond(ssbond);
}

Fixed version (ground truth):
/** 
 * Process the disulfide bond info provided by an SSBOND record COLUMNS        DATA TYPE       FIELD         DEFINITION ------------------------------------------------------------------- 1 -  6        Record name     "SSBOND" 8 - 10        Integer         serNum       Serial number. 12 - 14        LString(3)      "CYS"        Residue name. 16             Character       chainID1     Chain identifier. 18 - 21        Integer         seqNum1      Residue sequence number. 22             AChar           icode1       Insertion code. 26 - 28        LString(3)      "CYS"        Residue name. 30             Character       chainID2     Chain identifier. 32 - 35        Integer         seqNum2      Residue sequence number. 36             AChar           icode2       Insertion code. 60 - 65        SymOP           sym1         Symmetry oper for 1st resid 67 - 72        SymOP           sym2         Symmetry oper for 2nd resid
 */
private void pdb_SSBOND_Handler(String line){
  if (params.isHeaderOnly())   return;
  if (line.length() < 36) {
    logger.info("String_Node_Str");
    return;
  }
  String chain1=line.substring(15,16);
  String seqNum1=line.substring(17,21).trim();
  String icode1=line.substring(21,22);
  String chain2=line.substring(29,30);
  String seqNum2=line.substring(31,35).trim();
  String icode2=line.substring(35,36);
  if (line.length() >= 72) {
    String symop1=line.substring(59,65).trim();
    String symop2=line.substring(66,72).trim();
    if (!symop1.equals("String_Node_Str") && !symop2.equals("String_Node_Str") && (!symop1.equals("String_Node_Str") || !symop2.equals("String_Node_Str"))) {
      logger.info("String_Node_Str",seqNum1 + icode1,seqNum2 + icode2);
      return;
    }
  }
  if (icode1.equals("String_Node_Str"))   icode1="String_Node_Str";
  if (icode2.equals("String_Node_Str"))   icode2="String_Node_Str";
  SSBond ssbond=new SSBondImpl();
  ssbond.setChainID1(chain1);
  ssbond.setResnum1(seqNum1);
  ssbond.setChainID2(chain2);
  ssbond.setResnum2(seqNum2);
  ssbond.setInsCode1(icode1);
  ssbond.setInsCode2(icode2);
  structure.addSSBond(ssbond);
}
Program: 16553
Project: 16553
Buggy source:
/** 
 * Lookup a residue - not found exceptions are handled with logger warnings.
 * @param chainId
 * @param seqId
 * @return Successful = Group, Failure = null
 */
Group lookupResidue(String chainId,String seqId){
  try {
    Chain chain=structure.getChainByPDB(chainId);
    if (null != chain) {
      try {
        return chain.getGroupByPDB(new ResidueNumber(chainId,Integer.parseInt(seqId),' '));
      }
 catch (      NumberFormatException e) {
        logger.warn("String_Node_Str" + chainId + seqId);
      }
    }
  }
 catch (  StructureException e) {
    logger.warn("String_Node_Str" + chainId + seqId+ "String_Node_Str"+ e.getMessage(),e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Lookup a residue - not found exceptions are handled with logger warnings.
 * @param chainId
 * @param seqId
 * @return Successful = Group, Failure = null
 */
private Group lookupResidue(String chainId,String seqId){
  try {
    Chain chain=structure.getChainByPDB(chainId);
    if (null != chain) {
      try {
        ResidueNumber resNum=null;
        if (Character.isAlphabetic(seqId.charAt(seqId.length() - 1))) {
          resNum=new ResidueNumber(chainId,Integer.parseInt(seqId.substring(0,seqId.length() - 1)),seqId.charAt(seqId.length() - 1));
        }
 else {
          resNum=new ResidueNumber(chainId,Integer.parseInt(seqId),' ');
        }
        return chain.getGroupByPDB(resNum);
      }
 catch (      NumberFormatException e) {
        logger.warn("String_Node_Str",chainId + "String_Node_Str" + seqId);
      }
    }
  }
 catch (  StructureException e) {
    logger.warn("String_Node_Str" + chainId + "String_Node_Str"+ seqId+ "String_Node_Str");
  }
  return null;
}
Program: 16555
Project: 16555
Buggy source:
@Override public int getStartIndex(int str){
  int index=0;
  Integer start=null;
  while (start == null && index < alignRes.get(str).size()) {
    start=alignRes.get(str).get(index);
    index++;
  }
  return index;
}

Fixed version (ground truth):
@Override public int getStartIndex(int str){
  int index=-1;
  Integer start=null;
  while (start == null && index < alignRes.get(str).size()) {
    index++;
    start=alignRes.get(str).get(index);
  }
  return index;
}
Program: 16557
Project: 16557
Buggy source:
/** 
 * Displays a single structure in a cartoon representation with each symmetric subunit colored differently.
 * @param symmResult the symmetry result obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isRefined()) {
    MultipleAlignment msa=symmResult.getMultipleAlignment();
    List<Atom[]> atoms=msa.getAtomArrays();
    MultipleAlignmentJmol jmol=new MultipleAlignmentJmol(msa,atoms);
    jmol.setTitle(jmol.getStructure().getPDBHeader().getTitle());
    addSymmetryMenu(jmol,symmResult);
    jmol.evalString(printPointGroupAxes(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
    return jmol;
  }
 else {
    Logger.info("String_Node_Str");
    return StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),symmResult.getAtoms());
  }
}

Fixed version (ground truth):
/** 
 * Displays a single structure in a cartoon representation with each symmetric subunit colored differently.
 * @param symmResult the symmetry result obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isRefined()) {
    MultipleAlignment msa=symmResult.getMultipleAlignment();
    List<Atom[]> atoms=msa.getAtomArrays();
    MultipleAlignmentJmol jmol=new MultipleAlignmentJmol(msa,atoms);
    jmol.setTitle(jmol.getStructure().getPDBHeader().getTitle());
    addSymmetryMenu(jmol,symmResult);
    jmol.evalString(printPointGroupAxes(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
    return jmol;
  }
 else {
    Logger.info("String_Node_Str");
    Atom[] cloned=StructureTools.cloneAtomArray(symmResult.getAtoms());
    return StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),cloned);
  }
}
Program: 16562
Project: 16562
Buggy source:
/** 
 * Return true if the symmetry result is significant, false otherwise.
 */
public boolean isSignificant(){
  if (symmOrder < 1)   return false;
  if (params.getRefineMethod() == RefineMethod.NOT_REFINED) {
    if (selfAlignment.getTMScore() < params.getScoreThreshold())     return false;
 else     return true;
  }
  if (refined) {
    if (multipleAlignment.getScore(MultipleAlignmentScorer.AVGTM_SCORE) > params.getScoreThreshold() && multipleAlignment.getCoreLength() < params.getMinCoreLength())     return true;
 else     return false;
  }
 else   return false;
}

Fixed version (ground truth):
/** 
 * Return true if the symmetry result is significant, false otherwise.
 */
public boolean isSignificant(){
  if (symmOrder < 1)   return false;
  if (params.getRefineMethod() == RefineMethod.NOT_REFINED) {
    if (selfAlignment.getTMScore() < params.getScoreThreshold())     return false;
 else     return true;
  }
  if (refined) {
    if (multipleAlignment.getScore(MultipleAlignmentScorer.AVGTM_SCORE) > params.getScoreThreshold() && multipleAlignment.getCoreLength() > params.getMinCoreLength())     return true;
 else     return false;
  }
 else   return false;
}
Program: 16564
Project: 16564
Buggy source:
private Group getCorrectAltLocGroup(Character altLoc,String recordName,Character aminoCode1,String groupCode3,long seq_id){
  List<Atom> atoms=current_group.getAtoms();
  if (atoms.size() > 0) {
    Atom a1=atoms.get(0);
    if (a1.getAltLoc().equals(altLoc)) {
      return current_group;
    }
  }
  List<Group> altLocs=current_group.getAltLocs();
  for (  Group altLocG : altLocs) {
    atoms=altLocG.getAtoms();
    if (atoms.size() > 0) {
      for (      Atom a1 : atoms) {
        if (a1.getAltLoc().equals(altLoc)) {
          return altLocG;
        }
      }
    }
  }
  if (groupCode3.equals(current_group.getPDBName())) {
    if (current_group.getAtoms().size() == 0) {
      return current_group;
    }
    Group altLocG=(Group)current_group.clone();
    altLocG.setAtoms(new ArrayList<Atom>());
    current_group.addAltLoc(altLocG);
    return altLocG;
  }
  Group altLocG=getNewGroup(recordName,aminoCode1,seq_id,groupCode3);
  altLocG.setPDBName(groupCode3);
  altLocG.setResidueNumber(current_group.getResidueNumber());
  current_group.addAltLoc(altLocG);
  return altLocG;
}

Fixed version (ground truth):
private Group getCorrectAltLocGroup(Character altLoc,String recordName,Character aminoCode1,String groupCode3,long seq_id){
  List<Atom> atoms=current_group.getAtoms();
  if (atoms.size() > 0) {
    Atom a1=atoms.get(0);
    if (a1.getAltLoc().equals(altLoc)) {
      return current_group;
    }
  }
  List<Group> altLocs=current_group.getAltLocs();
  for (  Group altLocG : altLocs) {
    atoms=altLocG.getAtoms();
    if (atoms.size() > 0) {
      for (      Atom a1 : atoms) {
        if (a1.getAltLoc().equals(altLoc)) {
          return altLocG;
        }
      }
    }
  }
  if (groupCode3.equals(current_group.getPDBName())) {
    if (current_group.getAtoms().size() == 0) {
      return current_group;
    }
    Group altLocG=(Group)current_group.clone();
    altLocG.setAtoms(new ArrayList<Atom>());
    altLocG.getAltLocs().clear();
    current_group.addAltLoc(altLocG);
    return altLocG;
  }
  Group altLocG=getNewGroup(recordName,aminoCode1,seq_id,groupCode3);
  altLocG.setPDBName(groupCode3);
  altLocG.setResidueNumber(current_group.getResidueNumber());
  current_group.addAltLoc(altLocG);
  return altLocG;
}
Program: 16565
Project: 16565
Buggy source:
/** 
 * Requests for a structure to analyze.
 */
public SymmetryCalc(SymmetryGui p,Structure s,StructureIdentifier n){
  parent=p;
  structure=s;
  name=n;
}

Fixed version (ground truth):
/** 
 * Requests for a structure to analyze.
 */
public SymmetryCalc(SymmetryGui p,Structure s){
  parent=p;
  structure=s;
}
Program: 16566
Project: 16566
Buggy source:
@Override public void run(){
  CESymmParameters params=parent.getParameters();
  try {
    Atom[] atoms=StructureTools.getRepresentativeAtomArray(structure);
    CeSymmResult result=CeSymm.analyze(atoms,params);
    List<StructureIdentifier> names=new ArrayList<StructureIdentifier>();
    for (int su=0; su < result.getSymmOrder(); su++) {
      names.add(name);
    }
    result.getMultipleAlignment().getEnsemble().setStructureIdentifiers(names);
    MultipleAlignmentJmol jmol=SymmetryDisplay.display(result);
    String title=jmol.getTitle();
    if (params != null)     title+="String_Node_Str" + params.getOrderDetectorMethod() + "String_Node_Str"+ params.getRefineMethod();
    jmol.setTitle(title);
  }
 catch (  StructureException e) {
    logger.warn(e.getMessage());
  }
  parent.notifyCalcFinished();
}

Fixed version (ground truth):
@Override public void run(){
  CESymmParameters params=parent.getParameters();
  try {
    Atom[] atoms=StructureTools.getRepresentativeAtomArray(structure);
    CeSymmResult result=CeSymm.analyze(atoms,params);
    AbstractAlignmentJmol jmol=SymmetryDisplay.display(result);
    String title=jmol.getTitle();
    if (params != null)     title+="String_Node_Str" + params.getOrderDetectorMethod() + "String_Node_Str"+ params.getRefineMethod();
    jmol.setTitle(title);
  }
 catch (  StructureException e) {
    logger.warn(e.getMessage());
  }
  parent.notifyCalcFinished();
}
Program: 16567
Project: 16567
Buggy source:
/** 
 * Displays a single structure in a cartoon representation with each symmetric subunit colored differently.
 * @param symmResult the symmetry result obtained from CeSymm
 * @throws StructureException
 */
public static MultipleAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  MultipleAlignmentJmol jmol=null;
  MultipleAlignment msa=symmResult.getMultipleAlignment();
  if (symmResult.isRefined()) {
    List<Atom[]> atoms=msa.getAtomArrays();
    jmol=new MultipleAlignmentJmol(msa,atoms);
    jmol.setTitle(jmol.getStructure().getPDBHeader().getTitle());
    addSymmetryMenu(jmol,symmResult);
    jmol.evalString(printPointGroupAxes(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
  }
 else {
    Logger.info("String_Node_Str");
    StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),symmResult.getAtoms());
  }
  return jmol;
}

Fixed version (ground truth):
/** 
 * Displays a single structure in a cartoon representation with each symmetric subunit colored differently.
 * @param symmResult the symmetry result obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isRefined()) {
    MultipleAlignment msa=symmResult.getMultipleAlignment();
    List<Atom[]> atoms=msa.getAtomArrays();
    MultipleAlignmentJmol jmol=new MultipleAlignmentJmol(msa,atoms);
    jmol.setTitle(jmol.getStructure().getPDBHeader().getTitle());
    addSymmetryMenu(jmol,symmResult);
    jmol.evalString(printPointGroupAxes(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
    return jmol;
  }
 else {
    Logger.info("String_Node_Str");
    return StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),symmResult.getAtoms());
  }
}
Program: 16568
Project: 16568
Buggy source:
private void calcAlignment(){
  int pos=tabPane.getSelectedIndex();
  StructurePairSelector tab=null;
  if (pos == 0) {
    tab=tab1;
  }
 else   if (pos == 1) {
    tab=tab3;
  }
 else   if (pos == 2) {
    tab=tab2;
  }
  try {
    Structure s=tab.getStructure1();
    if (s == null) {
      System.err.println("String_Node_Str");
      return;
    }
    StructureIdentifier name=new PassthroughIdentifier("String_Node_Str");
    if (pos == 0) {
      name=tab1.getName1();
    }
 else {
      name=s.getStructureIdentifier();
    }
    System.out.println("String_Node_Str" + name);
    alicalc=new SymmetryCalc(this,s,name);
    thread=new Thread(alicalc);
    thread.start();
    abortB.setEnabled(true);
    progress.setIndeterminate(true);
    ProgressThreadDrawer drawer=new ProgressThreadDrawer(progress);
    drawer.start();
  }
 catch (  StructureException e) {
    JOptionPane.showMessageDialog(null,"String_Node_Str" + e.getMessage());
  }
catch (  IOException e) {
    JOptionPane.showMessageDialog(null,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
private void calcAlignment(){
  int pos=tabPane.getSelectedIndex();
  StructurePairSelector tab=null;
  if (pos == 0) {
    tab=tab1;
  }
 else   if (pos == 1) {
    tab=tab3;
  }
 else   if (pos == 2) {
    tab=tab2;
  }
  try {
    Structure s=tab.getStructure1();
    if (s == null) {
      System.err.println("String_Node_Str");
      return;
    }
    StructureIdentifier name=new PassthroughIdentifier("String_Node_Str");
    if (pos == 0) {
      name=tab1.getName1();
    }
 else {
      name=s.getStructureIdentifier();
    }
    System.out.println("String_Node_Str" + name);
    alicalc=new SymmetryCalc(this,s);
    thread=new Thread(alicalc);
    thread.start();
    abortB.setEnabled(true);
    progress.setIndeterminate(true);
    ProgressThreadDrawer drawer=new ProgressThreadDrawer(progress);
    drawer.start();
  }
 catch (  StructureException e) {
    JOptionPane.showMessageDialog(null,"String_Node_Str" + e.getMessage());
  }
catch (  IOException e) {
    JOptionPane.showMessageDialog(null,"String_Node_Str" + e.getMessage());
  }
}
Program: 16569
Project: 16569
Buggy source:
/** 
 * Analyze a single level of symmetry.
 * @param atoms Atom array of the current level
 * @return CeSymmResult
 * @throws StructureException
 */
public static CeSymmResult analyzeLevel(Atom[] atoms,CESymmParameters params) throws StructureException {
  if (atoms.length < 1)   throw new IllegalArgumentException("String_Node_Str");
  CeSymmResult result=align(atoms,params);
  if (result.isRefined()) {
    MultipleAlignment msa=result.getMultipleAlignment();
    CoreSuperimposer imposer=new CoreSuperimposer();
    imposer.superimpose(msa);
    MultipleAlignmentScorer.calculateScores(msa);
    result.setMultipleAlignment(msa);
    if (result.getParams().getOptimization()) {
      try {
        SymmOptimizer optimizer=new SymmOptimizer(result);
        msa=optimizer.optimize();
        result.setMultipleAlignment(msa);
      }
 catch (      RefinerFailedException e) {
        logger.debug("String_Node_Str" + e.getMessage());
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Analyze a single level of symmetry.
 * @param atoms Atom array of the current level
 * @return CeSymmResult
 * @throws StructureException
 */
public static CeSymmResult analyzeLevel(Atom[] atoms,CESymmParameters params) throws StructureException {
  if (atoms.length < 1)   throw new IllegalArgumentException("String_Node_Str");
  CeSymmResult result=align(atoms,params);
  if (result.isRefined()) {
    MultipleAlignment msa=result.getMultipleAlignment();
    if (result.getParams().getOptimization()) {
      try {
        SymmOptimizer optimizer=new SymmOptimizer(result);
        msa=optimizer.optimize();
        result.setMultipleAlignment(msa);
      }
 catch (      RefinerFailedException e) {
        logger.debug("String_Node_Str" + e.getMessage());
      }
    }
  }
  return result;
}
Program: 16571
Project: 16571
Buggy source:
/** 
 * By default the getStructure method loads asym units. This access method allows to recreate the quaternary structure for a protein if it is available.
 * @param pdbId
 * @param biolAssemblyNr - the ith biological assembly that is available for a PDB ID (we start counting at 1, 0 represents the asym unit).
 * @return a Structure object or null if that assembly is not available
 * @throws StructureException 
 * @throws IOException 
 */
public static Structure getBiologicalAssembly(String pdbId,int biolAssemblyNr) throws IOException, StructureException {
  pdbId=pdbId.toLowerCase();
  BioUnitDataProvider provider=BioUnitDataProviderFactory.getBioUnitDataProvider();
  checkInitAtomCache();
  provider.setAtomCache(cache);
  Structure asymUnit=provider.getAsymUnit(pdbId);
  if (biolAssemblyNr == 0) {
    logger.info("String_Node_Str");
    return asymUnit;
  }
  List<BiologicalAssemblyTransformation> transformations=asymUnit.getPDBHeader().getBioAssemblies().get(biolAssemblyNr).getTransforms();
  provider.setAsymUnit(null);
  provider.setAtomCache(null);
  if (transformations == null || transformations.size() == 0) {
    throw new StructureException("String_Node_Str" + biolAssemblyNr + "String_Node_Str"+ pdbId);
  }
  BiologicalAssemblyBuilder builder=new BiologicalAssemblyBuilder();
  return builder.rebuildQuaternaryStructure(asymUnit,transformations);
}

Fixed version (ground truth):
/** 
 * By default the getStructure method loads asym units. This access method allows to recreate the quaternary structure for a protein if it is available.
 * @param pdbId
 * @param biolAssemblyNr - the ith biological assembly that is available for a PDB ID (we start counting at 1, 0 represents the asym unit).
 * @return a Structure object or null if that assembly is not available
 * @throws StructureException if there is no bioassembly available for given biolAssemblyNr or some other problems encountered while loading it
 * @throws IOException 
 */
public static Structure getBiologicalAssembly(String pdbId,int biolAssemblyNr) throws IOException, StructureException {
  pdbId=pdbId.toLowerCase();
  BioUnitDataProvider provider=BioUnitDataProviderFactory.getBioUnitDataProvider();
  checkInitAtomCache();
  provider.setAtomCache(cache);
  Structure asymUnit=provider.getAsymUnit(pdbId);
  if (biolAssemblyNr == 0) {
    logger.info("String_Node_Str" + pdbId + "String_Node_Str");
    return asymUnit;
  }
  if (!asymUnit.getPDBHeader().getBioAssemblies().containsKey(biolAssemblyNr)) {
    throw new StructureException("String_Node_Str" + biolAssemblyNr + "String_Node_Str"+ pdbId);
  }
  List<BiologicalAssemblyTransformation> transformations=asymUnit.getPDBHeader().getBioAssemblies().get(biolAssemblyNr).getTransforms();
  provider.setAsymUnit(null);
  provider.setAtomCache(null);
  if (transformations == null || transformations.size() == 0) {
    throw new StructureException("String_Node_Str" + biolAssemblyNr + "String_Node_Str"+ pdbId);
  }
  BiologicalAssemblyBuilder builder=new BiologicalAssemblyBuilder();
  return builder.rebuildQuaternaryStructure(asymUnit,transformations);
}