Program: 16328
Project: 16328
Buggy source:
@Override public String colorBySymmetry(){
  String pointGroup=rotationGroup.getPointGroup();
  Subunits subunits=rotationAxisAligner.getSubunits();
  List<Integer> modelNumbers=subunits.getModelNumbers();
  List<String> chainIds=subunits.getChainIds();
  List<List<Integer>> orbits=rotationAxisAligner.getOrbits();
  int n=subunits.getSubunitCount();
  int fold=rotationGroup.getRotation(0).getFold();
  Map<Color4f,List<String>> colorMap=new HashMap<Color4f,List<String>>();
  if (pointGroup.startsWith("String_Node_Str") && n == fold) {
    colorMap=getCnColorMap();
  }
 else   if ((pointGroup.startsWith("String_Node_Str") && orbits.size() > 2) || pointGroup.equals("String_Node_Str") || pointGroup.equals("String_Node_Str")|| pointGroup.equals("String_Node_Str")) {
    int nColor=0;
    if (orbits.size() % 2 == 0) {
      nColor=orbits.size() / 2;
    }
 else {
      nColor=(orbits.size() + 1) / 2;
    }
    Color4f[] colors=getSymmetryColors(nColor);
    for (int i=0; i < orbits.size(); i++) {
      int colorIndex=i;
      if (i >= nColor) {
        colorIndex=orbits.size() - 1 - i;
      }
      Color4f c=colors[colorIndex];
      List<String> ids=colorMap.get(c);
      if (ids == null) {
        ids=new ArrayList<String>();
        colorMap.put(c,ids);
      }
      for (      int subunit : orbits.get(i)) {
        String id=getChainSpecification(modelNumbers,chainIds,subunit);
        ids.add(id);
      }
    }
  }
 else {
    Color4f[] colors=getSymmetryColors(orbits.size());
    for (int i=0; i < orbits.size(); i++) {
      Color4f c=new Color4f(colors[i]);
      List<String> ids=colorMap.get(c);
      if (ids == null) {
        ids=new ArrayList<String>();
        colorMap.put(c,ids);
      }
      List<Integer> orbit=orbits.get(i);
      for (int j=0; j < orbit.size(); j++) {
        String id=getChainSpecification(modelNumbers,chainIds,orbit.get(j));
        ids.add(id);
      }
    }
  }
  return defaultColoring + getJmolColorScript(colorMap) + getJmolLigandScript();
}

Fixed version (ground truth):
@Override public String colorBySymmetry(){
  String pointGroup=rotationGroup.getPointGroup();
  QuatSymmetrySubunits subunits=rotationAxisAligner.getSubunits();
  List<Integer> modelNumbers=subunits.getModelNumbers();
  List<String> chainIds=subunits.getChainIds();
  List<List<Integer>> orbits=rotationAxisAligner.getOrbits();
  int n=subunits.getSubunitCount();
  int fold=rotationGroup.getRotation(0).getFold();
  Map<Color4f,List<String>> colorMap=new HashMap<Color4f,List<String>>();
  if (pointGroup.startsWith("String_Node_Str") && n == fold) {
    colorMap=getCnColorMap();
  }
 else   if ((pointGroup.startsWith("String_Node_Str") && orbits.size() > 2) || pointGroup.equals("String_Node_Str") || pointGroup.equals("String_Node_Str")|| pointGroup.equals("String_Node_Str")) {
    int nColor=0;
    if (orbits.size() % 2 == 0) {
      nColor=orbits.size() / 2;
    }
 else {
      nColor=(orbits.size() + 1) / 2;
    }
    Color4f[] colors=getSymmetryColors(nColor);
    for (int i=0; i < orbits.size(); i++) {
      int colorIndex=i;
      if (i >= nColor) {
        colorIndex=orbits.size() - 1 - i;
      }
      Color4f c=colors[colorIndex];
      List<String> ids=colorMap.get(c);
      if (ids == null) {
        ids=new ArrayList<String>();
        colorMap.put(c,ids);
      }
      for (      int subunit : orbits.get(i)) {
        String id=getChainSpecification(modelNumbers,chainIds,subunit);
        ids.add(id);
      }
    }
  }
 else {
    Color4f[] colors=getSymmetryColors(orbits.size());
    for (int i=0; i < orbits.size(); i++) {
      Color4f c=new Color4f(colors[i]);
      List<String> ids=colorMap.get(c);
      if (ids == null) {
        ids=new ArrayList<String>();
        colorMap.put(c,ids);
      }
      List<Integer> orbit=orbits.get(i);
      for (int j=0; j < orbit.size(); j++) {
        String id=getChainSpecification(modelNumbers,chainIds,orbit.get(j));
        ids.add(id);
      }
    }
  }
  return defaultColoring + getJmolColorScript(colorMap) + getJmolLigandScript();
}