416787 StringIndexOutOfBounds with a pathMap of ""
This commit is contained in:
parent
a1cba900c5
commit
67bdc29b9b
|
@ -401,6 +401,9 @@ public class PathMap<O> extends HashMap<String,O>
|
|||
public static boolean match(String pathSpec, String path, boolean noDefault)
|
||||
throws IllegalArgumentException
|
||||
{
|
||||
if (pathSpec.length()==0)
|
||||
return "/".equals(path);
|
||||
|
||||
char c = pathSpec.charAt(0);
|
||||
if (c=='/')
|
||||
{
|
||||
|
|
|
@ -138,6 +138,8 @@ public class PathMapTest
|
|||
assertTrue("!match *.foo", !PathMap.match("*.foo", "anything.bar"));
|
||||
|
||||
assertEquals("match / with ''", "10", p.getMatch("/").getValue());
|
||||
|
||||
assertTrue("match \"\"", PathMap.match("", "/"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue