o Simplified cloning

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@805825 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-08-19 14:47:38 +00:00
parent fc48539c96
commit 374d818a0c
4 changed files with 70 additions and 0 deletions

View File

@ -615,4 +615,21 @@ public class MojoDescriptor
{
return executeGoal;
}
/**
* Creates a shallow copy of this mojo descriptor.
*/
@Override
public MojoDescriptor clone()
{
try
{
return (MojoDescriptor) super.clone();
}
catch ( CloneNotSupportedException e )
{
throw new UnsupportedOperationException( e );
}
}
}

View File

@ -23,6 +23,7 @@ package org.apache.maven.plugin.descriptor;
* @author Jason van Zyl
*/
public class Parameter
implements Cloneable
{
private String alias;
@ -186,4 +187,21 @@ public class Parameter
{
this.since = since;
}
/**
* Creates a shallow copy of this parameter.
*/
@Override
public Parameter clone()
{
try
{
return (Parameter) super.clone();
}
catch ( CloneNotSupportedException e )
{
throw new UnsupportedOperationException( e );
}
}
}

View File

@ -50,6 +50,7 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
*/
public class PluginDescriptor
extends ComponentSetDescriptor
implements Cloneable
{
private static final String LIFECYCLE_DESCRIPTOR = "META-INF/maven/lifecycle.xml";
@ -412,4 +413,20 @@ public class PluginDescriptor
}
}
/**
* Creates a shallow copy of this plugin descriptor.
*/
@Override
public PluginDescriptor clone()
{
try
{
return (PluginDescriptor) super.clone();
}
catch ( CloneNotSupportedException e )
{
throw new UnsupportedOperationException( e );
}
}
}

View File

@ -25,6 +25,7 @@ package org.apache.maven.plugin.descriptor;
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
*/
public class Requirement
implements Cloneable
{
private final String role;
@ -51,4 +52,21 @@ public class Requirement
{
return roleHint;
}
/**
* Creates a shallow copy of this requirement.
*/
@Override
public Requirement clone()
{
try
{
return (Requirement) super.clone();
}
catch ( CloneNotSupportedException e )
{
throw new UnsupportedOperationException( e );
}
}
}