Program: 64970
Project: 64970
Buggy source:
/** 
 * Build descriptor and mappings for an Object type argument.  The newly created descriptor will be added to the given OX project.
 */
protected void addToOXProjectForObjectTypeArg(DatabaseType dbType,Project oxProject,String objectName,String objectAlias){
  XMLDescriptor xdesc=(XMLDescriptor)oxProject.getDescriptorForAlias(objectAlias);
  if (xdesc == null) {
    xdesc=buildAndAddNewXMLDescriptor(oxProject,objectAlias,objectName,nct.generateSchemaAlias(objectAlias),buildCustomQName(objectName,dbwsBuilder).getNamespaceURI());
  }
  ObjectType oType=(ObjectType)dbType;
  for (  FieldType field : oType.getFields()) {
    String lFieldName=field.getFieldName().toLowerCase();
    if (xdesc.getMappingForAttributeName(lFieldName) == null) {
      if (field.isComposite()) {
        String targetTypeName2=field.getEnclosedType().getTypeName();
        String alias=targetTypeName2.toLowerCase();
        XMLDescriptor xdesc2=(XMLDescriptor)oxProject.getDescriptorForAlias(alias);
        boolean buildDescriptor=xdesc2 == null;
        if (buildDescriptor) {
          xdesc2=buildAndAddNewXMLDescriptor(oxProject,alias,nct.generateSchemaAlias(alias),buildCustomQName(targetTypeName2,dbwsBuilder).getNamespaceURI());
        }
        if (field.getEnclosedType().isObjectType()) {
          if (buildDescriptor) {
            xdesc2.setJavaClassName(getGeneratedJavaClassName(alias,dbwsBuilder.getProjectName()));
            addToOXProjectForObjectTypeArg(field.getEnclosedType(),oxProject,xdesc2.getJavaClassName(),alias);
          }
          buildAndAddXMLCompositeObjectMapping(xdesc,lFieldName,xdesc2.getJavaClassName());
        }
 else         if (field.getEnclosedType().isVArrayType()) {
          if (buildDescriptor) {
            xdesc2.setJavaClassName(getGeneratedJavaClassName(alias,dbwsBuilder.getProjectName()));
            addToOXProjectForVArrayArg(field.getEnclosedType(),oxProject,xdesc2.getJavaClassName(),alias);
          }
          buildAndAddXMLCompositeDirectCollectionMapping(xdesc,lFieldName,lFieldName + SLASH + TEXT,getAttributeClassForDatabaseType(field.getEnclosedType()));
        }
 else         if (field.getEnclosedType().isObjectTableType()) {
          if (buildDescriptor) {
            xdesc2.setJavaClassName(getGeneratedJavaClassName(alias,dbwsBuilder.getProjectName()));
            addToOXProjectForObjectTableTypeArg(field.getEnclosedType(),oxProject,targetTypeName2,alias);
          }
          String nestedTypeAlias=((ObjectTableType)field.getEnclosedType()).getEnclosedType().getTypeName().toLowerCase();
          String nestedTypeName=getGeneratedJavaClassName(nestedTypeAlias,dbwsBuilder.getProjectName());
          buildAndAddXMLCompositeCollectionMapping(xdesc,lFieldName,lFieldName + SLASH + ITEM_MAPPING_NAME,nestedTypeName);
        }
      }
 else {
        addDirectMappingForFieldType(xdesc,lFieldName,field);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Build descriptor and mappings for an Object type argument.  The newly created descriptor will be added to the given OX project.
 */
protected void addToOXProjectForObjectTypeArg(DatabaseType dbType,Project oxProject,String objectName,String objectAlias){
  XMLDescriptor xdesc=(XMLDescriptor)oxProject.getDescriptorForAlias(objectAlias);
  if (xdesc == null) {
    xdesc=buildAndAddNewXMLDescriptor(oxProject,objectAlias,objectName,nct.generateSchemaAlias(objectAlias),buildCustomQName(objectName,dbwsBuilder).getNamespaceURI());
  }
  ObjectType oType=(ObjectType)dbType;
  for (  FieldType field : oType.getFields()) {
    String lFieldName=field.getFieldName().toLowerCase();
    if (xdesc.getMappingForAttributeName(lFieldName) == null) {
      if (field.isComposite()) {
        String targetTypeName2=field.getEnclosedType().getTypeName();
        String alias=targetTypeName2.toLowerCase();
        XMLDescriptor xdesc2=(XMLDescriptor)oxProject.getDescriptorForAlias(alias);
        boolean buildDescriptor=xdesc2 == null;
        if (buildDescriptor) {
          xdesc2=buildAndAddNewXMLDescriptor(oxProject,alias,nct.generateSchemaAlias(alias),buildCustomQName(targetTypeName2,dbwsBuilder).getNamespaceURI());
        }
        if (field.getEnclosedType().isObjectType()) {
          if (buildDescriptor) {
            xdesc2.setJavaClassName(getGeneratedJavaClassName(alias,dbwsBuilder.getProjectName()));
            addToOXProjectForObjectTypeArg(field.getEnclosedType(),oxProject,xdesc2.getJavaClassName(),alias);
          }
          buildAndAddXMLCompositeObjectMapping(xdesc,lFieldName,xdesc2.getJavaClassName());
        }
 else         if (field.getEnclosedType().isVArrayType()) {
          if (buildDescriptor) {
            xdesc2.setJavaClassName(getGeneratedJavaClassName(alias,dbwsBuilder.getProjectName()));
            addToOXProjectForVArrayArg(field.getEnclosedType(),oxProject,xdesc2.getJavaClassName(),alias);
          }
          buildAndAddXMLCompositeDirectCollectionMapping(xdesc,lFieldName,lFieldName + SLASH + TEXT,getAttributeClassForDatabaseType(field.getEnclosedType()));
        }
 else         if (field.getEnclosedType().isObjectTableType()) {
          if (buildDescriptor) {
            xdesc2.setJavaClassName(getGeneratedJavaClassName(alias,dbwsBuilder.getProjectName()));
            addToOXProjectForObjectTableTypeArg(field.getEnclosedType(),oxProject,targetTypeName2,alias);
          }
          ObjectTableType tableType=(ObjectTableType)field.getEnclosedType();
          if (tableType.getEnclosedType().isComposite()) {
            String nestedTypeAlias=((ObjectTableType)field.getEnclosedType()).getEnclosedType().getTypeName().toLowerCase();
            String nestedTypeName=getGeneratedJavaClassName(nestedTypeAlias,dbwsBuilder.getProjectName());
            buildAndAddXMLCompositeCollectionMapping(xdesc,lFieldName,lFieldName + SLASH + ITEM_MAPPING_NAME,nestedTypeName);
          }
 else {
            buildAndAddXMLCompositeDirectCollectionMapping(xdesc,lFieldName,lFieldName + SLASH + TEXT,getAttributeClassForDatabaseType(tableType));
          }
        }
      }
 else {
        addDirectMappingForFieldType(xdesc,lFieldName,field);
      }
    }
  }
}