docs: private void cloneNestedFeatures(NestedDef nestedDef, ArrayList newFields, ArrayList newReferences, ArrayList newCollections)
      {
          ClassDescriptorDef      nestedClassDef = nestedDef.getNestedType();
          String                  prefix         = nestedDef.getName()+"::";
          FieldDescriptorDef      copyFieldDef;
          ReferenceDescriptorDef  copyRefDef;
          CollectionDescriptorDef copyCollDef;
          StringBuffer            newForeignkey;
  
          for (Iterator fieldIt = nestedClassDef.getFields(); fieldIt.hasNext();)
          {
              copyFieldDef = cloneField((FieldDescriptorDef)fieldIt.next(), prefix);
              if (!contains(newFields, copyFieldDef))
              {
                  copyFieldDef.setNested();
                  newFields.add(copyFieldDef);
              }
          }
          for (Iterator refIt = nestedClassDef.getReferences(); refIt.hasNext();)
          {
              copyRefDef = cloneReference((ReferenceDescriptorDef)refIt.next(), prefix);
              if (contains(newReferences, copyRefDef))
              {
                  continue;
              }
              copyRefDef.setNested();
  
              // we have to modify the foreignkey setting as it specifies a field of the same (nested) class
              newForeignkey = new StringBuffer();
  
              for (CommaListIterator it = new CommaListIterator(copyRefDef.getProperty(PropertyHelper.OJB_PROPERTY_FOREIGNKEY)); it.hasNext();)
              {
                  if (newForeignkey.length() > 0)
                  {
                      newForeignkey.append(",");
                  }
                  newForeignkey.append(prefix);
                  newForeignkey.append(it.next());
              }
              copyRefDef.setProperty(PropertyHelper.OJB_PROPERTY_FOREIGNKEY, newForeignkey.toString());
              newReferences.add(copyRefDef);
          }
          for (Iterator collIt = nestedClassDef.getCollections(); collIt.hasNext();)
          {
              copyCollDef = cloneCollection((CollectionDescriptorDef)collIt.next(), prefix);
              if (!contains(newCollections, copyCollDef))
              {
                  copyCollDef.setNested();
                  newCollections.add(copyCollDef);
              }
          }
      }