nus-yam/ex-repair huggingface dataset:
Program: 16477
Project: 16477
Buggy source:
/** 
 * Instantiates a new bio java structure decoder.
 */
public MmtfStructureReader(){
  structure=new StructureImpl();
  modelNumber=0;
  chemicalComponentGroup=new ChemComp();
  allAtoms=new ArrayList<>();
  entityInfoList=new ArrayList<>();
  chainList=new ArrayList<>();
}

Fixed version (ground truth):
/** 
 * Instantiates a new bio java structure decoder.
 */
public MmtfStructureReader(){
  structure=new StructureImpl();
  modelNumber=0;
  allAtoms=new ArrayList<>();
  entityInfoList=new ArrayList<>();
  chainList=new ArrayList<>();
}
Program: 16478
Project: 16478
Buggy source:
@Override public void setEntityInfo(int[] chainIndices,String sequence,String description,String title){
  EntityInfo entityInfo=new EntityInfo();
  entityInfo.setDescription(description);
  entityInfo.setTitle(title);
  List<Chain> chains=new ArrayList<>();
  for (  int index : chainIndices) {
    chains.add(chainList.get(index));
  }
  entityInfo.setChains(chains);
  entityInfoList.add(entityInfo);
}

Fixed version (ground truth):
@Override public void setEntityInfo(int[] chainIndices,String sequence,String description,String type){
  EntityInfo entityInfo=new EntityInfo();
  entityInfo.setDescription(description);
  entityInfo.setType(EntityType.entityTypeFromString(type));
  List<Chain> chains=new ArrayList<>();
  for (  int index : chainIndices) {
    chains.add(chainList.get(index));
  }
  entityInfo.setChains(chains);
  entityInfoList.add(entityInfo);
}
Program: 16479
Project: 16479
Buggy source:
@Override public void setGroupInfo(String groupName,int groupNumber,char insertionCode,String chemCompType,int atomCount,int bondCount,char singleLetterCode,int sequenceIndexId,int secStructType){
  int polymerType=getGroupTypIndicator(chemCompType);
switch (polymerType) {
case 1:
    AminoAcid aa=new AminoAcidImpl();
  aa.setAminoType(StructureTools.get1LetterCodeAmino(groupName));
group=aa;
break;
case 2:
group=new NucleotideImpl();
break;
default :
group=new HetatomImpl();
}
atomsInGroup=new ArrayList<Atom>();
group.setChemComp(chemicalComponentGroup);
group.setPDBName(groupName);
if (insertionCode == MmtfBean.UNAVAILABLE_CHAR_VALUE) {
group.setResidueNumber(chain.getChainID().trim(),groupNumber,null);
}
 else {
group.setResidueNumber(chain.getChainID().trim(),groupNumber,insertionCode);
}
group.setAtoms(new ArrayList<Atom>(atomCount));
if (polymerType != 0) {
chain.getSeqResGroups().add(group);
}
if (atomCount > 0) {
chain.addGroup(group);
}
MmtfUtils.setSecStructType(group,secStructType);
}

Fixed version (ground truth):
@Override public void setGroupInfo(String groupName,int groupNumber,char insertionCode,String chemCompType,int atomCount,int bondCount,char singleLetterCode,int sequenceIndexId,int secStructType){
  int polymerType=getGroupTypIndicator(chemCompType);
switch (polymerType) {
case 1:
    AminoAcid aa=new AminoAcidImpl();
  aa.setAminoType(StructureTools.get1LetterCodeAmino(groupName));
group=aa;
break;
case 2:
group=new NucleotideImpl();
break;
default :
group=new HetatomImpl();
}
atomsInGroup=new ArrayList<Atom>();
ChemComp chemComp=new ChemComp();
if (singleLetterCode == 'X') {
chemComp.setOne_letter_code("String_Node_Str");
}
 else {
chemComp.setOne_letter_code("String_Node_Str" + singleLetterCode);
}
group.setChemComp(chemComp);
group.setPDBName(groupName);
if (insertionCode == MmtfBean.UNAVAILABLE_CHAR_VALUE) {
group.setResidueNumber(chain.getChainID().trim(),groupNumber,null);
}
 else {
group.setResidueNumber(chain.getChainID().trim(),groupNumber,insertionCode);
}
group.setAtoms(new ArrayList<Atom>(atomCount));
if (polymerType != 0) {
chain.getSeqResGroups().add(group);
}
if (atomCount > 0) {
chain.addGroup(group);
}
MmtfUtils.setSecStructType(group,secStructType);
}
Program: 16481
Project: 16481
Buggy source:
/** 
 * Add the bonds for a given atom.
 * @param atom the atom for which bonds are to be formed
 * @param atomsInGroup the list of atoms in the group
 * @param allAtoms the list of atoms in the whole structure
 */
private void addBonds(Atom atom,List<Atom> atomsInGroup,List<Atom> allAtoms){
  if (atom.getBonds() == null) {
    return;
  }
  for (  Bond bond : atom.getBonds()) {
    Atom other=bond.getOther(atom);
    if (atomsInGroup.indexOf(other) != -1) {
      Integer firstBondIndex=atomsInGroup.indexOf(atom);
      Integer secondBondIndex=atomsInGroup.indexOf(other);
      if (firstBondIndex < secondBondIndex) {
        int bondOrder=bond.getBondOrder();
        mmtfDecoderInterface.setGroupBond(firstBondIndex,secondBondIndex,bondOrder);
      }
    }
 else {
      Integer firstBondIndex=allAtoms.indexOf(atom);
      Integer secondBondIndex=allAtoms.indexOf(other);
      if (firstBondIndex < secondBondIndex) {
        int bondOrder=bond.getBondOrder();
        mmtfDecoderInterface.setInterGroupBond(firstBondIndex,secondBondIndex,bondOrder);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Add the bonds for a given atom.
 * @param atom the atom for which bonds are to be formed
 * @param atomsInGroup the list of atoms in the group
 * @param allAtoms the list of atoms in the whole structure
 */
private void addBonds(Atom atom,List<Atom> atomsInGroup,List<Atom> allAtoms){
  if (atom.getBonds() == null) {
    return;
  }
  for (  Bond bond : atom.getBonds()) {
    Atom other=bond.getOther(atom);
    if (atomsInGroup.indexOf(other) != -1) {
      Integer firstBondIndex=atomsInGroup.indexOf(atom);
      Integer secondBondIndex=atomsInGroup.indexOf(other);
      if (firstBondIndex > secondBondIndex) {
        int bondOrder=bond.getBondOrder();
        mmtfDecoderInterface.setGroupBond(firstBondIndex,secondBondIndex,bondOrder);
      }
    }
 else {
      Integer firstBondIndex=allAtoms.indexOf(atom);
      Integer secondBondIndex=allAtoms.indexOf(other);
      if (firstBondIndex < secondBondIndex) {
        int bondOrder=bond.getBondOrder();
        mmtfDecoderInterface.setInterGroupBond(firstBondIndex,secondBondIndex,bondOrder);
      }
    }
  }
}
Program: 16483
Project: 16483
Buggy source:
/** 
 * Generate pas the bioassembly information on in the desired form.
 * @param bioJavaStruct the Biojava structure
 * @param header the header
 */
private void storeBioassemblyInformation(Map<String,Integer> chainIdToIndexMap,Map<Integer,BioAssemblyInfo> inputBioAss){
  int bioAssemblyIndex=0;
  for (  Entry<Integer,BioAssemblyInfo> entry : inputBioAss.entrySet()) {
    Map<double[],int[]> transformMap=MmtfUtils.getTransformMap(entry.getValue(),chainIdToIndexMap);
    for (    Entry<double[],int[]> transformEntry : transformMap.entrySet()) {
      mmtfDecoderInterface.setBioAssemblyTrans(bioAssemblyIndex,transformEntry.getValue(),transformEntry.getKey());
    }
  }
}

Fixed version (ground truth):
/** 
 * Generate the bioassembly information on in the desired form.
 * @param bioJavaStruct the Biojava structure
 * @param header the header
 */
private void storeBioassemblyInformation(Map<String,Integer> chainIdToIndexMap,Map<Integer,BioAssemblyInfo> inputBioAss){
  int bioAssemblyIndex=0;
  for (  Entry<Integer,BioAssemblyInfo> entry : inputBioAss.entrySet()) {
    Map<double[],int[]> transformMap=MmtfUtils.getTransformMap(entry.getValue(),chainIdToIndexMap);
    for (    Entry<double[],int[]> transformEntry : transformMap.entrySet()) {
      mmtfDecoderInterface.setBioAssemblyTrans(bioAssemblyIndex,transformEntry.getValue(),transformEntry.getKey());
    }
    bioAssemblyIndex+=1;
  }
}
Program: 16485
Project: 16485
Buggy source:
/** 
 * @param recordName : three-letter name
 * @return true if successful download
 */
private static boolean downloadChemCompRecord(String recordName){
  String localName=getLocalFileName(recordName);
  File newFile;
  try {
    newFile=File.createTempFile("String_Node_Str" + recordName,"String_Node_Str");
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",System.getProperty("String_Node_Str"));
    return false;
  }
  String u=SERVER_LOCATION + recordName + "String_Node_Str";
  logger.debug("String_Node_Str" + u);
  URL url=null;
  try {
    url=new URL(u);
    HttpURLConnection uconn=HTTPConnectionTools.openHttpURLConnection(url);
    try (PrintWriter pw=new PrintWriter(new GZIPOutputStream(new FileOutputStream(newFile)));BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(uconn.getInputStream()))){
      String line;
      while ((line=fileBuffer.readLine()) != null) {
        pw.println(line);
      }
      pw.flush();
      boolean couldRename=newFile.renameTo(new File(localName));
      if (!couldRename) {
        throw new IOException("String_Node_Str" + newFile.toString() + "String_Node_Str"+ localName);
      }
      return true;
    }
   }
 catch (  IOException e) {
    logger.error("String_Node_Str" + url.toString() + "String_Node_Str"+ localName+ "String_Node_Str"+ e.getMessage());
    newFile.delete();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param recordName : three-letter name
 * @return true if successful download
 */
private static boolean downloadChemCompRecord(String recordName){
  String localName=getLocalFileName(recordName);
  File newFile;
  try {
    newFile=File.createTempFile("String_Node_Str" + recordName,"String_Node_Str");
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",System.getProperty("String_Node_Str"));
    return false;
  }
  String u=SERVER_LOCATION + recordName + "String_Node_Str";
  logger.debug("String_Node_Str" + u);
  URL url=null;
  try {
    url=new URL(u);
    HttpURLConnection uconn=HTTPConnectionTools.openHttpURLConnection(url);
    try (PrintWriter pw=new PrintWriter(new GZIPOutputStream(new FileOutputStream(newFile)));BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(uconn.getInputStream()))){
      String line;
      while ((line=fileBuffer.readLine()) != null) {
        pw.println(line);
      }
      pw.flush();
    }
     Files.move(newFile.toPath(),Paths.get(localName),StandardCopyOption.REPLACE_EXISTING);
    return true;
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + url.toString() + "String_Node_Str"+ localName+ "String_Node_Str"+ e.getMessage());
    newFile.delete();
  }
  return false;
}
Program: 16487
Project: 16487
Buggy source:
/** 
 * Set all the member variables to null.
 */
public void destroy(){
  System.err.println("String_Node_Str");
  jmolPanel.removeMouseListener(this);
  jmolPanel.removeMouseMotionListener(this);
  jmolPanel.destroy();
}

Fixed version (ground truth):
/** 
 * Set all the member variables to null.
 */
public void destroy(){
  logger.debug("String_Node_Str");
  jmolPanel.removeMouseListener(this);
  jmolPanel.removeMouseMotionListener(this);
  jmolPanel.destroy();
}
Program: 16488
Project: 16488
Buggy source:
/** 
 * Set a new Structure to visualize in the AlignmentJmol window.
 * @param s
 */
public void setStructure(Structure s){
  if (jmolPanel == null) {
    System.err.println("String_Node_Str");
    return;
  }
  setTitle(s.getPDBCode());
  jmolPanel.setStructure(s);
  structure=s;
}

Fixed version (ground truth):
/** 
 * Set a new Structure to visualize in the AlignmentJmol window.
 * @param s
 */
public void setStructure(Structure s){
  if (jmolPanel == null) {
    logger.error("String_Node_Str");
    return;
  }
  setTitle(s.getPDBCode());
  jmolPanel.setStructure(s);
  structure=s;
}
Program: 16489
Project: 16489
Buggy source:
/** 
 * Execute a command String in the current Jmol panel.
 * @param rasmolScript
 */
public void evalString(String rasmolScript){
  if (jmolPanel == null) {
    System.err.println("String_Node_Str");
    return;
  }
  jmolPanel.evalString(rasmolScript);
}

Fixed version (ground truth):
/** 
 * Execute a command String in the current Jmol panel.
 * @param rasmolScript
 */
public void evalString(String rasmolScript){
  if (jmolPanel == null) {
    logger.error("String_Node_Str");
    return;
  }
  jmolPanel.evalString(rasmolScript);
}
Program: 16492
Project: 16492
Buggy source:
/** 
 * Displays a single structure in a cartoon representation with each symmetric repeat colored differently.
 * @param msa the symmetry multiple alignment obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isSignificant() && 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(printSymmetryGroup(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
    jmol.setTitle(getSymmTitle(symmResult));
    return jmol;
  }
 else {
    Logger.info("String_Node_Str");
    Atom[] cloned=StructureTools.cloneAtomArray(symmResult.getAtoms());
    AbstractAlignmentJmol jmol=StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),cloned);
    RotationAxis axis=new RotationAxis(symmResult.getSelfAlignment());
    jmol.evalString(axis.getJmolScript(symmResult.getAtoms()));
    return jmol;
  }
}

Fixed version (ground truth):
/** 
 * Displays a single structure in a cartoon representation with each symmetric repeat colored differently.
 * @param msa the symmetry multiple alignment obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isSignificant() && 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(printSymmetryGroup(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult));
    jmol.setTitle(getSymmTitle(symmResult));
    return jmol;
  }
 else {
    logger.info("String_Node_Str");
    Atom[] cloned=StructureTools.cloneAtomArray(symmResult.getAtoms());
    AbstractAlignmentJmol jmol=StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),cloned);
    RotationAxis axis=new RotationAxis(symmResult.getSelfAlignment());
    jmol.evalString(axis.getJmolScript(symmResult.getAtoms()));
    return jmol;
  }
}
Program: 16493
Project: 16493
Buggy source:
/** 
 * Generates a String that displays the symmetry axes of a structure.
 * @param msa
 * @param axes
 * @param elementary only print elementary axes if true
 * @return
 */
public static String printSymmetryAxes(CeSymmResult symm,boolean elementary){
  int id=0;
  String script="String_Node_Str";
  Atom[] atoms=symm.getAtoms();
  List<Matrix4d> symmAxes=null;
  if (elementary) {
    symmAxes=symm.getAxes().getElementaryAxes();
  }
 else {
    symmAxes=symm.getAxes().getSymmetryAxes();
  }
  for (  Matrix4d axis : symmAxes) {
    RotationAxis rot=new RotationAxis(axis);
    script+=rot.getJmolScript(atoms,id);
    id++;
  }
  return script;
}

Fixed version (ground truth):
/** 
 * Generates a String that displays the symmetry axes of a structure.
 * @param symm CeSymmResult
 * @return
 * @throws StructureException 
 */
public static String printSymmetryAxes(CeSymmResult symm) throws StructureException {
  int id=0;
  String script="String_Node_Str";
  SymmetryAxes axes=symm.getAxes();
  List<Atom[]> repeats=SymmetryTools.toRepeatsAlignment(symm).getAtomArrays();
  List<Matrix4d> symmAxes=axes.getElementaryAxes();
  for (int a=0; a < symmAxes.size(); a++) {
    RotationAxis rot=new RotationAxis(symmAxes.get(a));
    Set<Integer> repIndex=new TreeSet<Integer>(axes.getRepeatRelation(a).get(0));
    repIndex.addAll(axes.getRepeatRelation(a).get(1));
    List<Atom> repAtoms=new ArrayList<Atom>();
    for (    Integer r : repIndex)     repAtoms.addAll(Arrays.asList(repeats.get(r)));
    script+=rot.getJmolScript(repAtoms.toArray(new Atom[repAtoms.size()]),id);
    id++;
  }
  return script;
}
Program: 16494
Project: 16494
Buggy source:
@Override public void actionPerformed(ActionEvent ae){
  String cmd=ae.getActionCommand();
  if (cmd.equals("String_Node_Str"))   SymmetryGui.getInstance();
  if (symm == null)   logger.error("String_Node_Str");
  try {
    if (cmd.equals("String_Node_Str")) {
      MultipleAlignmentJmol j=SymmetryDisplay.displayRepeats(symm);
      String s=SymmetryDisplay.printSymmetryAxes(symm,true);
      j.evalString(s);
    }
 else     if (cmd.equals("String_Node_Str")) {
      MultipleAlignmentJmol j=SymmetryDisplay.displayFull(symm);
      String s=SymmetryDisplay.printSymmetryAxes(symm,false);
      j.evalString(s);
    }
 else     if (cmd.equals("String_Node_Str")) {
      Atom[] cloned=StructureTools.cloneAtomArray(symm.getAtoms());
      AbstractAlignmentJmol jmol=StructureAlignmentDisplay.display(symm.getSelfAlignment(),symm.getAtoms(),cloned);
      RotationAxis axis=new RotationAxis(symm.getSelfAlignment());
      jmol.evalString(axis.getJmolScript(symm.getAtoms()));
      jmol.setTitle(SymmetryDisplay.getSymmTitle(symm));
    }
 else     if (cmd.equals("String_Node_Str")) {
      String script=SymmetryDisplay.printSymmetryGroup(symm);
      jmol.evalString(script);
    }
 else     if (cmd.equals("String_Node_Str")) {
      String s=SymmetryDisplay.printSymmetryAxes(symm,false);
      jmol.evalString(s);
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent ae){
  String cmd=ae.getActionCommand();
  if (cmd.equals("String_Node_Str"))   SymmetryGui.getInstance();
  if (symm == null)   logger.error("String_Node_Str");
  try {
    if (cmd.equals("String_Node_Str")) {
      MultipleAlignmentJmol j=SymmetryDisplay.displayRepeats(symm);
      String s=SymmetryDisplay.printSymmetryAxes(symm);
      j.evalString(s);
    }
 else     if (cmd.equals("String_Node_Str")) {
      MultipleAlignmentJmol j=SymmetryDisplay.displayFull(symm);
      String s=SymmetryDisplay.printSymmetryAxes(symm);
      j.evalString(s);
    }
 else     if (cmd.equals("String_Node_Str")) {
      Atom[] cloned=StructureTools.cloneAtomArray(symm.getAtoms());
      AbstractAlignmentJmol jmol=StructureAlignmentDisplay.display(symm.getSelfAlignment(),symm.getAtoms(),cloned);
      RotationAxis axis=new RotationAxis(symm.getSelfAlignment());
      jmol.evalString(axis.getJmolScript(symm.getAtoms()));
      jmol.setTitle(SymmetryDisplay.getSymmTitle(symm));
    }
 else     if (cmd.equals("String_Node_Str")) {
      String script=SymmetryDisplay.printSymmetryGroup(symm);
      jmol.evalString(script);
    }
 else     if (cmd.equals("String_Node_Str")) {
      String s=SymmetryDisplay.printSymmetryAxes(symm);
      jmol.evalString(s);
    }
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
}
Program: 16495
Project: 16495
Buggy source:
@Override public void clear(){
  super.clear();
  coreLength=-1;
}

Fixed version (ground truth):
@Override public void clear(){
  super.clear();
  coreLength=-1;
  alignResCounts=null;
}
Program: 16496
Project: 16496
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static void showAlignmentImage(AFPChain afpChain,Atom[] ca1,Atom[] ca2,Object jmol) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  Class structureAlignmentJmol=Class.forName(strucAligJmol);
  Class c=Class.forName(displayAFP);
  Method show=c.getMethod("String_Node_Str",new Class[]{AFPChain.class,Atom[].class,Atom[].class,structureAlignmentJmol});
  show.invoke(null,afpChain,ca1,ca2,jmol);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static void showAlignmentImage(AFPChain afpChain,Atom[] ca1,Atom[] ca2,Object jmol) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  Class abstractAligJmolC=Class.forName(abstractAligJmol);
  Class c=Class.forName(displayAFP);
  Method show=c.getMethod("String_Node_Str",new Class[]{AFPChain.class,Atom[].class,Atom[].class,abstractAligJmolC});
  show.invoke(null,afpChain,ca1,ca2,jmol);
}
Program: 16497
Project: 16497
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static void showAlignmentImage(AFPChain afpChain,Atom[] ca1,Atom[] ca2,Object jmol) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  Class structureAlignmentJmol=Class.forName(strucAligJmol);
  Class c=Class.forName(displayAFP);
  Method show=c.getMethod("String_Node_Str",new Class[]{AFPChain.class,Atom[].class,Atom[].class,structureAlignmentJmol});
  show.invoke(null,afpChain,ca1,ca2,jmol);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public static void showAlignmentImage(AFPChain afpChain,Atom[] ca1,Atom[] ca2,Object jmol) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  Class abstractAligJmolC=Class.forName(abstractAligJmol);
  Class c=Class.forName(displayAFP);
  Method show=c.getMethod("String_Node_Str",new Class[]{AFPChain.class,Atom[].class,Atom[].class,abstractAligJmolC});
  show.invoke(null,afpChain,ca1,ca2,jmol);
}
Program: 16498
Project: 16498
Buggy source:
/** 
 * Displays a single structure in a cartoon representation with each symmetric repeat colored differently.
 * @param msa the symmetry multiple alignment obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isSignificant() && 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(printSymmetryGroup(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
    jmol.setTitle(getSymmTitle(symmResult));
    return jmol;
  }
 else {
    Logger.info("String_Node_Str");
    Atom[] cloned=StructureTools.cloneAtomArray(symmResult.getAtoms());
    AbstractAlignmentJmol jmol=StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),cloned);
    RotationAxis axis=new RotationAxis(symmResult.getSelfAlignment());
    jmol.evalString(axis.getJmolScript(symmResult.getAtoms()));
    jmol.setTitle(getSymmTitle(symmResult));
    return jmol;
  }
}

Fixed version (ground truth):
/** 
 * Displays a single structure in a cartoon representation with each symmetric repeat colored differently.
 * @param msa the symmetry multiple alignment obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isSignificant() && 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(printSymmetryGroup(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
    jmol.setTitle(getSymmTitle(symmResult));
    return jmol;
  }
 else {
    Logger.info("String_Node_Str");
    Atom[] cloned=StructureTools.cloneAtomArray(symmResult.getAtoms());
    AbstractAlignmentJmol jmol=StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),cloned);
    RotationAxis axis=new RotationAxis(symmResult.getSelfAlignment());
    jmol.evalString(axis.getJmolScript(symmResult.getAtoms()));
    return jmol;
  }
}
Program: 16499
Project: 16499
Buggy source:
/** 
 * Displays a single structure in a cartoon representation with each symmetric repeat colored differently.
 * @param msa the symmetry multiple alignment obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isSignificant() && 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(printSymmetryGroup(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
    jmol.setTitle(getSymmTitle(symmResult));
    return jmol;
  }
 else {
    Logger.info("String_Node_Str");
    Atom[] cloned=StructureTools.cloneAtomArray(symmResult.getAtoms());
    AbstractAlignmentJmol jmol=StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),cloned);
    RotationAxis axis=new RotationAxis(symmResult.getSelfAlignment());
    jmol.evalString(axis.getJmolScript(symmResult.getAtoms()));
    jmol.setTitle(getSymmTitle(symmResult));
    return jmol;
  }
}

Fixed version (ground truth):
/** 
 * Displays a single structure in a cartoon representation with each symmetric repeat colored differently.
 * @param msa the symmetry multiple alignment obtained from CeSymm
 * @throws StructureException
 */
public static AbstractAlignmentJmol display(CeSymmResult symmResult) throws StructureException {
  if (symmResult.isSignificant() && 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(printSymmetryGroup(symmResult));
    jmol.evalString(printSymmetryAxes(symmResult,false));
    jmol.setTitle(getSymmTitle(symmResult));
    return jmol;
  }
 else {
    Logger.info("String_Node_Str");
    Atom[] cloned=StructureTools.cloneAtomArray(symmResult.getAtoms());
    AbstractAlignmentJmol jmol=StructureAlignmentDisplay.display(symmResult.getSelfAlignment(),symmResult.getAtoms(),cloned);
    RotationAxis axis=new RotationAxis(symmResult.getSelfAlignment());
    jmol.evalString(axis.getJmolScript(symmResult.getAtoms()));
    return jmol;
  }
}
Program: 16500
Project: 16500
Buggy source:
private void formNucleotideBonds(){
  for (  Chain chain : structure.getChains()) {
    List<Group> groups=chain.getSeqResGroups();
    for (int i=0; i < groups.size() - 1; i++) {
      if (!(groups.get(i) instanceof NucleotideImpl) || !(groups.get(i + 1) instanceof NucleotideImpl))       continue;
      NucleotideImpl tail=(NucleotideImpl)groups.get(i);
      NucleotideImpl head=(NucleotideImpl)groups.get(i + 1);
      if (tail.getResidueNumber() == null || head.getResidueNumber() == null) {
        continue;
      }
      Atom phosphorous=tail.getP();
      Atom oThreePrime=head.getO3Prime();
      if (phosphorous == null || oThreePrime == null) {
        continue;
      }
      if (Calc.getDistance(phosphorous,oThreePrime) < MAX_NUCLEOTIDE_BOND_LENGTH) {
        new BondImpl(phosphorous,oThreePrime,1);
      }
    }
  }
}

Fixed version (ground truth):
private void formNucleotideBonds(){
  for (  Chain chain : structure.getChains()) {
    List<Group> groups=chain.getSeqResGroups();
    for (int i=0; i < groups.size() - 1; i++) {
      if (!(groups.get(i) instanceof NucleotideImpl) || !(groups.get(i + 1) instanceof NucleotideImpl))       continue;
      NucleotideImpl tail=(NucleotideImpl)groups.get(i);
      NucleotideImpl head=(NucleotideImpl)groups.get(i + 1);
      if (tail.getResidueNumber() == null || head.getResidueNumber() == null) {
        continue;
      }
      Atom phosphorous=head.getP();
      Atom oThreePrime=tail.getO3Prime();
      if (phosphorous == null || oThreePrime == null) {
        continue;
      }
      if (Calc.getDistance(phosphorous,oThreePrime) < MAX_NUCLEOTIDE_BOND_LENGTH) {
        new BondImpl(phosphorous,oThreePrime,1);
      }
    }
  }
}
Program: 16501
Project: 16501
Buggy source:
/** 
 * Provides an equivalent copy of Atoms in a new array. Clones everything, starting with parent groups and chains. The chain will only contain groups that are part of the input array.
 * @param ca array of representative atoms, e.g. CA atoms
 * @return Atom array
 * @since Biojava 4.1.0
 */
public static final Atom[] cloneAtomArray(Atom[] ca){
  Atom[] newCA=new Atom[ca.length];
  List<Chain> model=new ArrayList<Chain>();
  int apos=-1;
  for (  Atom a : ca) {
    apos++;
    Group parentG=a.getGroup();
    Chain parentC=parentG.getChain();
    Chain newChain=null;
    for (    Chain c : model) {
      if (c.getChainID().equals(parentC.getChainID())) {
        newChain=c;
        break;
      }
    }
    if (newChain == null) {
      newChain=new ChainImpl();
      newChain.setChainID(parentC.getChainID());
      model.add(newChain);
    }
    Group parentN=(Group)parentG.clone();
    newCA[apos]=parentN.getAtom(a.getName());
    newChain.addGroup(parentN);
  }
  return newCA;
}

Fixed version (ground truth):
/** 
 * Provides an equivalent copy of Atoms in a new array. Clones everything, starting with parent groups and chains. The chain will only contain groups that are part of the input array.
 * @param ca array of representative atoms, e.g. CA atoms
 * @return Atom array
 * @since Biojava 4.1.0
 */
public static final Atom[] cloneAtomArray(Atom[] ca){
  Atom[] newCA=new Atom[ca.length];
  List<Chain> model=new ArrayList<Chain>();
  int apos=-1;
  for (  Atom a : ca) {
    apos++;
    Group parentG=a.getGroup();
    Chain parentC=parentG.getChain();
    Chain newChain=null;
    for (    Chain c : model) {
      if (c.getChainID().equals(parentC.getChainID())) {
        newChain=c;
        break;
      }
    }
    if (newChain == null) {
      newChain=new ChainImpl();
      newChain.setChainID(parentC.getChainID());
      model.add(newChain);
    }
    Group parentN=(Group)parentG.clone();
    newCA[apos]=parentN.getAtom(a.getName());
    try {
      newChain.getGroupByPDB(parentN.getResidueNumber());
    }
 catch (    StructureException e) {
      newChain.addGroup(parentN);
    }
  }
  return newCA;
}
Program: 16502
Project: 16502
Buggy source:
private void formNucleotideBonds(){
  for (  Chain chain : structure.getChains()) {
    List<Group> groups=chain.getSeqResGroups();
    for (int i=0; i < groups.size() - 1; i++) {
      if (!(groups.get(i) instanceof NucleotideImpl) || !(groups.get(i + 1) instanceof NucleotideImpl))       continue;
      NucleotideImpl tail=(NucleotideImpl)groups.get(i);
      NucleotideImpl head=(NucleotideImpl)groups.get(i + 1);
      if (tail.getResidueNumber() == null || head.getResidueNumber() == null) {
        continue;
      }
      Atom phosphorous=tail.getP();
      Atom oThreePrime=head.getO3Prime();
      if (phosphorous == null || oThreePrime == null) {
        continue;
      }
      if (Calc.getDistance(phosphorous,oThreePrime) < MAX_NUCLEOTIDE_BOND_LENGTH) {
        new BondImpl(phosphorous,oThreePrime,1);
      }
    }
  }
}

Fixed version (ground truth):
private void formNucleotideBonds(){
  for (  Chain chain : structure.getChains()) {
    List<Group> groups=chain.getSeqResGroups();
    for (int i=0; i < groups.size() - 1; i++) {
      if (!(groups.get(i) instanceof NucleotideImpl) || !(groups.get(i + 1) instanceof NucleotideImpl))       continue;
      NucleotideImpl tail=(NucleotideImpl)groups.get(i);
      NucleotideImpl head=(NucleotideImpl)groups.get(i + 1);
      if (tail.getResidueNumber() == null || head.getResidueNumber() == null) {
        continue;
      }
      Atom phosphorous=head.getP();
      Atom oThreePrime=tail.getO3Prime();
      if (phosphorous == null || oThreePrime == null) {
        continue;
      }
      if (Calc.getDistance(phosphorous,oThreePrime) < MAX_NUCLEOTIDE_BOND_LENGTH) {
        new BondImpl(phosphorous,oThreePrime,1);
      }
    }
  }
}
Program: 16503
Project: 16503
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void addGroup(Group group){
  group.setChain(this);
  for (  Group g : group.getAltLocs()) {
    g.setChain(this);
  }
  groups.add(group);
  String pdbResnum=null;
  ResidueNumber resNum=group.getResidueNumber();
  if (resNum != null)   pdbResnum=resNum.toString();
  if (pdbResnum != null) {
    Integer pos=groups.size() - 1;
    if (pdbResnumMap.containsKey(pdbResnum)) {
      if (group instanceof AminoAcid)       pdbResnumMap.put(pdbResnum,pos);
    }
 else     pdbResnumMap.put(pdbResnum,pos);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void addGroup(Group group){
  group.setChain(this);
  for (  Group g : group.getAltLocs()) {
    g.setChain(this);
  }
  groups.add(group);
  String pdbResnum=null;
  ResidueNumber resNum=group.getResidueNumber();
  if (resNum != null)   pdbResnum=resNum.toString();
  if (pdbResnum != null) {
    Integer pos=groups.size() - 1;
    if (pdbResnumMap.containsKey(pdbResnum)) {
      logger.warn("String_Node_Str",pdbResnum,group.getPDBName(),getChainID(),groups.get(pdbResnumMap.get(pdbResnum)).getResidueNumber(),groups.get(pdbResnumMap.get(pdbResnum)).getPDBName());
      if (group instanceof AminoAcid)       pdbResnumMap.put(pdbResnum,pos);
    }
 else     pdbResnumMap.put(pdbResnum,pos);
  }
}
Program: 16507
Project: 16507
Buggy source:
@Test public void testShortLine() throws IOException, StructureException {
  String shortLine="String_Node_Str";
  InputStream is=new ByteArrayInputStream(shortLine.getBytes());
  PDBFileParser pdbPars=new PDBFileParser();
  Structure s;
  try {
    s=pdbPars.parsePDBFile(is);
  }
 catch (  Exception e) {
    is.close();
    throw new AssertionError("String_Node_Str");
  }
  is=new ByteArrayInputStream(String.format("String_Node_Str",shortLine).getBytes());
  Structure ref=pdbPars.parsePDBFile(is);
  is.close();
  assertEquals(ref.getDBRefs().get(0),s.getDBRefs().get(0));
}

Fixed version (ground truth):
@Test public void testShortLine() throws IOException, StructureException {
  Structure s, ref;
  PDBFileParser pdbPars=new PDBFileParser();
  String shortLine="String_Node_Str";
  try (InputStream is=new ByteArrayInputStream(shortLine.getBytes())){
    s=pdbPars.parsePDBFile(is);
  }
   String longline=String.format("String_Node_Str",shortLine);
  try (InputStream is=new ByteArrayInputStream(longline.getBytes())){
    ref=pdbPars.parsePDBFile(is);
  }
   assertEquals(ref.getDBRefs().get(0),s.getDBRefs().get(0));
}
Program: 16508
Project: 16508
Buggy source:
@Test public void testToPdbLength() throws IOException {
  String shortLine="String_Node_Str";
  InputStream is=new ByteArrayInputStream(shortLine.getBytes());
  PDBFileParser pdbPars=new PDBFileParser();
  Structure s;
  try {
    s=pdbPars.parsePDBFile(is);
  }
 catch (  Exception e) {
    is.close();
    throw new AssertionError("String_Node_Str");
  }
  assertEquals(shortLine,s.getDBRefs().get(0).toPDB().trim());
  assertEquals(80,s.getDBRefs().get(0).toPDB().length());
}

Fixed version (ground truth):
@Test public void testToPdbLength() throws IOException {
  Structure s;
  String shortLine="String_Node_Str";
  PDBFileParser pdbPars=new PDBFileParser();
  try (InputStream is=new ByteArrayInputStream(shortLine.getBytes())){
    s=pdbPars.parsePDBFile(is);
  }
   assertEquals(shortLine,s.getDBRefs().get(0).toPDB().trim());
  assertEquals(80,s.getDBRefs().get(0).toPDB().length());
}
Program: 16509
Project: 16509
Buggy source:
/** 
 * Factory method which constructs a pairwise sequence aligner.
 * @param < S > each {@link Sequence} of an alignment pair is of type S
 * @param < C > each element of an {@link AlignedSequence} is a {@link Compound} of type C
 * @param query the first {@link Sequence} to align
 * @param target the second {@link Sequence} to align
 * @param type chosen type from list of pairwise sequence alignment routines
 * @param gapPenalty the gap penalties used during alignment
 * @param subMatrix the set of substitution scores used during alignment
 * @return pairwise sequence aligner
 */
public static <S extends Sequence<C>,C extends Compound>PairwiseSequenceAligner<S,C> getPairwiseAligner(S query,S target,PairwiseSequenceAlignerType type,GapPenalty gapPenalty,SubstitutionMatrix<C> subMatrix){
  if (!query.getCompoundSet().equals(target.getCompoundSet())) {
    System.err.println(query.getCompoundSet().getClass().getName() + "String_Node_Str" + target.getCompoundSet().getClass().getName());
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (type) {
default :
case GLOBAL:
    return new NeedlemanWunsch<S,C>(query,target,gapPenalty,subMatrix);
case LOCAL:
  return new SmithWaterman<S,C>(query,target,gapPenalty,subMatrix);
case GLOBAL_LINEAR_SPACE:
case LOCAL_LINEAR_SPACE:
throw new UnsupportedOperationException(Alignments.class.getSimpleName() + "String_Node_Str" + type+ "String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * Factory method which constructs a pairwise sequence aligner.
 * @param < S > each {@link Sequence} of an alignment pair is of type S
 * @param < C > each element of an {@link AlignedSequence} is a {@link Compound} of type C
 * @param query the first {@link Sequence} to align
 * @param target the second {@link Sequence} to align
 * @param type chosen type from list of pairwise sequence alignment routines
 * @param gapPenalty the gap penalties used during alignment
 * @param subMatrix the set of substitution scores used during alignment
 * @return pairwise sequence aligner
 */
public static <S extends Sequence<C>,C extends Compound>PairwiseSequenceAligner<S,C> getPairwiseAligner(S query,S target,PairwiseSequenceAlignerType type,GapPenalty gapPenalty,SubstitutionMatrix<C> subMatrix){
  if (!query.getCompoundSet().equals(target.getCompoundSet())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
switch (type) {
default :
case GLOBAL:
    return new NeedlemanWunsch<S,C>(query,target,gapPenalty,subMatrix);
case LOCAL:
  return new SmithWaterman<S,C>(query,target,gapPenalty,subMatrix);
case GLOBAL_LINEAR_SPACE:
case LOCAL_LINEAR_SPACE:
throw new UnsupportedOperationException(Alignments.class.getSimpleName() + "String_Node_Str" + type+ "String_Node_Str");
}
}
Program: 16511
Project: 16511
Buggy source:
public void test11GS(){
  String pdbID="String_Node_Str";
  Structure s;
  try {
    AtomCache cache=new AtomCache();
    cache.getFileParsingParams().setAlignSeqRes(true);
    StructureIO.setAtomCache(cache);
    s=StructureIO.getStructure(pdbID);
    assertNotNull(s);
    assertTrue(s.getChains().size() > 0);
    Chain c=s.getChain(0);
    assertTrue(c.getSeqResGroups().size() > 2);
    Group first=c.getSeqResGroup(0);
    Group second=c.getSeqResGroup(1);
    Group third=c.getSeqResGroup(2);
    assertTrue(first instanceof AminoAcid);
    assertTrue(second instanceof AminoAcid);
    assertTrue(third instanceof AminoAcid);
    AminoAcid aafirst=(AminoAcid)first;
    AminoAcid aasecond=(AminoAcid)second;
    AminoAcid aathird=(AminoAcid)third;
    assertTrue(aafirst.getRecordType().equals(AminoAcid.SEQRESRECORD));
    assertTrue(aasecond.getRecordType().equals(AminoAcid.SEQRESRECORD));
    assertTrue(aathird.getRecordType().equals(AminoAcid.ATOMRECORD));
  }
 catch (  Exception e) {
    e.printStackTrace();
    fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void test11GS() throws IOException, StructureException {
  String pdbID="String_Node_Str";
  Structure s;
  AtomCache cache=new AtomCache();
  cache.getFileParsingParams().setAlignSeqRes(true);
  StructureIO.setAtomCache(cache);
  s=StructureIO.getStructure(pdbID);
  assertNotNull(s);
  assertTrue(s.getChains().size() > 0);
  Chain c=s.getChain(0);
  assertTrue(c.getSeqResGroups().size() > 2);
  Group first=c.getSeqResGroup(0);
  Group second=c.getSeqResGroup(1);
  Group third=c.getSeqResGroup(2);
  assertTrue(first instanceof AminoAcid);
  assertTrue(second instanceof AminoAcid);
  assertTrue(third instanceof AminoAcid);
  AminoAcid aafirst=(AminoAcid)first;
  AminoAcid aasecond=(AminoAcid)second;
  AminoAcid aathird=(AminoAcid)third;
  assertEquals(AminoAcid.SEQRESRECORD,aafirst.getRecordType());
  assertEquals(AminoAcid.SEQRESRECORD,aasecond.getRecordType());
  assertEquals(AminoAcid.ATOMRECORD,aathird.getRecordType());
}
Program: 16513
Project: 16513
Buggy source:
private Chain getEntityChain(String entity_id){
  return getChainFromList(entityChains,entity_id);
}

Fixed version (ground truth):
private Chain getEntityChain(String entity_id){
  for (  Chain chain : entityChains) {
    if (chain.getChainID().equals(entity_id)) {
      return chain;
    }
  }
  Chain chain=new ChainImpl();
  chain.setChainID(entity_id);
  entityChains.add(chain);
  return chain;
}
Program: 16522
Project: 16522
Buggy source:
/** 
 * @param recordName : three-letter name
 * @return true if successful download
 */
private static boolean downloadChemCompRecord(String recordName){
  String localName=getLocalFileName(recordName);
  String u=SERVER_LOCATION + recordName + "String_Node_Str";
  logger.debug("String_Node_Str" + u);
  URL url=null;
  try {
    url=new URL(u);
    HttpURLConnection uconn=HTTPConnectionTools.openHttpURLConnection(url);
    try (PrintWriter pw=new PrintWriter(new GZIPOutputStream(new FileOutputStream(localName)));BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(uconn.getInputStream()))){
      String line;
      while ((line=fileBuffer.readLine()) != null) {
        pw.println(line);
      }
      pw.flush();
      return true;
    }
   }
 catch (  FileNotFoundException e) {
    logger.warn(recordName + "String_Node_Str" + SERVER_LOCATION+ "String_Node_Str");
  }
catch (  IOException e) {
    logger.error("String_Node_Str" + url.toString() + "String_Node_Str"+ localName,e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param recordName : three-letter name
 * @return true if successful download
 */
private static boolean downloadChemCompRecord(String recordName){
  String localName=getLocalFileName(recordName);
  File newFile;
  try {
    newFile=File.createTempFile(recordName,"String_Node_Str");
  }
 catch (  IOException e) {
    return false;
  }
  String u=SERVER_LOCATION + recordName + "String_Node_Str";
  logger.debug("String_Node_Str" + u);
  URL url=null;
  try {
    url=new URL(u);
    HttpURLConnection uconn=HTTPConnectionTools.openHttpURLConnection(url);
    try (PrintWriter pw=new PrintWriter(new GZIPOutputStream(new FileOutputStream(newFile)));BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(uconn.getInputStream()))){
      String line;
      while ((line=fileBuffer.readLine()) != null) {
        pw.println(line);
      }
      pw.flush();
      newFile.renameTo(new File(localName));
      return true;
    }
   }
 catch (  IOException e) {
    logger.error("String_Node_Str" + url.toString() + "String_Node_Str"+ localName+ "String_Node_Str"+ e.getMessage());
    newFile.delete();
  }
  return false;
}
Program: 16523
Project: 16523
Buggy source:
public void setDefault(){
  parseSecStruc=false;
  alignSeqRes=true;
  parseCAOnly=false;
  setLoadChemCompInfo(false);
  headerOnly=false;
  updateRemediatedFiles=false;
  fullAtomNames=null;
  maxAtoms=MAX_ATOMS;
  atomCaThreshold=ATOM_CA_THRESHOLD;
  parseBioAssembly=false;
  createAtomBonds=false;
  createConects=false;
  createAtomCharges=true;
}

Fixed version (ground truth):
public void setDefault(){
  parseSecStruc=false;
  alignSeqRes=true;
  parseCAOnly=false;
  setLoadChemCompInfo(false);
  headerOnly=false;
  updateRemediatedFiles=false;
  fullAtomNames=null;
  maxAtoms=MAX_ATOMS;
  atomCaThreshold=ATOM_CA_THRESHOLD;
  parseBioAssembly=false;
  createAtomBonds=false;
  createConects=false;
  createAtomCharges=true;
  useInternalChainId=false;
}
Program: 16525
Project: 16525
Buggy source:
/** 
 * @param recordName : three-letter name
 * @return true if successful download
 */
private static boolean downloadChemCompRecord(String recordName){
  String localName=getLocalFileName(recordName);
  String u=SERVER_LOCATION + recordName + "String_Node_Str";
  logger.debug("String_Node_Str" + u);
  URL url=null;
  try {
    url=new URL(u);
    HttpURLConnection uconn=HTTPConnectionTools.openHttpURLConnection(url);
    try (PrintWriter pw=new PrintWriter(new GZIPOutputStream(new FileOutputStream(localName)));BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(uconn.getInputStream()))){
      String line;
      while ((line=fileBuffer.readLine()) != null) {
        pw.println(line);
      }
      pw.flush();
      return true;
    }
   }
 catch (  FileNotFoundException e) {
    logger.warn(recordName + "String_Node_Str" + SERVER_LOCATION+ "String_Node_Str");
  }
catch (  IOException e) {
    logger.error("String_Node_Str" + url.toString() + "String_Node_Str"+ localName,e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param recordName : three-letter name
 * @return true if successful download
 */
private static boolean downloadChemCompRecord(String recordName){
  String localName=getLocalFileName(recordName);
  File newFile=new File(localName);
  String u=SERVER_LOCATION + recordName + "String_Node_Str";
  logger.debug("String_Node_Str" + u);
  URL url=null;
  try {
    url=new URL(u);
    HttpURLConnection uconn=HTTPConnectionTools.openHttpURLConnection(url);
    try (PrintWriter pw=new PrintWriter(new GZIPOutputStream(new FileOutputStream(newFile)));BufferedReader fileBuffer=new BufferedReader(new InputStreamReader(uconn.getInputStream()))){
      String line;
      while ((line=fileBuffer.readLine()) != null) {
        pw.println(line);
      }
      pw.flush();
      return true;
    }
   }
 catch (  IOException e) {
    logger.error("String_Node_Str" + url.toString() + "String_Node_Str"+ localName+ "String_Node_Str"+ e.getMessage());
    newFile.delete();
  }
  return false;
}
Program: 16526
Project: 16526
Buggy source:
/** 
 * Return the String with the PDB server name, including the leading protocol  String (http:// or ftp://).  The server name will be by default the value   {@value #DEFAULT_PDB_FILE_SERVER} or the one read from system property  {@value #PDB_FILE_SERVER_PROPERTY}
 * @return the server name including the leading protocol string
 */
public static String getServerName(){
  String name=System.getProperty(PDB_FILE_SERVER_PROPERTY);
  if (name == null || name.trim().isEmpty()) {
    name=DEFAULT_PDB_FILE_SERVER;
    logger.debug("String_Node_Str",name);
  }
 else {
    if (!name.startsWith("String_Node_Str") || !name.startsWith("String_Node_Str")) {
      logger.warn("String_Node_Str",name,PDB_FILE_SERVER_PROPERTY);
      name="String_Node_Str" + name;
    }
    logger.info("String_Node_Str",name,PDB_FILE_SERVER_PROPERTY);
  }
  return name;
}

Fixed version (ground truth):
/** 
 * Return the String with the PDB server name, including the leading protocol  String (http:// or ftp://).  The server name will be by default the value   {@value #DEFAULT_PDB_FILE_SERVER} or the one read from system property  {@value #PDB_FILE_SERVER_PROPERTY}
 * @return the server name including the leading protocol string
 */
public static String getServerName(){
  String name=System.getProperty(PDB_FILE_SERVER_PROPERTY);
  if (name == null || name.trim().isEmpty()) {
    name=DEFAULT_PDB_FILE_SERVER;
    logger.debug("String_Node_Str",name);
  }
 else {
    if (!name.startsWith("String_Node_Str") && !name.startsWith("String_Node_Str")) {
      logger.warn("String_Node_Str",name,PDB_FILE_SERVER_PROPERTY);
      name="String_Node_Str" + name;
    }
    logger.info("String_Node_Str",name,PDB_FILE_SERVER_PROPERTY);
  }
  return name;
}