private void add(ThreadGroup g) throws IllegalThreadStateException {
synchronized (this.childrenGroupsLock) {
    if (!isDestroyed) {
      if (childrenGroups.length == numGroups) {
        ThreadGroup[] newGroups=new ThreadGroup[childrenGroups.length * 2];
        System.arraycopy(childrenGroups,0,newGroups,0,numGroups);
        newGroups[numGroups++]=g;
        childrenGroups=newGroups;
      }
 else {
        childrenGroups[numGroups++]=g;
      }
    }
 else {
      throw new IllegalThreadStateException();
    }
  }
}

private void add ( ThreadGroup g ) throws IllegalThreadStateException { synchronized ( this . childrenGroupsLock ) { if ( ! isDestroyed ) { if ( childrenGroups . length == numGroups ) { ThreadGroup [ ] newGroups = new ThreadGroup [ childrenGroups . length * 2 ] ; System . arraycopy ( childrenGroups , 0 , newGroups , 0 , numGroups ) ; newGroups [ numGroups ++ ] = g ; childrenGroups = newGroups ; } else { childrenGroups [ numGroups ++ ] = g ; } } else { throw new IllegalThreadStateException ( ) ; } } }
adds a threadgroup to the receiver .
