diff options
Diffstat (limited to 'server')
6 files changed, 33 insertions, 30 deletions
diff --git a/server/src/main/java/com/vaadin/data/converter/StringToUuidConverter.java b/server/src/main/java/com/vaadin/data/converter/StringToUuidConverter.java index 5d9436789f..185da51557 100644 --- a/server/src/main/java/com/vaadin/data/converter/StringToUuidConverter.java +++ b/server/src/main/java/com/vaadin/data/converter/StringToUuidConverter.java @@ -29,8 +29,8 @@ import com.vaadin.data.ValueContext; * Leading and trailing white spaces are ignored when converting from a String. * </p> * <p> - * The String representation uses the canonical format of 32-characters with a hyphen - * to separate each of five groups of hexadecimal digits as defined in: + * The String representation uses the canonical format of 32-characters with a + * hyphen to separate each of five groups of hexadecimal digits as defined in: * RFC 4122: A Universally Unique IDentifier (UUID) URN Namespace * http://www.ietf.org/rfc/rfc4122.txt * </p> @@ -38,33 +38,35 @@ import com.vaadin.data.ValueContext; * @author Vaadin Ltd * @since 8.8 */ -public class StringToUuidConverter implements Converter <String, UUID> { +public class StringToUuidConverter implements Converter<String, UUID> { private ErrorMessageProvider errorMessageProvider; /** * Constructs a converter for String to UUID and back. * - * @param errorMessage the error message to use if conversion fails + * @param errorMessage + * the error message to use if conversion fails */ public StringToUuidConverter(String errorMessage) { this(ctx -> errorMessage); } /** - * Constructs a new converter instance with the given error message provider. - * Empty strings are converted to <code>null</code>. + * Constructs a new converter instance with the given error message + * provider. Empty strings are converted to <code>null</code>. * - * @param errorMessageProvider the error message provider to use if conversion fails + * @param errorMessageProvider + * the error message provider to use if conversion fails */ public StringToUuidConverter(ErrorMessageProvider errorMessageProvider) { this.errorMessageProvider = errorMessageProvider; } @Override - public Result <UUID> convertToModel(String value, ValueContext context) { + public Result<UUID> convertToModel(String value, ValueContext context) { if (value == null) { - return Result.ok( null ); + return Result.ok(null); } // Remove leading and trailing white space @@ -79,21 +81,22 @@ public class StringToUuidConverter implements Converter <String, UUID> { } if (null != uuid) { - return Result.ok(uuid); // Return the UUID object, converted from String. + return Result.ok(uuid); // Return the UUID object, converted from + // String. } else { - return Result.error( this.errorMessageProvider.apply(context) ); + return Result.error(this.errorMessageProvider.apply(context)); } } @Override - public String convertToPresentation (UUID value, ValueContext context) { - if ( value == null ) { + public String convertToPresentation(UUID value, ValueContext context) { + if (value == null) { return null; } // `java.util.UUID::toString` generates a textual representation of a // UUID’s 128-bits as a lowercase hexadecimal `String` in canonical // 32-character format with four hyphens separating groups of digits. // https://docs.oracle.com/javase/10/docs/api/java/util/UUID.html#toString() - return value.toString(); + return value.toString(); } } diff --git a/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java b/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java index 0e59784d76..7059c4cbd3 100644 --- a/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java +++ b/server/src/main/java/com/vaadin/server/BrowserWindowOpener.java @@ -71,11 +71,11 @@ public class BrowserWindowOpener extends AbstractExtension { * Creates a window opener that will open windows containing the provided UI * class. * <p> - * Note: The new UI instance will not work with dependency injection (CDI and - * Spring). Use {@link BrowserWindowOpener(String)} instead. - * {@code VaadinServlet.getCurrent().getServletContext().getContextPath()} gives - * the current context path. - * + * Note: The new UI instance will not work with dependency injection (CDI + * and Spring). Use {@link BrowserWindowOpener(String)} instead. + * {@code VaadinServlet.getCurrent().getServletContext().getContextPath()} + * gives the current context path. + * * @param uiClass * the UI class that should be opened when the extended component * is clicked @@ -90,8 +90,8 @@ public class BrowserWindowOpener extends AbstractExtension { * <p> * Note: The new UI instance will not work with dependency injection (CDI * and Spring). Use {@link BrowserWindowOpener(String)} instead. - * {@code VaadinServlet.getCurrent().getServletContext().getContextPath()} gives - * the current context path. + * {@code VaadinServlet.getCurrent().getServletContext().getContextPath()} + * gives the current context path. * * @param uiClass * the UI class that should be opened when the extended component diff --git a/server/src/main/java/com/vaadin/ui/ComboBox.java b/server/src/main/java/com/vaadin/ui/ComboBox.java index 8fadca6c35..b4d9a97c78 100644 --- a/server/src/main/java/com/vaadin/ui/ComboBox.java +++ b/server/src/main/java/com/vaadin/ui/ComboBox.java @@ -465,15 +465,15 @@ public class ComboBox<T> extends AbstractSingleSelect<T> .test(getItemCaptionOfItem(item), filterText)); } - // Helper method for the above to make lambda more readable + // Helper method for the above to make lambda more readable private String getItemCaptionOfItem(T item) { String caption = getItemCaptionGenerator().apply(item); if (caption == null) { caption = ""; - } + } return caption; } - + /** * Sets the data items of this listing and a simple string filter with which * the item string and the text the user has input are compared. diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 06a38cd8f5..74cd9a4626 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -1599,7 +1599,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, } /** - * Returns the width (in pixels). By default a column width is + * Returns the width (in pixels). By default a column width is * {@value com.vaadin.shared.ui.grid.GridConstants#DEFAULT_COLUMN_WIDTH_PX} * (undefined). * @@ -2804,7 +2804,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * @param nestedNullBehavior * the behavior when * @return the newly added column, not <code>null</code> - * + * * @since 8.8 */ public Column<T, ?> addColumn(String propertyName, diff --git a/server/src/main/java/com/vaadin/ui/Slider.java b/server/src/main/java/com/vaadin/ui/Slider.java index a8190c3850..7afd53da4b 100644 --- a/server/src/main/java/com/vaadin/ui/Slider.java +++ b/server/src/main/java/com/vaadin/ui/Slider.java @@ -259,9 +259,9 @@ public class Slider extends AbstractField<Double> { } /** - * Sets the slider to update its value when the user clicks on it. - * By default, the slider value is updated by dragging the slider's handle - * or clicking arrows. + * Sets the slider to update its value when the user clicks on it. By + * default, the slider value is updated by dragging the slider's handle or + * clicking arrows. * * @param updateValueOnClick * {@code true} to update the value of the slider on click, diff --git a/server/src/test/java/com/vaadin/server/CustomJSONSerializerTest.java b/server/src/test/java/com/vaadin/server/CustomJSONSerializerTest.java index 0c8b69fe62..cbcdfebd85 100644 --- a/server/src/test/java/com/vaadin/server/CustomJSONSerializerTest.java +++ b/server/src/test/java/com/vaadin/server/CustomJSONSerializerTest.java @@ -12,7 +12,7 @@ import com.vaadin.ui.ConnectorTracker; import elemental.json.JsonValue; public class CustomJSONSerializerTest { - + public static class Foo { } |