Program: 16582
Project: 16582
Buggy source:
public boolean insertBefore(Component child,Component refChild){
  if (!(child instanceof Row))   throw new UiException("String_Node_Str" + child);
  Row newItem=(Row)child;
  final int jfrom=hasGroup() && newItem.getParent() == this ? newItem.getIndex() : -1;
  if (newItem instanceof Groupfoot) {
    if (!hasGroup())     throw new UiException("String_Node_Str");
    if (refChild == null) {
      if (getLastChild() instanceof Groupfoot)       throw new UiException("String_Node_Str");
      final int[] g=(int[])_groupsInfo.get(getGroupCount() - 1);
      g[2]=getChildren().size() - 1;
    }
 else {
      final int idx=((Row)refChild).getIndex();
      final int[] g=getGroupsInfoAt(idx);
      if (g == null)       throw new UiException("String_Node_Str");
      if (g[2] != -1)       throw new UiException("String_Node_Str");
      if (idx != (g[0] + g[1]))       throw new UiException("String_Node_Str");
      g[2]=idx - 1;
    }
  }
  if (super.insertBefore(child,refChild)) {
    if (hasGroup()) {
      final int jto=refChild instanceof Row ? ((Row)refChild).getIndex() : -1, fixFrom=jfrom < 0 || (jto >= 0 && jfrom > jto) ? jto : jfrom;
      if (fixFrom >= 0)       fixGroupIndex(fixFrom,jfrom >= 0 && jto >= 0 ? jfrom > jto ? jfrom : jto : -1,true);
    }
    if (newItem instanceof Group) {
      Group group=(Group)newItem;
      int index=group.getIndex();
      if (_groupsInfo.isEmpty())       _groupsInfo.add(new int[]{group.getIndex(),getChildren().size() - index,-1});
 else {
        int idx=0;
        int[] prev=null, next=null;
        for (Iterator it=_groupsInfo.iterator(); it.hasNext(); ) {
          int[] g=(int[])it.next();
          if (g[0] <= index) {
            prev=g;
            idx++;
          }
 else {
            next=g;
            break;
          }
        }
        if (prev != null) {
          int leng=index - prev[0], size=prev[1] - leng + 1;
          prev[1]=leng;
          _groupsInfo.add(idx,new int[]{index,size,-1});
        }
 else         if (next != null) {
          _groupsInfo.add(idx,new int[]{index,next[0] - index,-1});
        }
      }
    }
 else     if (hasGroup()) {
      int index=newItem.getIndex();
      final int[] g=getGroupsInfoAt(index);
      if (g != null) {
        g[1]++;
        if (g[2] != -1)         g[2]++;
      }
    }
    afterInsert(child);
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean insertBefore(Component child,Component refChild){
  if (!(child instanceof Row))   throw new UiException("String_Node_Str" + child);
  Row newItem=(Row)child;
  final int jfrom=hasGroup() && newItem.getParent() == this ? newItem.getIndex() : -1;
  if (newItem instanceof Groupfoot) {
    if (!hasGroup())     throw new UiException("String_Node_Str");
    if (refChild == null) {
      if (getLastChild() instanceof Groupfoot)       throw new UiException("String_Node_Str");
      final int[] g=(int[])_groupsInfo.get(getGroupCount() - 1);
      g[2]=getChildren().size() - 1;
    }
 else {
      final int idx=((Row)refChild).getIndex();
      final int[] g=getGroupsInfoAt(idx);
      if (g == null)       throw new UiException("String_Node_Str");
      if (g[2] != -1)       throw new UiException("String_Node_Str");
      if (idx != (g[0] + g[1]))       throw new UiException("String_Node_Str");
      g[2]=idx - 1;
    }
  }
  if (super.insertBefore(child,refChild)) {
    if (hasGroup()) {
      final int jto=refChild instanceof Row ? ((Row)refChild).getIndex() : -1, fixFrom=jfrom < 0 || (jto >= 0 && jfrom > jto) ? jto : jfrom;
      if (fixFrom >= 0)       fixGroupIndex(fixFrom,jfrom >= 0 && jto >= 0 ? jfrom > jto ? jfrom : jto : -1,true);
    }
    if (newItem instanceof Group) {
      Group group=(Group)newItem;
      int index=group.getIndex();
      if (_groupsInfo.isEmpty())       _groupsInfo.add(new int[]{group.getIndex(),getChildren().size() - index,-1});
 else {
        int idx=0;
        int[] prev=null, next=null;
        for (Iterator it=_groupsInfo.iterator(); it.hasNext(); ) {
          int[] g=(int[])it.next();
          if (g[0] <= index) {
            prev=g;
            idx++;
          }
 else {
            next=g;
            break;
          }
        }
        if (prev != null) {
          int leng=index - prev[0], size=prev[1] - leng + 1;
          prev[1]=leng;
          _groupsInfo.add(idx,new int[]{index,size,prev[2]});
          prev[2]=-1;
        }
 else         if (next != null) {
          _groupsInfo.add(idx,new int[]{index,next[0] - index,-1});
        }
      }
    }
 else     if (hasGroup()) {
      int index=newItem.getIndex();
      final int[] g=getGroupsInfoAt(index);
      if (g != null) {
        g[1]++;
        if (g[2] != -1)         g[2]++;
      }
    }
    afterInsert(child);
    return true;
  }
  return false;
}