private void initRelatedPortlets ( ) { final Set < MarketplacePortletDefinition > allRelatedPortlets = new HashSet <> ( ) ; for ( PortletCategory parentCategory : this . portletCategoryRegistry . getParentCategories ( this ) ) { final Set < IPortletDefinition > portletsInCategory = this . portletCategoryRegistry . getAllChildPortlets ( parentCategory ) ; for ( IPortletDefinition portletDefinition : portletsInCategory ) { allRelatedPortlets . add ( new MarketplacePortletDefinition ( portletDefinition , this . marketplaceService , this . portletCategoryRegistry ) ) ; } } allRelatedPortlets . remove ( this ) ; this . relatedPortlets = allRelatedPortlets ; }
Initialize related portlets . This must be called lazily so that MarketplacePortletDefinitions instantiated as related portlets off of a MarketplacePortletDefinition do not always instantiate their related MarketplacePortletDefinitions ad infinitem .