From 2c209e416140cd490699f689d4ed82d8a9da8876 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Mon, 18 Apr 2011 18:01:40 +0200 Subject: [PATCH] improve changeset viewer --- .../scm/repository/GitChangesetViewer.java | 21 --------------- .../scm/repository/HgChangesetParser.java | 27 +++---------------- 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitChangesetViewer.java b/plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitChangesetViewer.java index 9f5d4b5662..67def68b28 100644 --- a/plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitChangesetViewer.java +++ b/plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitChangesetViewer.java @@ -164,30 +164,17 @@ public class GitChangesetViewer implements ChangesetViewer switch (entry.getChangeType()) { case ADD : - if (modifications.getAdded() == null) - { - modifications.setAdded(new ArrayList()); - } - modifications.getAdded().add(entry.getNewPath()); break; case MODIFY : - if (modifications.getModified() == null) - { - modifications.setModified(new ArrayList()); - } modifications.getModified().add(entry.getNewPath()); break; case DELETE : - if (modifications.getRemoved() == null) - { - modifications.setRemoved(new ArrayList()); - } modifications.getRemoved().add(entry.getOldPath()); @@ -239,14 +226,6 @@ public class GitChangesetViewer implements ChangesetViewer if (tag != null) { - List tagList = changeset.getTags(); - - if (tagList == null) - { - tagList = new ArrayList(); - changeset.setTags(tagList); - } - changeset.getTags().add(tag); } diff --git a/plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgChangesetParser.java b/plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgChangesetParser.java index bb9c24efa6..0f4a97fe41 100644 --- a/plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgChangesetParser.java +++ b/plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgChangesetParser.java @@ -176,15 +176,15 @@ public class HgChangesetParser } else if ("files-added".equals(name)) { - getModifications(changeset).setAdded(getList(value)); + changeset.getModifications().setAdded(getList(value)); } else if ("files-mods".equals(name)) { - getModifications(changeset).setModified(getList(value)); + changeset.getModifications().setModified(getList(value)); } else if ("files-dels".equals(name)) { - getModifications(changeset).setRemoved(getList(value)); + changeset.getModifications().setRemoved(getList(value)); } } } @@ -230,27 +230,6 @@ public class HgChangesetParser return Arrays.asList(value.split(" ")); } - /** - * Method description - * - * - * @param changeset - * - * @return - */ - private Modifications getModifications(Changeset changeset) - { - Modifications mods = changeset.getModifications(); - - if (mods == null) - { - mods = new Modifications(); - changeset.setModifications(mods); - } - - return mods; - } - //~--- fields --------------------------------------------------------------- /** Field description */