]> source.dussan.org Git - vaadin-framework.git/commitdiff
Code format (#11548)
authorSun Zhe <31067185+ZheSun88@users.noreply.github.com>
Mon, 29 Apr 2019 10:00:28 +0000 (13:00 +0300)
committerSun Zhe <31067185+ZheSun88@users.noreply.github.com>
Mon, 29 Apr 2019 11:29:30 +0000 (14:29 +0300)
* Code format

* Merge branch 'master' into code-format

12 files changed:
server/src/main/java/com/vaadin/data/converter/StringToUuidConverter.java
server/src/main/java/com/vaadin/server/BrowserWindowOpener.java
server/src/main/java/com/vaadin/ui/ComboBox.java
server/src/main/java/com/vaadin/ui/Grid.java
server/src/main/java/com/vaadin/ui/Slider.java
server/src/test/java/com/vaadin/server/CustomJSONSerializerTest.java
uitest/src/main/java/com/vaadin/tests/components/panel/PanelHTMLCaption.java
uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxSelectingNewItemValueChangeTest.java
uitest/src/test/java/com/vaadin/tests/components/panel/PanelHTMLCaptionTest.java
uitest/src/test/java/com/vaadin/tests/components/slider/SliderHandleBaseClickTest.java
uitest/src/test/java/com/vaadin/tests/components/window/WindowHeaderButtonKeyboardActionsTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridIndexedContainerInsertSelectTest.java

index 5d9436789f011a735896a32d512544c4b3d80067..185da515578061398d8b7e5504fa3b6cedeb6809 100644 (file)
@@ -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();
     }
 }
index 0e59784d76f2ccefe2a8e52fafea7abeab127434..7059c4cbd3beaa107b2b681cbaceb3e74b39908b 100644 (file)
@@ -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
index 8fadca6c35c123fb4f784c3a871465a3273ce307..b4d9a97c789a8db63c2f36b5d013634cadeec40d 100644 (file)
@@ -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.
index 06a38cd8f5e1f55e4e579d1750ab6821c34d6aaa..74cd9a4626d1a04f70d306e89dd94f54eb5bbe7d 100644 (file)
@@ -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,
index a8190c3850384ebc7591c68f7c515d030322c969..7afd53da4bb12372420cb146da1dc82bc4cd7619 100644 (file)
@@ -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,
index 0c8b69fe62131317b3bdf16a8c451bcb0dfd4297..cbcdfebd853fae130cf90ab7e251fa9373a1566e 100644 (file)
@@ -12,7 +12,7 @@ import com.vaadin.ui.ConnectorTracker;
 import elemental.json.JsonValue;
 
 public class CustomJSONSerializerTest {
-    
+
     public static class Foo {
 
     }
index bdae0b58c445de07cfadf05d465b12d7e4329590..155e947b14680d8e00a2dad6afbdd13ff478494b 100644 (file)
@@ -28,4 +28,4 @@ public class PanelHTMLCaption extends AbstractTestUI {
         changeCaptionFormat.setId("buttonId");
         addComponent(changeCaptionFormat);
     }
-}
\ No newline at end of file
+}
index 6f6d45cd2a3c290cad25641621d27581314960c8..5088a76b86d6d2824e4310ada7d837aa3107c9a4 100644 (file)
@@ -139,7 +139,8 @@ public class ComboBoxSelectingNewItemValueChangeTest extends MultiBrowserTest {
             SelectionType selectionType) {
         // clear() would cause an additional value change in chrome 70+
         // since it always makes blur after clear()
-        comboBoxElement.sendKeys(Keys.BACK_SPACE, Keys.BACK_SPACE, Keys.BACK_SPACE);
+        comboBoxElement.sendKeys(Keys.BACK_SPACE, Keys.BACK_SPACE,
+                Keys.BACK_SPACE);
         sendKeysToInput(input);
         switch (selectionType) {
         case ENTER:
index e360bfa00af69701f6147a59a01c9467909c4436..519ed0f5495086c8a80631871e579bff4e6f16ef 100644 (file)
@@ -4,7 +4,6 @@ import com.vaadin.tests.tb3.MultiBrowserTest;
 import org.junit.Test;
 import org.openqa.selenium.By;
 
-
 public class PanelHTMLCaptionTest extends MultiBrowserTest {
     @Test
     public void testCaptionDisplayedAsText() {
index 8de82a590fa008f62b9b3702e3ce75647912254f..da262cf9e06711bcd06c669c66e9e8d1839d387f 100644 (file)
@@ -52,7 +52,7 @@ public class SliderHandleBaseClickTest extends MultiBrowserTest {
         sleep(100);
         assertEquals(String.format(
                 "Slider value should not have changed. Expected 3.0 , but was %f",
-                getSliderValue()), 3.0,getSliderValue(), 0.0);
+                getSliderValue()), 3.0, getSliderValue(), 0.0);
         // Enable click event handling
         findElement(By.id("toggleHandling")).click();
     }
index 278d0994c0809ffc6865937438f3efc2ea62f3cb..9d7245bde50e7efc486c9e20176780ea4f7502bd 100644 (file)
@@ -167,8 +167,7 @@ public class WindowHeaderButtonKeyboardActionsTest extends MultiBrowserTest {
                 closeButton.equals(driver.switchTo().activeElement()));
 
         pressKeyAndWait(Keys.ENTER);
-        assertTrue(
-                "Window is not closed when focus is shifted back-and-forth",
+        assertTrue("Window is not closed when focus is shifted back-and-forth",
                 findElements(By.className("v-window")).size() == 0);
     }
 
index e09fa5f560e3a9f9dfdee94042062b46b741abe4..c5c8ea7f105339b88c5ca06c1d9870b5b37c9622 100644 (file)
@@ -20,8 +20,8 @@ public class GridIndexedContainerInsertSelectTest extends SingleBrowserTest {
     }
 
     /**
-     * Test asserting that issue https://github.com/vaadin/framework/issues/11477
-     * is fixed.
+     * Test asserting that issue
+     * https://github.com/vaadin/framework/issues/11477 is fixed.
      */
     @Test
     public void test_insertRowAfterSelected_newRowIsSelected() {