mirror of https://github.com/apache/maven.git
o Optimized performance (the string concatenation in getId() severely affected ReactorArtifactRepository which in turn is heavily used for key calculation/comparision in the plugin & metadata cache)
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@795939 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4363bdecef
commit
9a6561c6f6
|
@ -1598,18 +1598,27 @@ public class MavenProject
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
MavenProject otherProject = (MavenProject) other;
|
||||
|
||||
return getId().equals( otherProject.getId() );
|
||||
MavenProject that = (MavenProject) other;
|
||||
|
||||
return eq( getArtifactId(), that.getArtifactId() )
|
||||
&& eq( getGroupId(), that.getGroupId() )
|
||||
&& eq( getVersion(), that.getVersion() );
|
||||
}
|
||||
|
||||
private static <T> boolean eq( T s1, T s2 )
|
||||
{
|
||||
return ( s1 != null ) ? s1.equals( s2 ) : s2 == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return getId().hashCode();
|
||||
int hash = 17;
|
||||
hash = 31 * hash + getGroupId().hashCode();
|
||||
hash = 31 * hash + getArtifactId().hashCode();
|
||||
hash = 31 * hash + getVersion().hashCode();
|
||||
return hash;
|
||||
}
|
||||
|
||||
public List<Extension> getBuildExtensions()
|
||||
|
|
Loading…
Reference in New Issue