if ( parent.getContainer( ).getDefn( ).isKindOf( moduleDefn )
if ( !parent.getContainer( ).getDefn( ).isKindOf( moduleDefn )
	private void doSetExtendsRefValue( ElementRefValue newExtendsValue )			throws ExtendsException	{		if ( newExtendsValue != null )		{			// the input value is unresovled, try to resolve it again.			ElementDefn metaData = (ElementDefn) element.getDefn( );			PropertyDefn propDefn = (PropertyDefn) metaData					.getProperty( IDesignElementModel.EXTENDS_PROP );			int ns = metaData.getNameSpaceID( );			DesignElement resolvedParent = null;			Module root = module;			if ( !metaData.canExtend( ) )				throw new ExtendsForbiddenException( element, newExtendsValue						.getName( ),						ExtendsForbiddenException.DESIGN_EXCEPTION_CANT_EXTEND );			if ( !newExtendsValue.isResolved( ) )				resolvedParent = root.resolveElement( ReferenceValueUtil						.needTheNamespacePrefix( newExtendsValue, module ), ns,						propDefn );			else				resolvedParent = root.resolveElement( newExtendsValue						.getElement( ), ns, propDefn );			DesignElement parent = newExtendsValue.getElement( );			if ( parent != null && parent != resolvedParent )				throw new InvalidParentException(						element,						newExtendsValue.getName( ),						InvalidParentException.DESIGN_EXCEPTION_PARENT_NOT_FOUND );			if ( parent == null && resolvedParent != null )			{				parent = resolvedParent;				newExtendsValue.resolve( parent );			}			element.checkExtends( parent );			if ( metaData.getNameSpaceID( ) == Module.ELEMENT_NAME_SPACE )			{				IElementDefn moduleDefn = MetaDataDictionary.getInstance( )						.getElement( ReportDesignConstants.MODULE_ELEMENT );				if ( parent.getContainer( ).getDefn( ).isKindOf( moduleDefn )						|| parent.getContainerSlot( ) != Module.COMPONENT_SLOT )				{					throw new ExtendsForbiddenException(							element,							newExtendsValue.getName( ),							ExtendsForbiddenException.DESIGN_EXCEPTION_PARENT_NOT_IN_COMPONENT );				}			}		}		if ( newExtendsValue != null && newExtendsValue.isResolved( )				&& newExtendsValue.getElement( ) == element.getExtendsElement( ) )			return;		// Make the change.		ActivityStack stack = getActivityStack( );		ExtendsRecord record = new ExtendsRecord( element, newExtendsValue );		stack.startTrans( record.getLabel( ) );		adjustUserProperties( element, newExtendsValue == null				? null				: newExtendsValue.getElement( ) );		stack.execute( record );		stack.commit( );	}