mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
return a clone of browser result to fix pre processor behavior
This commit is contained in:
@@ -55,7 +55,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
*/
|
*/
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@XmlRootElement(name = "browser-result")
|
@XmlRootElement(name = "browser-result")
|
||||||
public class BrowserResult implements Iterable<FileObject>
|
public class BrowserResult implements Iterable<FileObject>, Cloneable
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,6 +84,31 @@ public class BrowserResult implements Iterable<FileObject>
|
|||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a clone of this {@link BrowserResult} object.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return clone of this {@link BrowserResult}
|
||||||
|
*
|
||||||
|
* @since 1.17
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BrowserResult clone()
|
||||||
|
{
|
||||||
|
BrowserResult browserResult = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
browserResult = (BrowserResult) super.clone();
|
||||||
|
}
|
||||||
|
catch (CloneNotSupportedException ex)
|
||||||
|
{
|
||||||
|
throw new RuntimeException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return browserResult;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -56,6 +56,31 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
public class FileObject implements LastModifiedAware
|
public class FileObject implements LastModifiedAware
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a clone of this {@link FileObject} object.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return clone of this {@link FileObject}
|
||||||
|
*
|
||||||
|
* @since 1.17
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public FileObject clone()
|
||||||
|
{
|
||||||
|
FileObject fileObject = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
fileObject = (FileObject) super.clone();
|
||||||
|
}
|
||||||
|
catch (CloneNotSupportedException ex)
|
||||||
|
{
|
||||||
|
throw new RuntimeException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return fileObject;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "person")
|
@XmlRootElement(name = "person")
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class Person implements Validateable, Serializable
|
public class Person implements Validateable, Serializable, Cloneable
|
||||||
{
|
{
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
@@ -130,6 +130,31 @@ public class Person implements Validateable, Serializable
|
|||||||
return person;
|
return person;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a clone of this {@link Person} object.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return clone of this {@link Person}
|
||||||
|
*
|
||||||
|
* @since 1.17
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Person clone()
|
||||||
|
{
|
||||||
|
Person person = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
person = (Person) super.clone();
|
||||||
|
}
|
||||||
|
catch (CloneNotSupportedException ex)
|
||||||
|
{
|
||||||
|
throw new RuntimeException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return person;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
|||||||
*/
|
*/
|
||||||
@XmlRootElement(name = "subrepository")
|
@XmlRootElement(name = "subrepository")
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
public class SubRepository
|
public class SubRepository implements Cloneable
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,6 +100,31 @@ public class SubRepository
|
|||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a clone of this {@link SubRepository} object.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return clone of this {@link SubRepository}
|
||||||
|
*
|
||||||
|
* @since 1.17
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SubRepository clone()
|
||||||
|
{
|
||||||
|
SubRepository subRepository = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
subRepository = (SubRepository) super.clone();
|
||||||
|
}
|
||||||
|
catch (CloneNotSupportedException ex)
|
||||||
|
{
|
||||||
|
throw new RuntimeException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return subRepository;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -184,6 +184,7 @@ public final class BrowseCommandBuilder
|
|||||||
|
|
||||||
if (!disablePreProcessors && (result != null))
|
if (!disablePreProcessors && (result != null))
|
||||||
{
|
{
|
||||||
|
result = result.clone();
|
||||||
preProcessorUtil.prepareForReturn(repository, result);
|
preProcessorUtil.prepareForReturn(repository, result);
|
||||||
|
|
||||||
List<FileObject> fileObjects = result.getFiles();
|
List<FileObject> fileObjects = result.getFiles();
|
||||||
|
|||||||
Reference in New Issue
Block a user