improve changeset api

This commit is contained in:
Sebastian Sdorra
2011-04-18 17:55:59 +02:00
parent 5697dbd92c
commit 270b9cfeaa
2 changed files with 33 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ import sonia.scm.util.Util;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -262,6 +263,11 @@ public class Changeset implements Validateable, Cloneable, Serializable
*/
public List<String> getBranches()
{
if (branches == null)
{
branches = new ArrayList<String>();
}
return branches;
}
@@ -306,6 +312,11 @@ public class Changeset implements Validateable, Cloneable, Serializable
*/
public Modifications getModifications()
{
if (modifications == null)
{
modifications = new Modifications();
}
return modifications;
}
@@ -317,6 +328,11 @@ public class Changeset implements Validateable, Cloneable, Serializable
*/
public List<String> getTags()
{
if (tags == null)
{
tags = new ArrayList<String>();
}
return tags;
}

View File

@@ -39,10 +39,11 @@ import sonia.scm.util.Util;
//~--- JDK imports ------------------------------------------------------------
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
@@ -199,6 +200,11 @@ public class Modifications
*/
public List<String> getAdded()
{
if (added == null)
{
added = new ArrayList<String>();
}
return added;
}
@@ -210,6 +216,11 @@ public class Modifications
*/
public List<String> getModified()
{
if (modified == null)
{
modified = new ArrayList<String>();
}
return modified;
}
@@ -221,6 +232,11 @@ public class Modifications
*/
public List<String> getRemoved()
{
if (removed == null)
{
removed = new ArrayList<String>();
}
return removed;
}