[MNG-3400] Implement clone properly following Effective Java' book considerations

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@627935 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Carlos Sanchez Gonzalez 2008-02-15 03:10:09 +00:00
parent 53e9189566
commit 0ca8675e19
1 changed files with 9 additions and 1 deletions

View File

@ -28,9 +28,17 @@ public class StartForkedExecutionMojo
getLog().info( "Starting forked execution [fork id: " + forkId + "]" ); getLog().info( "Starting forked execution [fork id: " + forkId + "]" );
if ( project != null ) if ( project != null )
{
try
{ {
session.addForkedProject( (MavenProject) project.clone() ); session.addForkedProject( (MavenProject) project.clone() );
} }
catch ( CloneNotSupportedException e )
{
throw new IllegalStateException( "MavenProject instance of class " + project.getClass().getName() +
" does not support clone " );
}
}
} }
} }