From 174953022b62681653db1f57b087581e29313f5b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 14 May 2014 00:18:52 +0200 Subject: Dumper: Add dump method for sorted List (refactored) allowing dumping separate diff-types --- api/src/main/java/org/semver/Dumper.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'api') 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 out all differences. * * @param differences @@ -173,6 +172,16 @@ public class Dumper { public static void dump(final Delta delta, final PrintStream out) { final List sortedDifferences = new LinkedList(delta.getDifferences()); Collections.sort(sortedDifferences); + dump(sortedDifferences, out); + } + + /** + * Dumps on out all of the given sorted differences. + * + * @param sortedDifferences + * @param out + */ + public static void dump(final List 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(); } } - } -- cgit v1.2.3