getKey() is used many-many-many times when loading projects. it's ineffective to construct the key each time.

Ideally the cached key would get reste when groupId or artifactId gets set, I didn't figure how to do it in modello though..

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@650427 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Milos Kleint 2008-04-22 09:27:45 +00:00
parent 007fe63a03
commit 02367233e1
1 changed files with 7 additions and 1 deletions

View File

@ -3008,12 +3008,18 @@
return executionMap;
}
//TODO we shall reset key variable when groupId/artifactId change
private String key = null;
/**
* @return the key of the plugin, ie <code>groupId:artifactId</code>
*/
public String getKey()
{
return constructKey( groupId, artifactId );
if ( key == null )
{
key = constructKey( groupId, artifactId );
}
return key;
}
/**