mirror of https://github.com/apache/maven.git
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:
parent
6b4a2a602b
commit
1cf318c15c
|
@ -26,6 +26,7 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.maven.model.Build;
|
import org.apache.maven.model.Build;
|
||||||
import org.apache.maven.model.BuildBase;
|
import org.apache.maven.model.BuildBase;
|
||||||
|
@ -61,7 +62,7 @@ public class DefaultModelValidator
|
||||||
implements ModelValidator
|
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 = "\\/:\"<>|?*";
|
private static final String ILLEGAL_FS_CHARS = "\\/:\"<>|?*";
|
||||||
|
|
||||||
|
@ -625,7 +626,7 @@ public class DefaultModelValidator
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
boolean match = id.matches( ID_REGEX );
|
boolean match = ID_REGEX.matcher( id ).matches();
|
||||||
if ( !match )
|
if ( !match )
|
||||||
{
|
{
|
||||||
addViolation( problems, severity, version, fieldName, sourceHint, "with value '" + id
|
addViolation( problems, severity, version, fieldName, sourceHint, "with value '" + id
|
||||||
|
|
Loading…
Reference in New Issue