diff --git a/eclipse/VaadinJavaConventions.xml b/eclipse/VaadinJavaConventions.xml index 62061d817a4..0ca130f61cb 100644 --- a/eclipse/VaadinJavaConventions.xml +++ b/eclipse/VaadinJavaConventions.xml @@ -48,7 +48,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -242,7 +242,7 @@ - + diff --git a/flow-data/src/main/java/com/vaadin/flow/data/binder/HasValidator.java b/flow-data/src/main/java/com/vaadin/flow/data/binder/HasValidator.java index aacc0fabcf9..028042f4eee 100644 --- a/flow-data/src/main/java/com/vaadin/flow/data/binder/HasValidator.java +++ b/flow-data/src/main/java/com/vaadin/flow/data/binder/HasValidator.java @@ -74,31 +74,33 @@ default Validator getDefaultValidator() { * public class DatePickerDemo implements HasValidator<LocalDate> { * * // Each web component has a way to communicate its validation status - * // to its server-side component instance. The following clientSideValid - * // state is introduced here just for the sake of simplicity of this code + * // to its server-side component instance. The following + * // clientSideValid + * // state is introduced here just for the sake of simplicity of this + * // code * // snippet: * boolean clientSideValid = true; * * /** - * * Note how clientSideValid engaged in the definition - * * of this method. It is important to reflect this status either - * * in the returning validation result of this method or any other - * * validation that is associated with this component. - * */ + * * Note how clientSideValid engaged in the definition of + * * this method. It is important to reflect this status either in the + * * returning validation result of this method or any other validation + * * that is associated with this component. + * */ * @Override * public Validator getDefaultValidator() { - * return (value, valueContext) -> clientSideValid ? ValidationResult.ok() + * return (value, valueContext) -> clientSideValid + * ? ValidationResult.ok() * : ValidationResult.error("Invalid date format"); * } * - * private final Collection<ValidationStatusChangeListener<LocalDate>> - * validationStatusListeners = new ArrayList<>(); + * private final Collection<ValidationStatusChangeListener<LocalDate>> validationStatusListeners = new ArrayList<>(); * * /** * * This enables the binding to subscribe for the validation status * * change events that are fired by this component and revalidate * * itself respectively. - * */ + * */ * @Override * public Registration addValidationStatusChangeListener( * ValidationStatusChangeListener<LocalDate> listener) { diff --git a/flow-data/src/test/java/com/vaadin/flow/data/provider/DataCommunicatorTest.java b/flow-data/src/test/java/com/vaadin/flow/data/provider/DataCommunicatorTest.java index f6e575dc49e..7258ff1f8d3 100644 --- a/flow-data/src/test/java/com/vaadin/flow/data/provider/DataCommunicatorTest.java +++ b/flow-data/src/test/java/com/vaadin/flow/data/provider/DataCommunicatorTest.java @@ -1312,14 +1312,18 @@ public void fetchFromProvider_disablePaging_singleQueryWithLimit() { @Test public void fetchFromProvider_maxLimitValue_pagesCalculatedProperly() { - AbstractDataProviderdataProvider=createDataProvider(42);dataProvider=Mockito.spy(dataProvider); + AbstractDataProvider dataProvider = createDataProvider( + 42); + dataProvider = Mockito.spy(dataProvider); - dataCommunicator.setDataProvider(dataProvider,null);dataCommunicator.setPageSize(2_000_000_000); + dataCommunicator.setDataProvider(dataProvider, null); + dataCommunicator.setPageSize(2_000_000_000); // We check the page number calculation does not lead to integer // overflow, and not throw thus - dataCommunicator.fetchFromProvider(0,Integer.MAX_VALUE); + dataCommunicator.fetchFromProvider(0, Integer.MAX_VALUE); - Mockito.verify(dataProvider,Mockito.times(1)).fetch(Mockito.any(Query.class)); + Mockito.verify(dataProvider, Mockito.times(1)) + .fetch(Mockito.any(Query.class)); } @Test diff --git a/flow-data/src/test/java/com/vaadin/flow/data/validator/BeanValidatorTest.java b/flow-data/src/test/java/com/vaadin/flow/data/validator/BeanValidatorTest.java index 4f11446bc71..7ad2890f99a 100644 --- a/flow-data/src/test/java/com/vaadin/flow/data/validator/BeanValidatorTest.java +++ b/flow-data/src/test/java/com/vaadin/flow/data/validator/BeanValidatorTest.java @@ -69,7 +69,8 @@ public void testInvalidDecimalsFailsInFrench() { @Test public void testAddressNestedPropertyInvalidPostalCodeFails() { - assertFails(100_000,"must be less than or equal to 99999",validator("address.postalCode")); + assertFails(100_000, "must be less than or equal to 99999", + validator("address.postalCode")); } @Test diff --git a/flow-data/src/test/java/com/vaadin/flow/data/validator/RangeValidatorTest.java b/flow-data/src/test/java/com/vaadin/flow/data/validator/RangeValidatorTest.java index 1f55fb198cd..283158f24cb 100644 --- a/flow-data/src/test/java/com/vaadin/flow/data/validator/RangeValidatorTest.java +++ b/flow-data/src/test/java/com/vaadin/flow/data/validator/RangeValidatorTest.java @@ -109,9 +109,12 @@ public void testNullLessThanEverything() { @Test public void testDateRange() { - RangeValidatorv=RangeValidator.of("Date must be in 2016",LocalDate.of(2016,1,1),LocalDate.of(2016,12,31)); + RangeValidator v = RangeValidator.of("Date must be in 2016", + LocalDate.of(2016, 1, 1), LocalDate.of(2016, 12, 31)); - assertFails(LocalDate.ofEpochDay(0),v);assertPasses(LocalDate.of(2016,7,31),v);assertFails(LocalDate.ofEpochDay(1_000_000_000),v); + assertFails(LocalDate.ofEpochDay(0), v); + assertPasses(LocalDate.of(2016, 7, 31), v); + assertFails(LocalDate.ofEpochDay(1_000_000_000), v); } } diff --git a/flow-server/src/main/java/com/vaadin/flow/router/MenuData.java b/flow-server/src/main/java/com/vaadin/flow/router/MenuData.java index becfcdfac4c..1c326b25887 100644 --- a/flow-server/src/main/java/com/vaadin/flow/router/MenuData.java +++ b/flow-server/src/main/java/com/vaadin/flow/router/MenuData.java @@ -26,7 +26,8 @@ *

* Only for read as data is immutable. */ -public record MenuData(String title, Double order, boolean exclude, String icon, Class menuClass) implements Serializable { +public record MenuData(String title, Double order, boolean exclude, String icon, + Class menuClass) implements Serializable { /** * MenuData constructor. diff --git a/flow-server/src/main/java/com/vaadin/flow/server/dau/DAUUtils.java b/flow-server/src/main/java/com/vaadin/flow/server/dau/DAUUtils.java index a949eea77dd..9f574b224fe 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/dau/DAUUtils.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/dau/DAUUtils.java @@ -322,7 +322,7 @@ private static VaadinRequest createVaadinRequest( * the enforcement messages or null if enforcement should not be * applied * @param origin - * the exception that caused the enforcement + * the exception that caused the enforcement * @param endRequestAction * the action to be run at the end of the request */ diff --git a/flow-server/src/main/java/com/vaadin/flow/server/menu/AvailableViewInfo.java b/flow-server/src/main/java/com/vaadin/flow/server/menu/AvailableViewInfo.java index e4012e9fd49..89e78b19d63 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/menu/AvailableViewInfo.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/menu/AvailableViewInfo.java @@ -29,22 +29,32 @@ /** * Represents a view configuration for use with a menu. * - * @param title title of view - * @param rolesAllowed logged in roles allowed for view - * @param loginRequired requires login - * @param route path string - * @param lazy lazy loaded - * @param register register view - * @param menu menu item information - * @param children view children - * @param routeParameters view parameters - * @param flowLayout if server layout should be used + * @param title + * title of view + * @param rolesAllowed + * logged in roles allowed for view + * @param loginRequired + * requires login + * @param route + * path string + * @param lazy + * lazy loaded + * @param register + * register view + * @param menu + * menu item information + * @param children + * view children + * @param routeParameters + * view parameters + * @param flowLayout + * if server layout should be used */ public record AvailableViewInfo(String title, String[] rolesAllowed, - boolean loginRequired, String route, boolean lazy, - boolean register, MenuData menu, - List children, @JsonProperty( - "params") Map routeParameters, boolean flowLayout) implements Serializable { + boolean loginRequired, String route, boolean lazy, boolean register, + MenuData menu, List children, + @JsonProperty("params") Map routeParameters, + boolean flowLayout) implements Serializable { @Override public boolean equals(final Object o) { @@ -67,22 +77,20 @@ public boolean equals(final Object o) { @Override public int hashCode() { - int result = Objects.hash(title, loginRequired, route, lazy, register, menu, routeParameters); + int result = Objects.hash(title, loginRequired, route, lazy, register, + menu, routeParameters); result = 31 * result + Arrays.hashCode(rolesAllowed); return result; } @Override public String toString() { - return "AvailableViewInfo{" + "title='" + title - + '\'' + ", rolesAllowed=" + Arrays.toString(rolesAllowed) - + ", loginRequired=" + loginRequired - + ", route='" + route + '\'' - + ", lazy=" + lazy - + ", register=" + register - + ", menu=" + menu - + ", flowLayout=" + flowLayout - + ", routeParameters=" + routeParameters + '}'; + return "AvailableViewInfo{" + "title='" + title + '\'' + + ", rolesAllowed=" + Arrays.toString(rolesAllowed) + + ", loginRequired=" + loginRequired + ", route='" + route + + '\'' + ", lazy=" + lazy + ", register=" + register + ", menu=" + + menu + ", flowLayout=" + flowLayout + ", routeParameters=" + + routeParameters + '}'; } } diff --git a/flow-server/src/main/java/com/vaadin/flow/server/menu/MenuEntry.java b/flow-server/src/main/java/com/vaadin/flow/server/menu/MenuEntry.java index 8d3944a6606..3c89f9b5764 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/menu/MenuEntry.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/menu/MenuEntry.java @@ -40,6 +40,6 @@ * annotation or null if not available. Always null for * Hilla/TypeScript client views. */ -public record MenuEntry(String path, String title, Double order, - String icon, Class menuClass) implements Serializable { +public record MenuEntry(String path, String title, Double order, String icon, + Class menuClass) implements Serializable { } diff --git a/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushMessage.java b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushMessage.java index 42ffbf2712a..2aeef24496e 100644 --- a/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushMessage.java +++ b/flow-webpush/src/main/java/com/vaadin/flow/server/webpush/WebPushMessage.java @@ -26,13 +26,16 @@ * * @since 24.2 */ -public record WebPushMessage(String title, String body) implements Serializable { +public record WebPushMessage(String title, + String body) implements Serializable { /** * Creates a new Web Push notification message with title and body. * - * @param title notification title - * @param body notification body + * @param title + * notification title + * @param body + * notification body */ public WebPushMessage { } diff --git a/vaadin-dev-server/src/main/java/com/vaadin/base/devserver/ServerInfo.java b/vaadin-dev-server/src/main/java/com/vaadin/base/devserver/ServerInfo.java index 3f590cde15b..32fdb367395 100644 --- a/vaadin-dev-server/src/main/java/com/vaadin/base/devserver/ServerInfo.java +++ b/vaadin-dev-server/src/main/java/com/vaadin/base/devserver/ServerInfo.java @@ -28,8 +28,8 @@ */ public class ServerInfo implements Serializable { - public record NameAndVersion(String name, String version) - implements Serializable { + public record NameAndVersion(String name, + String version) implements Serializable { }; private List versions = new ArrayList<>(); diff --git a/vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java b/vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java index 55e1f9c9689..5fdb95e810c 100644 --- a/vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java +++ b/vaadin-spring/src/main/java/com/vaadin/flow/spring/io/FilterableResourceResolver.java @@ -119,7 +119,8 @@ public class FilterableResourceResolver private List blockedJarsList; private record PackageInfo(Set allowedPackages, - Set blockedPackages, boolean blockedJar) implements Serializable { + Set blockedPackages, + boolean blockedJar) implements Serializable { } /** diff --git a/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/NavigationAccessControlConfigurer.java b/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/NavigationAccessControlConfigurer.java index 0793f9c8dd4..3a01283f367 100644 --- a/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/NavigationAccessControlConfigurer.java +++ b/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/NavigationAccessControlConfigurer.java @@ -55,7 +55,8 @@ * {@link NavigationAccessControlConfigurer} bean. * *

- * {@code @Bean
+ * {@code
+ * @Bean
  * NavigationAccessControlConfigurer navigationAccessControlConfigurer() {
  *     return new NavigationAccessControlConfigurer()
  *             .withRoutePathAccessChecker().withLoginView(LoginView.class);
@@ -70,7 +71,8 @@
  * prevent cyclic dependencies errors.
  *
  * 
- * {@code @Bean
+ * {@code
+ * @Bean
  * class SecurityConfig extends VaadinWebSecurity {
  *     static NavigationAccessControlConfigurer navigationAccessControlConfigurer() {
  *         return new NavigationAccessControlConfigurer()
diff --git a/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/SpringAccessPathChecker.java b/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/SpringAccessPathChecker.java
index 34433919a04..19e56925de6 100644
--- a/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/SpringAccessPathChecker.java
+++ b/vaadin-spring/src/main/java/com/vaadin/flow/spring/security/SpringAccessPathChecker.java
@@ -42,7 +42,8 @@
  * method.
  *
  * 
- * {@code @Bean
+ * {@code
+ * @Bean
  * NavigationAccessControlConfigurer navigationAccessControlConfigurer() {
  *     return new NavigationAccessControlConfigurer()
  *             .withRoutePathAccessChecker().withLoginView(LoginView.class);