Print header line only if the line is not empty, i.e. the keyHeaders and/or...

Print header line only if the line is not empty, i.e. the keyHeaders and/or processor headers are given
parent 2fc77460
......@@ -63,7 +63,8 @@ public abstract class OutputFile<K extends Comparable<K>> {
}
private void printHeader(PrintWriter out) {
if (keyHeaders.length > 0) {
// Print headers only if the line is not empty, i.e. the keyHeaders and/or processor headers are given
if (keyHeaders.length + this.processors.stream().map(p -> p.getHeaders().length).reduce(0, (x,y) -> x+y) > 0) {
final List<String> fieldHeaders = composeLine(keyHeaders, p -> Arrays.stream(p.getHeaders()));
writeLine(out, fieldHeaders);
}
......
......@@ -7,7 +7,7 @@ import org.vadere.simulator.projects.io.JsonConverter;
public class SnapshotProcessor extends Processor<NoDataKey, String> {
public SnapshotProcessor() {
super("");
super(new String[] { });
}
@Override
......
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