@Test public void testMatchWithEmptyFilterShouldNotMatchNonEmptyText() { String textToFilter = "a"; String filter = ""; boolean result = underTest.match(filter, textToFilter); Assert.assertFalse(result); }
public boolean match(final String filter, final String expr) { String inFilter = filter.trim(); while ((from1 < inFilter.length()) && (from2 < expr.length() && !resultFound)) { pos = filter.indexOf(joker, from1); if (noStar(pos)) { determineNoStarResult(expr, inFilter); } else { handleStar(expr, inFilter); } } if (!resultFound) { result = from1 == filter.length() && from2 == expr.length() || from1 == filter.length() && wasJoker; } return result; }
SimpleMatcher { public boolean match(final String filter, final String expr) { String inFilter = filter.trim(); while ((from1 < inFilter.length()) && (from2 < expr.length() && !resultFound)) { pos = filter.indexOf(joker, from1); if (noStar(pos)) { determineNoStarResult(expr, inFilter); } else { handleStar(expr, inFilter); } } if (!resultFound) { result = from1 == filter.length() && from2 == expr.length() || from1 == filter.length() && wasJoker; } return result; } }
SimpleMatcher { public boolean match(final String filter, final String expr) { String inFilter = filter.trim(); while ((from1 < inFilter.length()) && (from2 < expr.length() && !resultFound)) { pos = filter.indexOf(joker, from1); if (noStar(pos)) { determineNoStarResult(expr, inFilter); } else { handleStar(expr, inFilter); } } if (!resultFound) { result = from1 == filter.length() && from2 == expr.length() || from1 == filter.length() && wasJoker; } return result; } SimpleMatcher(final String joker); }
SimpleMatcher { public boolean match(final String filter, final String expr) { String inFilter = filter.trim(); while ((from1 < inFilter.length()) && (from2 < expr.length() && !resultFound)) { pos = filter.indexOf(joker, from1); if (noStar(pos)) { determineNoStarResult(expr, inFilter); } else { handleStar(expr, inFilter); } } if (!resultFound) { result = from1 == filter.length() && from2 == expr.length() || from1 == filter.length() && wasJoker; } return result; } SimpleMatcher(final String joker); boolean match(final String filter, final String expr); }
SimpleMatcher { public boolean match(final String filter, final String expr) { String inFilter = filter.trim(); while ((from1 < inFilter.length()) && (from2 < expr.length() && !resultFound)) { pos = filter.indexOf(joker, from1); if (noStar(pos)) { determineNoStarResult(expr, inFilter); } else { handleStar(expr, inFilter); } } if (!resultFound) { result = from1 == filter.length() && from2 == expr.length() || from1 == filter.length() && wasJoker; } return result; } SimpleMatcher(final String joker); boolean match(final String filter, final String expr);  }