Program: 16707
Project: 16707
Buggy source:
/** 
 * Display a MultipleAlignment. New structures are downloaded if they were not cached in the alignment and they are entirely rotated here with the Pose information.
 * @param multAln
 * @return MultipleAlignmentJmol instance
 * @throws StructureException
 * @throws StructureAlignmentException 
 * @throws IOException 
 */
public static MultipleAlignmentJmol display(MultipleAlignment multAln) throws StructureException, StructureAlignmentException, IOException {
  int size=multAln.size();
  if (multAln.getAtomArrays() == null)   multAln.getEnsemble().updateAtomArrays();
  for (int i=0; i < size; i++) {
    if (multAln.getAtomArrays().get(i).length < 1)     throw new StructureException("String_Node_Str" + multAln.getAtomArrays().get(i).length);
  }
  try {
    List<Atom[]> rotatedAtoms=new ArrayList<Atom[]>();
    for (int i=0; i < size; i++) {
      Structure displayS=multAln.getAtomArrays().get(i)[0].getGroup().getChain().getParent().clone();
      Atom[] rotCA=StructureTools.getRepresentativeAtomArray(displayS);
      Calc.rotate(rotCA[0].getGroup().getChain().getParent(),multAln.getPose().getRotation().get(i));
      Calc.shift(rotCA[0].getGroup().getChain().getParent(),multAln.getPose().getTranslation().get(i));
      rotatedAtoms.add(rotCA);
    }
    MultipleAlignmentJmol jmol=new MultipleAlignmentJmol(multAln,rotatedAtoms);
    jmol.setTitle(jmol.getStructure().getPDBHeader().getTitle());
    return jmol;
  }
 catch (  StructureAlignmentException e) {
    e.printStackTrace();
    System.err.println("String_Node_Str");
    MultipleAlignmentJmol jmol=new MultipleAlignmentJmol(multAln,multAln.getAtomArrays());
    jmol.setTitle(jmol.getStructure().getPDBHeader().getTitle());
    return jmol;
  }
}

Fixed version (ground truth):
/** 
 * Display a MultipleAlignment. New structures are downloaded if they were not cached in the alignment and they are entirely rotated here with the Pose information.
 * @param multAln
 * @return MultipleAlignmentJmol instance
 * @throws StructureException
 * @throws StructureAlignmentException 
 * @throws IOException 
 */
public static MultipleAlignmentJmol display(MultipleAlignment multAln) throws StructureException, StructureAlignmentException, IOException {
  int size=multAln.size();
  List<Atom[]> atomArrays=multAln.getEnsemble().getAtomArrays();
  for (int i=0; i < size; i++) {
    if (atomArrays.get(i).length < 1)     throw new StructureException("String_Node_Str" + atomArrays.get(i).length);
  }
  List<Atom[]> rotatedAtoms=new ArrayList<Atom[]>();
  List<Matrix4d> transformations=multAln.getTransformations();
  if (transformations == null) {
    logger.error("String_Node_Str");
    multAln=multAln.clone();
    MultipleSuperimposer imposer=new ReferenceSuperimposer();
    imposer.superimpose(multAln);
    transformations=multAln.getTransformations();
    assert(transformations != null);
  }
  for (int i=0; i < size; i++) {
    Structure displayS=atomArrays.get(i)[0].getGroup().getChain().getParent().clone();
    Atom[] rotCA=StructureTools.getRepresentativeAtomArray(displayS);
    Calc.transform(rotCA[0].getGroup().getChain().getParent(),multAln.getTransformations().get(i));
    rotatedAtoms.add(rotCA);
  }
  MultipleAlignmentJmol jmol=new MultipleAlignmentJmol(multAln,rotatedAtoms);
  jmol.setTitle(jmol.getStructure().getPDBHeader().getTitle());
  return jmol;
}