mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-20 06:22:10 +01:00
return a clone of changeset paging result to fix pre processor behavior
This commit is contained in:
@@ -94,10 +94,10 @@ public class BlameResult implements Cloneable
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a clone of this {@link blameResult} object.
|
||||
* Create a clone of this {@link BlameResult} object.
|
||||
*
|
||||
*
|
||||
* @return clone of this {@link blameResult}
|
||||
* @return clone of this {@link BlameResult}
|
||||
*
|
||||
* @since 1.17
|
||||
*/
|
||||
|
||||
@@ -109,21 +109,26 @@ public class Changeset extends BasicPropertiesAware
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Create a clone of this {@link Changeset} object.
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @return clone of this {@link Changeset}
|
||||
*
|
||||
* @since 1.17
|
||||
*/
|
||||
@Override
|
||||
public Changeset clone()
|
||||
{
|
||||
Changeset changeset = new Changeset(id, date, author, description);
|
||||
Changeset changeset = null;
|
||||
|
||||
changeset.setBranches(branches);
|
||||
changeset.setTags(tags);
|
||||
changeset.setModifications(modifications);
|
||||
changeset.setProperties(properties);
|
||||
changeset.setParents(parents);
|
||||
try
|
||||
{
|
||||
changeset = (Changeset) super.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return changeset;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
*/
|
||||
@XmlRootElement(name = "changeset-paging")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class ChangesetPagingResult implements Iterable<Changeset>
|
||||
public class ChangesetPagingResult implements Iterable<Changeset>, Cloneable
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -74,6 +74,31 @@ public class ChangesetPagingResult implements Iterable<Changeset>
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a clone of this {@link ChangesetPagingResult} object.
|
||||
*
|
||||
*
|
||||
* @return clone of this {@link ChangesetPagingResult}
|
||||
*
|
||||
* @since 1.17
|
||||
*/
|
||||
@Override
|
||||
public ChangesetPagingResult clone()
|
||||
{
|
||||
ChangesetPagingResult changesetPagingResult = null;
|
||||
|
||||
try
|
||||
{
|
||||
changesetPagingResult = (ChangesetPagingResult) super.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return changesetPagingResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -58,7 +58,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement(name = "modifications")
|
||||
public class Modifications implements Serializable
|
||||
public class Modifications implements Cloneable, Serializable
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
@@ -113,6 +113,31 @@ public class Modifications implements Serializable
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a clone of this {@link Modifications} object.
|
||||
*
|
||||
*
|
||||
* @return clone of this {@link Modifications}
|
||||
*
|
||||
* @since 1.17
|
||||
*/
|
||||
@Override
|
||||
public Modifications clone()
|
||||
{
|
||||
Modifications modifications = null;
|
||||
|
||||
try
|
||||
{
|
||||
modifications = (Modifications) super.clone();
|
||||
}
|
||||
catch (CloneNotSupportedException ex)
|
||||
{
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
|
||||
return modifications;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
|
||||
@@ -214,6 +214,7 @@ public final class LogCommandBuilder
|
||||
|
||||
if (!disablePreProcessors && (changeset != null))
|
||||
{
|
||||
changeset = changeset.clone();
|
||||
preProcessorUtil.prepareForReturn(repository, changeset);
|
||||
}
|
||||
|
||||
@@ -271,6 +272,7 @@ public final class LogCommandBuilder
|
||||
|
||||
if (!disablePreProcessors && (cpr != null))
|
||||
{
|
||||
cpr = cpr.clone();
|
||||
preProcessorUtil.prepareForReturn(repository, cpr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user