Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions articles/flow/component-internals/visibility.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ container.add(label);

// prints 1 - the server-side structure is preserved
// regardless of whether the component is visible or not
System.out.println("Number of children: "
+ container.getChildren().collect(
Collectors.counting()));
System.out.println("Number of children: " + container.getChildCount());
----
====

Expand Down
2 changes: 1 addition & 1 deletion articles/flow/routing/registered-routes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To retrieve all the routes defined by parent layout, use:
List<RouteData> routes = RouteConfiguration.forSessionScope().getAvailableRoutes();
List<RouteData> myRoutes = routes.stream()
.filter(routeData -> MyParentLayout.class.equals((routeData.getParentLayout())))
.collect(Collectors.toList());
.toList();
----


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.time.LocalDate;
import java.time.Month;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

@Route("date-picker-individual-input-fields")
Expand All @@ -29,8 +28,7 @@ public DatePickerIndividualInputFields() {
LocalDate now = LocalDate.now(ZoneId.systemDefault());

List<Integer> selectableYears = IntStream
.range(now.getYear() - 99, now.getYear() + 1).boxed()
.collect(Collectors.toList());
.range(now.getYear() - 99, now.getYear() + 1).boxed().toList();

yearPicker = new ComboBox<>("Year", selectableYears);
yearPicker.setWidth(6, Unit.EM);
Expand Down Expand Up @@ -80,8 +78,8 @@ private void updateDayPicker() {
monthPicker.getValue(), 1);
int lengthOfMonth = startOfMonth.lengthOfMonth();

dayPicker.setItems(IntStream.range(1, lengthOfMonth + 1).boxed()
.collect(Collectors.toList()));
dayPicker.setItems(
IntStream.range(1, lengthOfMonth + 1).boxed().toList());
}
// end::snippet[]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ public class GridDragDropFilters extends Div {
public GridDragDropFilters() {

List<Person> people = DataService.getPeople();
managers = people.stream().filter(Person::isManager)
.collect(Collectors.toList());
managers = people.stream().filter(Person::isManager).toList();
staffGroupedByMangers = people.stream()
.filter(person -> person.getManagerId() != null)
.collect(Collectors.groupingBy(Person::getManagerId,
Collectors.toList()));
.collect(Collectors.groupingBy(Person::getManagerId));

// tag::snippet[]
TreeGrid<Person> treeGrid = setupTreeGrid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.vaadin.flow.router.Route;

import java.util.List;
import java.util.stream.Collectors;

@Route("grid-header-footer-styling")
public class GridHeaderFooterStyling extends Div {
Expand Down Expand Up @@ -35,8 +34,7 @@ public GridHeaderFooterStyling() {

private static List<PersonWithRating> createDataSet() {
return DataService.getPeople().stream()
.map(PersonWithRating::generateFromPerson)
.collect(Collectors.toList());
.map(PersonWithRating::generateFromPerson).toList();
}

public static class Exporter // hidden-source-line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.vaadin.flow.router.Route;

import java.util.List;
import java.util.stream.Collectors;

@Route("grid-styling")
public class GridStyling extends Div {
Expand Down Expand Up @@ -39,8 +38,7 @@ public GridStyling() {

private static List<PersonWithRating> createDataSet() {
return DataService.getPeople().stream()
.map(PersonWithRating::generateFromPerson)
.collect(Collectors.toList());
.map(PersonWithRating::generateFromPerson).toList();
}

public static class Exporter // hidden-source-line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public TreeGridDragDrop() {
managers = people.stream().filter(Person::isManager).toList();
staffGroupedByMangers = people.stream()
.filter(person -> person.getManagerId() != null)
.collect(Collectors.groupingBy(Person::getManagerId,
Collectors.toList()));
.collect(Collectors.groupingBy(Person::getManagerId));

// tag::snippet[]
TreeGrid<Person> treeGrid = setupTreeGrid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.springframework.security.core.context.SecurityContextHolder;

import java.util.List;
import java.util.stream.Collectors;

/**
* Provides information about the current user.
Expand All @@ -24,8 +23,7 @@ public UserInfo getUserInfo() {
.getAuthentication();

final List<String> authorities = auth.getAuthorities().stream()
.map(GrantedAuthority::getAuthority)
.collect(Collectors.toList());
.map(GrantedAuthority::getAuthority).toList();

return new UserInfo(auth.getName(), authorities);
}
Expand Down