aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlia Motornyi <elmot@vaadin.com>2018-06-01 15:07:50 +0300
committerGitHub <noreply@github.com>2018-06-01 15:07:50 +0300
commit0528aaafa32cec6346e6dc3e8eb0bea02055e2ee (patch)
tree0dc1c7a4ffe8ae78011e9ca0d033c3fcbbdfbdd6
parentda114a17112a82ee5d188bc5d27d1df8c3a889bc (diff)
downloadvaadin-framework-0528aaafa32cec6346e6dc3e8eb0bea02055e2ee.tar.gz
vaadin-framework-0528aaafa32cec6346e6dc3e8eb0bea02055e2ee.zip
Fix small formatting issues (#10960)
-rw-r--r--server/src/main/java/com/vaadin/data/Binder.java4
-rw-r--r--server/src/main/java/com/vaadin/server/GlobalResourceHandler.java1
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinServlet.java4
-rw-r--r--server/src/test/java/com/vaadin/server/GlobalResourceHandlerTest.java24
-rw-r--r--testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java5
5 files changed, 22 insertions, 16 deletions
diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java
index 3e9c8c4a13..92d1d58cb6 100644
--- a/server/src/main/java/com/vaadin/data/Binder.java
+++ b/server/src/main/java/com/vaadin/data/Binder.java
@@ -2189,8 +2189,8 @@ public class Binder<BEAN> implements Serializable {
* <p>
* Added listener is notified every time whenever any bound field value is
* changed, i.e. the UI component value was changed, passed all the
- * conversions and validations then propagated to the bound bean field. The same
- * functionality can be achieved by adding a
+ * conversions and validations then propagated to the bound bean field. The
+ * same functionality can be achieved by adding a
* {@link ValueChangeListener} to all fields in the {@link Binder}.
* <p>
* The listener is added to all fields regardless of whether the method is
diff --git a/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java b/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java
index 1d1ffc3467..e4280e8967 100644
--- a/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java
+++ b/server/src/main/java/com/vaadin/server/GlobalResourceHandler.java
@@ -122,7 +122,6 @@ public class GlobalResourceHandler implements RequestHandler {
return true;
}
-
private String urlEncodedKey(String key) {
// getPathInfo return path decoded but without decoding plus as spaces
return ResourceReference.encodeFileName(key.replace("+", " "));
diff --git a/server/src/main/java/com/vaadin/server/VaadinServlet.java b/server/src/main/java/com/vaadin/server/VaadinServlet.java
index 0efdcb406e..ec4c425ff5 100644
--- a/server/src/main/java/com/vaadin/server/VaadinServlet.java
+++ b/server/src/main/java/com/vaadin/server/VaadinServlet.java
@@ -777,7 +777,7 @@ public class VaadinServlet extends HttpServlet implements Constants {
* otherwise.
* @throws IOException
* @throws ServletException
- *
+ *
* @since
*/
protected boolean serveStaticResources(HttpServletRequest request,
@@ -801,7 +801,7 @@ public class VaadinServlet extends HttpServlet implements Constants {
* @param response
* @throws IOException
* @throws ServletException
- *
+ *
* @since
*/
protected void serveStaticResourcesInVAADIN(String filename,
diff --git a/server/src/test/java/com/vaadin/server/GlobalResourceHandlerTest.java b/server/src/test/java/com/vaadin/server/GlobalResourceHandlerTest.java
index 55663148d9..46d6d71cc5 100644
--- a/server/src/test/java/com/vaadin/server/GlobalResourceHandlerTest.java
+++ b/server/src/test/java/com/vaadin/server/GlobalResourceHandlerTest.java
@@ -18,20 +18,26 @@ import static org.mockito.Mockito.when;
public class GlobalResourceHandlerTest {
@Test
- public void globalResourceHandlerShouldWorkWithEncodedFilename() throws IOException {
+ public void globalResourceHandlerShouldWorkWithEncodedFilename()
+ throws IOException {
assertEncodedFilenameIsHandled("simple.txt", "simple.txt");
assertEncodedFilenameIsHandled("with spaces.txt", "with+spaces.txt");
assertEncodedFilenameIsHandled("with # hash.txt", "with+%23+hash.txt");
- assertEncodedFilenameIsHandled("with ; semicolon.txt", "with+%3B+semicolon.txt");
- assertEncodedFilenameIsHandled("with , comma.txt", "with+%2C+comma.txt");
+ assertEncodedFilenameIsHandled("with ; semicolon.txt",
+ "with+%3B+semicolon.txt");
+ assertEncodedFilenameIsHandled("with , comma.txt",
+ "with+%2C+comma.txt");
- // ResourceReference.encodeFileName does not encode slashes and backslashes
+ // ResourceReference.encodeFileName does not encode slashes and
+ // backslashes
// See comment inside2 method for more details
- assertEncodedFilenameIsHandled("with \\ backslash.txt", "with+\\+backslash.txt");
+ assertEncodedFilenameIsHandled("with \\ backslash.txt",
+ "with+\\+backslash.txt");
assertEncodedFilenameIsHandled("with / slash.txt", "with+/+slash.txt");
}
- private void assertEncodedFilenameIsHandled(String filename, String expectedFilename) throws IOException {
+ private void assertEncodedFilenameIsHandled(String filename,
+ String expectedFilename) throws IOException {
DownloadStream stream = mock(DownloadStream.class);
ConnectorResource resource = mock(ConnectorResource.class);
when(resource.getFilename()).thenReturn(filename);
@@ -58,11 +64,13 @@ public class GlobalResourceHandlerTest {
VaadinResponse response = mock(VaadinResponse.class);
// getPathInfo return path decoded but without decoding plus as spaces
- when(request.getPathInfo()).thenReturn("APP/global/0/legacy/0/"+ filename.replace(" ", "+"));
+ when(request.getPathInfo()).thenReturn(
+ "APP/global/0/legacy/0/" + filename.replace(" ", "+"));
when(session.getUIById(anyInt())).thenReturn(ui);
// Verify that decoded path info is correctly handled
- assertTrue("Request not handled", handler.handleRequest(session, request, response));
+ assertTrue("Request not handled",
+ handler.handleRequest(session, request, response));
verify(stream).writeResponse(request, response);
}
}
diff --git a/testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java b/testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java
index 42f162fe11..71de712624 100644
--- a/testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java
+++ b/testbench-api/src/main/java/com/vaadin/testbench/elements/ColorPickerPreviewElement.java
@@ -36,9 +36,8 @@ public class ColorPickerPreviewElement extends CssLayoutElement {
public boolean getColorFieldContainsErrors() {
List<WebElement> caption = findElements(
By.className("v-caption-v-colorpicker-preview-textfield"));
- return !caption.isEmpty() &&
- !caption.get(0).findElements(By.className("v-errorindicator"))
- .isEmpty();
+ return !caption.isEmpty() && !caption.get(0)
+ .findElements(By.className("v-errorindicator")).isEmpty();
}
/**