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