diff options
author | Mehdi Javan <32511762+mehdi-vaadin@users.noreply.github.com> | 2018-06-28 12:25:28 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-06-28 12:25:27 +0300 |
commit | 097395b8bfaecf9d6e89adb5ecb7400e4ddb60bf (patch) | |
tree | a13892e8eaa8d273787dab729530de37b083b613 /uitest/src | |
parent | 441fa7191f2ce3ff9fdf90bcb1bd11081e63a81b (diff) | |
download | vaadin-framework-097395b8bfaecf9d6e89adb5ecb7400e4ddb60bf.tar.gz vaadin-framework-097395b8bfaecf9d6e89adb5ecb7400e4ddb60bf.zip |
Fix DateFieldUnparseableString test UI (#11004)
This patch eliminates the use of Apache Commons StringUtils in the test UI.
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java index b2335922a9..dfd4f86a28 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java +++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java @@ -4,7 +4,6 @@ import com.vaadin.data.Result; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.DateField; -import org.apache.commons.lang3.StringUtils; import java.time.LocalDate; import java.time.Year; @@ -31,7 +30,7 @@ public class DateFieldUnparsableDateString extends AbstractTestUI { protected Result<LocalDate> handleUnparsableDateString( String dateString) { try { - String parseableString = StringUtils.remove(dateString, ' '); + String parseableString = dateString == null ? "" : dateString.replaceAll(" ", ""); if (parseableString.length() % 2 == 1) { parseableString = "0" + parseableString; } @@ -66,7 +65,6 @@ public class DateFieldUnparsableDateString extends AbstractTestUI { .toFormatter())); case 8: // Long year ddMMyyyy - parseableString = StringUtils.leftPad(dateString, 8, "0"); return Result.ok(LocalDate.parse(parseableString, new DateTimeFormatterBuilder() .appendPattern("ddMMyyyy").toFormatter())); |