394719 remove regex from classpath matching

This commit is contained in:
Greg Wilkins 2012-11-22 15:41:01 +11:00
parent 1f368d269d
commit 597649d4aa

View File

@ -189,16 +189,24 @@ public class ClasspathPattern
if (_entries != null)
{
name = name.replace('/','.');
name = name.replaceFirst("^[.]+","");
name = name.replaceAll("\\$.*$","");
int startIndex = 0;
while(startIndex < name.length() && name.charAt(startIndex) == '.') {
startIndex++;
}
int dollar = name.indexOf("$");
int endIndex = dollar != -1 ? dollar : name.length();
for (Entry entry : _entries)
{
if (entry != null)
{
if (entry.partial)
{
if (name.startsWith(entry.classpath))
if (name.regionMatches(startIndex, entry.classpath, 0, entry.classpath.length()))
{
result = entry.result;
break;
@ -206,7 +214,9 @@ public class ClasspathPattern
}
else
{
if (name.equals(entry.classpath))
int regionLength = endIndex-startIndex;
if (regionLength == entry.classpath.length()
&& name.regionMatches(startIndex, entry.classpath, 0, regionLength))
{
result = entry.result;
break;