4 ms·
Oh, that actually does look different. Switch expression with exceptions would allow compact use of checked exceptions in method chaining. List<URI> pages… va
by ivan_gammel 2y ago
Oh, that actually does look different. Switch expression with exceptions would allow compact use of checked exceptions in method chaining.
List<URI> pages…
var content = pages.stream().map(uri -> switch(fetch(uri)) { case Page model -> return model; case throws IOException -> return Page.notFound(uri); }).toList();