Bug 355011 - prevent Color leaks via parallel creation

The missing colors could be created by multiple threads, but only one
instance will be later disposed, leading to possible SWT leaks.

Change-Id: I86f296f80c17a5d630a6fc7770883ef0ff95297b
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ColorManager.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ColorManager.java
index 9742699..7e90647 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ColorManager.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/ColorManager.java
@@ -45,8 +45,13 @@
 	public Color getColor(RGB rgb) {
 		Color color = fColorTable.get(rgb);
 		if (color == null) {
-			PlatformUI.getWorkbench().getDisplay().syncExec(() -> fColorTable.put(rgb, new Color(Display.getCurrent(), rgb)));
-			color = fColorTable.get(rgb);
+			synchronized (fColorTable) {
+				color = fColorTable.get(rgb);
+				if (color == null) {
+					PlatformUI.getWorkbench().getDisplay().syncExec(() -> fColorTable.put(rgb, new Color(Display.getCurrent(), rgb)));
+					color = fColorTable.get(rgb);
+				}
+			}
 		}
 		return color;
 	}