Skip to content

Commit

Permalink
feat: improve streams
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed Nov 29, 2024
1 parent 24cff2b commit 801b722
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
} else {
Iterable<Locale> iterable = () -> myRequest.getLocales().asIterator();
Locale userLocale = StreamSupport.stream(iterable.spliterator(), false)
.filter(myLocale -> SUPPORTED_LOCALES.contains(myLocale)).findFirst().orElse(Locale.ENGLISH);
.filter(SUPPORTED_LOCALES::contains).findFirst().orElse(Locale.ENGLISH);
String forwardPath = String.format("/%s/index.html", userLocale.getLanguage());
// LOG.info(String.format("Forward to: %s", forwardPath));
RequestDispatcher dispatcher = myRequest.getServletContext().getRequestDispatcher(forwardPath);
Expand Down

0 comments on commit 801b722

Please sign in to comment.