Commit 72e26805 authored by Jakob Schöttl's avatar Jakob Schöttl

Add comment and sorted() to avoid future bugs

parent a1396962
......@@ -56,7 +56,8 @@ public abstract class OutputFile<K extends Comparable<K>> {
: String.join(SEPARATOR.toString(), this.keyHeaders) + SEPARATOR)
+ this.processors.stream().map(p -> String.join(SEPARATOR.toString(), p.getHeaders()) + SEPARATOR).reduce("", (s1, s2) -> s1 + s2), SEPARATOR.toString()));
this.processors.stream().flatMap(p -> p.getKeys().stream()).distinct()
this.processors.stream().flatMap(p -> p.getKeys().stream())
.distinct().sorted()
.forEach(key -> printRow(out, key));
out.flush();
......
......@@ -21,7 +21,7 @@ public abstract class Processor<K extends Comparable<K>, V> {
protected Processor(final String... headers) {
this.headers = headers;
this.column = new TreeMap<>();
this.column = new TreeMap<>(); // TreeMap to avoid sorting data later
this.lastStep = 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment