Facet (Module module) { final FacetTypeId<?> underlyingTypeId = myFacetType.getUnderlyingFacetType(); if (underlyingTypeId == null) return null; final Collection<? extends Facet> parentFacets = FacetManager.getInstance(module).getFacetsByType(underlyingTypeId); for (Facet facet : parentFacets) { if (myDetector.isSuitableUnderlyingFacetConfiguration(facet.getConfiguration(), myConfiguration, myRelatedFiles)) { return facet; } } LOG.error("Cannot find suitable underlying facet in " + parentFacets); return null; }