MNG-5314: DefaultModelValidator misuses String.matches

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1362731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2012-07-18 00:55:48 +00:00
parent 6b4a2a602b
commit 1cf318c15c
1 changed files with 3 additions and 2 deletions

View File

@ -26,6 +26,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import org.apache.maven.model.Build;
import org.apache.maven.model.BuildBase;
@ -61,7 +62,7 @@ public class DefaultModelValidator
implements ModelValidator
{
private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+";
private static final Pattern ID_REGEX = Pattern.compile("[A-Za-z0-9_\\-.]+");
private static final String ILLEGAL_FS_CHARS = "\\/:\"<>|?*";
@ -625,7 +626,7 @@ public class DefaultModelValidator
}
else
{
boolean match = id.matches( ID_REGEX );
boolean match = ID_REGEX.matcher( id ).matches();
if ( !match )
{
addViolation( problems, severity, version, fieldName, sourceHint, "with value '" + id