Skip to content

Commit

Permalink
Revert "Optimized finding @view beans now the value attribute is @Non…
Browse files Browse the repository at this point in the history
…binding #5362"

This reverts commit 549fc50.
  • Loading branch information
BalusC committed Nov 30, 2023
1 parent d053766 commit 0ed6ffa
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@
import java.util.Enumeration;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.stream.Stream;

import com.sun.faces.application.ApplicationAssociate;
import com.sun.faces.config.WebConfiguration;
import com.sun.faces.util.Util;

import jakarta.enterprise.inject.Any;
import jakarta.faces.FacesException;
import jakarta.faces.annotation.View;
import jakarta.faces.application.ResourceVisitOption;
Expand Down Expand Up @@ -118,8 +120,10 @@ public Stream<String> getViewResources(FacesContext facesContext, String path, i
new ResourcePathsIterator(path, maxDepth, configuredExtensions, getRestrictedDirectories(options), facesContext.getExternalContext()),
DISTINCT), false);
Stream<String> programmaticViewResources = Util.getCdiBeanManager(facesContext)
.getBeans(Object.class, View.Literal.INSTANCE).stream()
.map(bean -> bean.getBeanClass().getAnnotation(View.class).value());
.getBeans(Object.class, Any.Literal.INSTANCE).stream() // The value is not @Nonbinding. Only in 4.1 we can use View.Literal.INSTANCE as qualifier.
.map(bean -> bean.getBeanClass().getAnnotation(View.class))
.filter(Objects::nonNull)
.map(View::value);

return Stream.concat(physicalViewResources, programmaticViewResources);
}
Expand Down

0 comments on commit 0ed6ffa

Please sign in to comment.