if (fragment != null)
{
if (!layout.equals(fragment.getName()))
{
fragment.setName(layout);
ContentFragment contentFragment = new ContentFragmentImpl(fragment, new HashMap());
PortletWindow window = windowAccess.getPortletWindow(contentFragment);
if (window != null)
{
entityAccess.updatePortletEntity(window.getPortletEntity(), contentFragment);
entityAccess.storePortletEntity(window.getPortletEntity());
windowAccess.createPortletWindow(window.getPortletEntity(), contentFragment.getId());
count++;
if ( isBlank(sizes) )
{
fragment.setLayoutSizes(null);
}