From 0321cc853d489b71c343574c5a56e12755559135 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <stu114708@informatik.uni-kiel.de>
Date: Mon, 4 Apr 2016 12:01:20 +0200
Subject: [PATCH] avoid empty attributes

---
 .../java/kieker/analysis/graph/util/dot/DotGraphWriter.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/kieker/analysis/graph/util/dot/DotGraphWriter.java b/src/main/java/kieker/analysis/graph/util/dot/DotGraphWriter.java
index 087e09cc..343d8394 100644
--- a/src/main/java/kieker/analysis/graph/util/dot/DotGraphWriter.java
+++ b/src/main/java/kieker/analysis/graph/util/dot/DotGraphWriter.java
@@ -84,7 +84,7 @@ public class DotGraphWriter {
 	public void addNode(final String id, final Map<String, String> attributes) throws IOException {
 		checkState(DotWriterState.STARTED);
 
-		if (attributes == null) {
+		if (attributes == null || attributes.isEmpty()) {
 			writer.writeln('"' + id + '"');
 		} else {
 			writer.writeln('"' + id + '"' + ' ' + assembleAttributes(attributes));
@@ -105,7 +105,7 @@ public class DotGraphWriter {
 			edgeConnector = DotGraph.DIRECTED_EDGE_CONNECTOR;
 		}
 
-		if (attributes == null) {
+		if (attributes == null || attributes.isEmpty()) {
 			writer.writeln('"' + sourceId + '"' + ' ' + edgeConnector + ' ' + '"' + targetId + '"');
 		} else {
 			writer.writeln('"' + sourceId + '"' + ' ' + edgeConnector + ' ' + '"' + targetId + '"' + ' ' + assembleAttributes(attributes));
-- 
GitLab