/**
  * @param string $pattern Pattern to be resolved
  * @param boolean $bubbleControllerAndSubpackage if TRUE, then we successively split off parts from "@controller" and "@subpackage" until both are empty.
  * @param boolean $formatIsOptional if TRUE, then half of the resulting strings will have ."@format" stripped off, and the other half will have it.
  * @return array unix style path
  */
 protected function expandGenericPathPattern($pattern, $bubbleControllerAndSubpackage, $formatIsOptional)
 {
     $extensionKey = $this->controllerContext->getRequest()->getControllerExtensionKey();
     $configurations = $this->configurationService->getViewConfigurationForExtensionName($extensionKey);
     $pathOverlayConfigurations = $this->buildPathOverlayConfigurations($configurations);
     $paths = parent::expandGenericPathPattern($pattern, $bubbleControllerAndSubpackage, $formatIsOptional);
     foreach ($pathOverlayConfigurations as $overlayPaths) {
         if (FALSE === empty($overlayPaths['templateRootPath'])) {
             $templateRootPath = $overlayPaths['templateRootPath'];
             $this->setTemplateRootPath($templateRootPath);
         }
         if (FALSE === empty($overlayPaths['partialRootPath'])) {
             $partialRootPath = $overlayPaths['partialRootPath'];
             $this->setPartialRootPath($partialRootPath);
         }
         if (FALSE === empty($overlayPaths['layoutRootPath'])) {
             $layoutRootPath = $overlayPaths['layoutRootPath'];
             $this->setLayoutRootPath($layoutRootPath);
         }
         $subset = parent::expandGenericPathPattern($pattern, $bubbleControllerAndSubpackage, $formatIsOptional);
         $paths = array_merge($paths, $subset);
     }
     $paths = array_unique($paths);
     $paths = array_reverse($paths);
     $paths = $this->trimPathStringRecursive($paths);
     return $paths;
 }