aboutsummaryrefslogtreecommitdiffstats
path: root/api/src/main
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-05-14 00:18:52 +0200
committerSven Gothel <[email protected]>2014-05-14 00:18:52 +0200
commit174953022b62681653db1f57b087581e29313f5b (patch)
treea3fbb37e3f8baef05abd34ac9729492a5b96de36 /api/src/main
parentc4930f9d23ae7515434942836f628f767411876c (diff)
Dumper: Add dump method for sorted List<Difference> (refactored) allowing dumping separate diff-types
Diffstat (limited to 'api/src/main')
-rwxr-xr-xapi/src/main/java/org/semver/Dumper.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/api/src/main/java/org/semver/Dumper.java b/api/src/main/java/org/semver/Dumper.java
index a60f87b..be63cb2 100755
--- a/api/src/main/java/org/semver/Dumper.java
+++ b/api/src/main/java/org/semver/Dumper.java
@@ -164,7 +164,6 @@ public class Dumper {
}
/**
- *
* Dumps on <code>out</code> all differences.
*
* @param differences
@@ -173,6 +172,16 @@ public class Dumper {
public static void dump(final Delta delta, final PrintStream out) {
final List<Difference> sortedDifferences = new LinkedList<Difference>(delta.getDifferences());
Collections.sort(sortedDifferences);
+ dump(sortedDifferences, out);
+ }
+
+ /**
+ * Dumps on <code>out</code> all of the given sorted differences.
+ *
+ * @param sortedDifferences
+ * @param out
+ */
+ public static void dump(final List<Difference> sortedDifferences, final PrintStream out) {
String currentClassName = "";
for (final Difference difference : sortedDifferences) {
if (!currentClassName.equals(difference.getClassName())) {
@@ -182,5 +191,4 @@ public class Dumper {
currentClassName = difference.getClassName();
}
}
-
}