assert propDefn.getTypeCode( ) == PropertyType.STRUCT_TYPE;
assert propDefn.getTypeCode( ) == IPropertyType.STRUCT_TYPE;
	private List doCheckStructureList( Module module, DesignElement element,			IPropertyDefn propDefn, List list, IStructure toAdd )	{		boolean checkList = toAdd == null;		List errorList = new ArrayList( );		if ( list == null || list.size( ) == 0 )			return errorList;		assert propDefn != null;		assert propDefn.getTypeCode( ) == PropertyType.STRUCT_TYPE;		boolean checkID = propDefn.getStructDefn( ).getName( ).equals(				PropertyBinding.PROPERTY_BINDING_STRUCT );		if ( !checkID )		{			// Get the unique member whose value should be unique in the			// structure list.			// The type of unique member is name property type.			// Note: The first unique member is considered.			PropertyDefn uniqueMember = null;			Iterator iter = propDefn.getStructDefn( ).propertiesIterator( );			while ( iter.hasNext( ) )			{				StructPropertyDefn memberDefn = (StructPropertyDefn) iter						.next( );				if ( memberDefn.getTypeCode( ) == PropertyType.NAME_TYPE						|| memberDefn.getTypeCode( ) == PropertyType.MEMBER_KEY_TYPE )				{					uniqueMember = memberDefn;					break;				}			}			HashSet values = new HashSet( );			// Check whether there two structure has the same value of			// the unique member.			for ( int i = 0; i < list.size( ); i++ )			{				Structure struct = (Structure) list.get( i );				if ( checkList )					errorList.addAll( struct.validate( module, element ) );				if ( uniqueMember != null )				{					String value = (String) struct.getProperty( module,							uniqueMember );					if ( values.contains( value ) )					{						if ( checkList )							errorList									.add( new PropertyValueException(											element,											propDefn,											value,											PropertyValueException.DESIGN_EXCEPTION_VALUE_EXISTS ) );					}					else					{						values.add( value );					}				}			}			// If the toAdd structure is added the structure list, check whether			// there is a structure in the list has the same value of the unique			// member.			if ( uniqueMember != null && toAdd != null )			{				String value = (String) toAdd						.getProperty( module, uniqueMember );				if ( values.contains( value ) )				{					errorList							.add( new PropertyValueException(									element,									propDefn.getName( ),									value,									PropertyValueException.DESIGN_EXCEPTION_VALUE_EXISTS ) );				}			}		}		// the list is property binding list, we check them by both name and id		else		{			HashMap values = new HashMap( );			// Check whether there two property binding have the same name and			// element id.			for ( int i = 0; i < list.size( ); i++ )			{				PropertyBinding struct = (PropertyBinding) list.get( i );				if ( checkList )					errorList.addAll( struct.validate( module, element ) );				String name = struct.getName( );				BigDecimal id = struct.getID( );				List names = (List) values.get( id );				if ( names != null )				{					if ( names.contains( name ) )					{						if ( checkList )							errorList									.add( new PropertyValueException(											element,											propDefn,											name,											PropertyValueException.DESIGN_EXCEPTION_VALUE_EXISTS ) );					}					else					{						names.add( name );					}				}				else				{					names = new ArrayList( );					names.add( name );					values.put( id, names );				}			}			// If the toAdd property bindding is added the structure list, check			// whether there is a structure in the list has the same name and			// element id.			if ( toAdd != null )			{				assert toAdd instanceof PropertyBinding;				String name = ( (PropertyBinding) toAdd ).getName( );				BigDecimal id = ( (PropertyBinding) toAdd ).getID( );				List names = (List) values.get( id );				if ( names != null && names.contains( name ) )				{					errorList							.add( new PropertyValueException(									element,									propDefn,									name,									PropertyValueException.DESIGN_EXCEPTION_VALUE_EXISTS ) );				}			}		}		return errorList;	}