o Fixed NPE

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@833726 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-11-07 18:16:36 +00:00
parent 185d5a07c8
commit e61887bbc2
1 changed files with 7 additions and 7 deletions

View File

@ -382,17 +382,17 @@ public class DefaultModelValidator
boolean warning = request.getValidationLevel() < ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0;
String msg;
if ( StringUtils.isEmpty( existing.getVersion() ) && StringUtils.isEmpty( dependency.getVersion() ) )
if ( StringUtils.clean( existing.getVersion() ).equals( StringUtils.clean( dependency.getVersion() ) ) )
{
msg = "duplicate declaration";
}
else if ( existing.getVersion().equals( dependency.getVersion() ) )
{
msg = "duplicate declaration of version " + dependency.getVersion();
msg =
"duplicate declaration of version "
+ StringUtils.defaultString( dependency.getVersion(), "(?)" );
}
else
{
msg = "version " + existing.getVersion() + " vs " + dependency.getVersion();
msg =
"version " + StringUtils.defaultString( existing.getVersion(), "(?)" ) + " vs "
+ StringUtils.defaultString( dependency.getVersion(), "(?)" );
}
addViolation( problems, warning, "'" + prefix