diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2018-06-12 10:06:41 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-06-12 10:06:41 +0300 |
commit | 16335d3abad58420013e261d4fdc57ee3e867a27 (patch) | |
tree | 5ed8c487e7e38ff5dc2fb40a00113f4ba79702e3 | |
parent | 1ce112b409f0f8c68e8d9c0901002fb27e1cb2bd (diff) | |
download | vaadin-framework-16335d3abad58420013e261d4fdc57ee3e867a27.tar.gz vaadin-framework-16335d3abad58420013e261d4fdc57ee3e867a27.zip |
Fix formatting of some files (#10972)
-rw-r--r-- | server/src/main/java/com/vaadin/ui/AbstractDateField.java | 2 | ||||
-rw-r--r-- | server/src/test/java/com/vaadin/tests/server/component/datefield/DateFieldErrorMessageTest.java | 29 |
2 files changed, 19 insertions, 12 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractDateField.java b/server/src/main/java/com/vaadin/ui/AbstractDateField.java index 841ad0392e..5fdd3bb788 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractDateField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractDateField.java @@ -117,7 +117,7 @@ public abstract class AbstractDateField<T extends Temporal & TemporalAdjuster & currentParseErrorMessage = null; if (newDateString == null || newDateString.isEmpty()) { boolean valueChanged = setValue(newDate, true); - if(!valueChanged && parseErrorWasSet) { + if (!valueChanged && parseErrorWasSet) { doSetValue(newDate); } } else { diff --git a/server/src/test/java/com/vaadin/tests/server/component/datefield/DateFieldErrorMessageTest.java b/server/src/test/java/com/vaadin/tests/server/component/datefield/DateFieldErrorMessageTest.java index 2172a6f6b8..34dfdaf5e3 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/datefield/DateFieldErrorMessageTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/datefield/DateFieldErrorMessageTest.java @@ -39,11 +39,14 @@ public class DateFieldErrorMessageTest public void testErrorMessageRemoved() throws Exception { InlineDateField field = new InlineDateField("Day is", LocalDate.of(2003, 2, 27)); - checkValueAndComponentError(field, "2003-02-27", LocalDate.of(2003, 2, 27), false); + checkValueAndComponentError(field, "2003-02-27", + LocalDate.of(2003, 2, 27), false); checkValueAndComponentError(field, "", null, false); - checkValueAndComponentError(field, "2003-04-27", LocalDate.of(2003, 4, 27), false); + checkValueAndComponentError(field, "2003-04-27", + LocalDate.of(2003, 4, 27), false); checkValueAndComponentError(field, "foo", null, true); - checkValueAndComponentError(field, "2013-07-03", LocalDate.of(2013, 7, 3), false); + checkValueAndComponentError(field, "2013-07-03", + LocalDate.of(2013, 7, 3), false); checkValueAndComponentError(field, "foo", null, true); checkValueAndComponentError(field, "", null, false); } @@ -58,25 +61,29 @@ public class DateFieldErrorMessageTest return InlineDateField.class; } - private void checkValueAndComponentError(InlineDateField field, String newInput, LocalDate expectedFieldValue, boolean componentErrorExpected) throws Exception { + private void checkValueAndComponentError(InlineDateField field, + String newInput, LocalDate expectedFieldValue, + boolean componentErrorExpected) throws Exception { setDateByText(field, newInput); assertEquals(expectedFieldValue, field.getValue()); - assertEquals(componentErrorExpected, field.getComponentError()!=null); + assertEquals(componentErrorExpected, field.getComponentError() != null); } - private void setDateByText(InlineDateField field, String dateText) throws Exception { + private void setDateByText(InlineDateField field, String dateText) + throws Exception { Field rcpField = AbstractDateField.class.getDeclaredField("rpc"); rcpField.setAccessible(true); - AbstractDateFieldServerRpc rcp = (AbstractDateFieldServerRpc)rcpField.get(field); - Map<String, Integer> resolutions=new HashMap<String, Integer>(); + AbstractDateFieldServerRpc rcp = (AbstractDateFieldServerRpc) rcpField + .get(field); + Map<String, Integer> resolutions = new HashMap<String, Integer>(); try { LocalDate date = LocalDate.parse(dateText); resolutions.put(DateResolution.YEAR.name(), date.getYear()); resolutions.put(DateResolution.MONTH.name(), date.getMonthValue()); resolutions.put(DateResolution.DAY.name(), date.getDayOfMonth()); - }catch (Exception e) { - //ignore + } catch (Exception e) { + // ignore } rcp.update(dateText, resolutions); } -}
\ No newline at end of file +} |