Program: 16258
Project: 16258
Buggy source:
/** 
 * Returns an ordered list of subunit ids (orbit) in such a way that the subunit indices start at the 12 o-clock (+y axis) and proceed in a clockwise direction to the 11 o-clock position to close the "orbit".
 * @param orbit list of subunit indices that are transformed into each other by a rotation
 * @return list of subunit indices ordered in a clockwise direction
 */
private List<Integer> alignWithReferenceAxis(List<Integer> orbit){
  int n=subunits.getSubunitCount();
  int fold=rotationGroup.getRotation(0).getFold();
  if (fold < 2) {
    return orbit;
  }
  Vector3d probe=new Vector3d();
  double dotMin1=Double.MIN_VALUE;
  double dotMin2=Double.MIN_VALUE;
  int index1=0;
  int index2=0;
  Vector3d Y1=new Vector3d(0,1,0);
  Vector3d Y2=new Vector3d(0,1,0);
  Matrix3d m=new Matrix3d();
  double angle=-2 * Math.PI / fold;
  m.rotZ(0.1 * angle);
  m.transform(Y1);
  m.rotZ(1.1 * angle);
  m.transform(Y2);
  for (  int i : orbit) {
    Point3d p=subunits.getCenters().get(i);
    probe.set(p);
    transformationMatrix.transform(probe);
    double dot1=Y1.dot(probe);
    if (dot1 > dotMin1) {
      dotMin1=dot1;
      index1=i;
    }
    double dot2=Y2.dot(probe);
    if (dot2 > dotMin2) {
      dotMin2=dot2;
      index2=i;
    }
  }
  for (int i=0; i < n; i++) {
    if (orbit.get(0) == index1) {
      break;
    }
    Collections.rotate(orbit,1);
  }
  if (orbit.get(1) == index2) {
    return orbit;
  }
  Collections.reverse(orbit.subList(1,orbit.size()));
  if (orbit.get(1) != index2) {
    System.err.println("String_Node_Str");
  }
  return orbit;
}

Fixed version (ground truth):
/** 
 * Returns an ordered list of subunit ids (orbit) in such a way that the subunit indices start at the 12 o-clock (+y axis) and proceed in a clockwise direction to the 11 o-clock position to close the "orbit".
 * @param orbit list of subunit indices that are transformed into each other by a rotation
 * @return list of subunit indices ordered in a clockwise direction
 */
private List<Integer> alignWithReferenceAxis(List<Integer> orbit){
  int n=subunits.getSubunitCount();
  int fold=rotationGroup.getRotation(0).getFold();
  if (fold < 2) {
    return orbit;
  }
  Vector3d probe=new Vector3d();
  double dotMin1=Double.MIN_VALUE;
  double dotMin2=Double.MIN_VALUE;
  int index1=0;
  int index2=0;
  Vector3d Y1=new Vector3d(0,1,0);
  Vector3d Y2=new Vector3d(0,1,0);
  Matrix3d m=new Matrix3d();
  double angle=-2 * Math.PI / fold;
  m.rotZ(0.1 * angle);
  m.transform(Y1);
  m.rotZ(1.1 * angle);
  m.transform(Y2);
  for (  int i : orbit) {
    Point3d p=subunits.getCenters().get(i);
    probe.set(p);
    transformationMatrix.transform(probe);
    double dot1=Y1.dot(probe);
    if (dot1 > dotMin1) {
      dotMin1=dot1;
      index1=i;
    }
    double dot2=Y2.dot(probe);
    if (dot2 > dotMin2) {
      dotMin2=dot2;
      index2=i;
    }
  }
  for (int i=0; i < n; i++) {
    if (orbit.get(0) == index1) {
      break;
    }
    Collections.rotate(orbit,1);
  }
  if (orbit.get(1) == index2) {
    return orbit;
  }
  Collections.reverse(orbit.subList(1,orbit.size()));
  if (orbit.get(1) != index2) {
    logger.warn("String_Node_Str");
  }
  return orbit;
}