mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-06 12:37:45 +02:00
return a clone of blame result to fix pre processor behavior
This commit is contained in:
@@ -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}
|
||||
*
|
||||
|
||||
@@ -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}
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user