return a clone of blame result to fix pre processor behavior

This commit is contained in:
Sebastian Sdorra
2012-06-24 19:19:45 +02:00
parent 38502d21e1
commit 19f437d65b
3 changed files with 55 additions and 3 deletions

View File

@@ -43,7 +43,7 @@ import com.google.common.base.Objects;
* @author Sebastian Sdorra
* @since 1.8
*/
public class BlameLine
public class BlameLine implements Cloneable
{
/**
@@ -77,6 +77,31 @@ public class BlameLine
//~--- methods --------------------------------------------------------------
/**
* Create a clone of this {@link BlameLine} object.
*
*
* @return clone of this {@link BlameLine}
*
* @since 1.17
*/
@Override
public BlameLine clone()
{
BlameLine blameLine = null;
try
{
blameLine = (BlameLine) super.clone();
}
catch (CloneNotSupportedException ex)
{
throw new RuntimeException(ex);
}
return blameLine;
}
/**
* {@inheritDoc}
*

View File

@@ -49,7 +49,7 @@ import javax.xml.bind.annotation.XmlRootElement;
/**
* Changeset information by line for a given file.
*
*
* TODO for 2.0 implement {@link Iterable}
*
* @author Sebastian Sdorra
@@ -57,7 +57,7 @@ import javax.xml.bind.annotation.XmlRootElement;
*/
@XmlRootElement(name = "blame-result")
@XmlAccessorType(XmlAccessType.FIELD)
public class BlameResult
public class BlameResult implements Cloneable
{
/**
@@ -93,6 +93,31 @@ public class BlameResult
//~--- methods --------------------------------------------------------------
/**
* Create a clone of this {@link blameResult} object.
*
*
* @return clone of this {@link blameResult}
*
* @since 1.17
*/
@Override
public BlameResult clone()
{
BlameResult blameResult = null;
try
{
blameResult = (BlameResult) super.clone();
}
catch (CloneNotSupportedException ex)
{
throw new RuntimeException(ex);
}
return blameResult;
}
/**
* {@inheritDoc}
*

View File

@@ -188,6 +188,8 @@ public final class BlameCommandBuilder
if (!disablePreProcessors && (result != null))
{
// clone result to fix pre processor behavior
result = result.clone();
preProcessorUtil.prepareForReturn(repository, result);
}