Skip to content
Snippets Groups Projects
Commit 0321cc85 authored by Sören Henning's avatar Sören Henning
Browse files

avoid empty attributes

parent 9fb63b13
No related branches found
No related tags found
1 merge request!17Get impletemented stages and Java 8
Pipeline #
...@@ -84,7 +84,7 @@ public class DotGraphWriter { ...@@ -84,7 +84,7 @@ public class DotGraphWriter {
public void addNode(final String id, final Map<String, String> attributes) throws IOException { public void addNode(final String id, final Map<String, String> attributes) throws IOException {
checkState(DotWriterState.STARTED); checkState(DotWriterState.STARTED);
if (attributes == null) { if (attributes == null || attributes.isEmpty()) {
writer.writeln('"' + id + '"'); writer.writeln('"' + id + '"');
} else { } else {
writer.writeln('"' + id + '"' + ' ' + assembleAttributes(attributes)); writer.writeln('"' + id + '"' + ' ' + assembleAttributes(attributes));
...@@ -105,7 +105,7 @@ public class DotGraphWriter { ...@@ -105,7 +105,7 @@ public class DotGraphWriter {
edgeConnector = DotGraph.DIRECTED_EDGE_CONNECTOR; edgeConnector = DotGraph.DIRECTED_EDGE_CONNECTOR;
} }
if (attributes == null) { if (attributes == null || attributes.isEmpty()) {
writer.writeln('"' + sourceId + '"' + ' ' + edgeConnector + ' ' + '"' + targetId + '"'); writer.writeln('"' + sourceId + '"' + ' ' + edgeConnector + ' ' + '"' + targetId + '"');
} else { } else {
writer.writeln('"' + sourceId + '"' + ' ' + edgeConnector + ' ' + '"' + targetId + '"' + ' ' + assembleAttributes(attributes)); writer.writeln('"' + sourceId + '"' + ' ' + edgeConnector + ' ' + '"' + targetId + '"' + ' ' + assembleAttributes(attributes));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment