Fixes #673 match all classpath pattern

This commit is contained in:
Greg Wilkins 2016-06-29 14:06:27 +10:00
parent 1f74d10358
commit 2b8416eb8a
2 changed files with 10 additions and 1 deletions

View File

@ -232,7 +232,7 @@ public class ClasspathPattern extends AbstractList<String>
continue;
if (entry._package)
{
if (name.startsWith(entry._name))
if (name.startsWith(entry._name) || ".".equals(entry._pattern))
return entry._inclusive;
}
else

View File

@ -106,4 +106,13 @@ public class ClasspathPatternTest
assertFalse(pattern.match("org.example.Nested$Minus$Else"));
}
@Test
public void testMatchAll()
{
pattern.clear();
pattern.add(".");
assertTrue(pattern.match("org.example.Anything"));
assertTrue(pattern.match("org.example.Anything$Else"));
}
}