From c2c4c0df01f6fb0b817aa99dcb850c83d52abf98 Mon Sep 17 00:00:00 2001 From: Franta Pribyl Date: Fri, 3 Oct 2014 19:06:00 +0200 Subject: [PATCH] =?UTF-8?q?Agenda=20Schv=C3=A1len=C3=A9=20polo=C5=BEky=20p?= =?UTF-8?q?o=C5=BEadavk=C5=AF=20=E2=80=A2=20upraveny=20podm=C3=ADnky=20pro?= =?UTF-8?q?=20filtrov=C3=A1n=C3=AD=20m=C4=9Brn=C3=A9=20jednotky?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #149 --- src/main/java/info/bukova/isspst/StringUtils.java | 6 ++++++ src/main/java/info/bukova/isspst/data/MUnitEmb.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/info/bukova/isspst/StringUtils.java b/src/main/java/info/bukova/isspst/StringUtils.java index 71df933f..af9f23b1 100644 --- a/src/main/java/info/bukova/isspst/StringUtils.java +++ b/src/main/java/info/bukova/isspst/StringUtils.java @@ -62,6 +62,12 @@ public class StringUtils { value = StringUtils.nullStr(value).toLowerCase(); search = StringUtils.nullStr(search).toLowerCase(); + + if (search.isEmpty()) + { + return true; + } + return value.startsWith(search); } diff --git a/src/main/java/info/bukova/isspst/data/MUnitEmb.java b/src/main/java/info/bukova/isspst/data/MUnitEmb.java index 59a451de..eac5c9db 100644 --- a/src/main/java/info/bukova/isspst/data/MUnitEmb.java +++ b/src/main/java/info/bukova/isspst/data/MUnitEmb.java @@ -60,7 +60,7 @@ public class MUnitEmb public static boolean isEqualMUnitEmbForFilter(MUnitEmb value, MUnitEmb search) { - if (search == null) + if ((search == null) || (search.getName() == null) || search.getName().isEmpty()) { return true; }