From c0332c621dc656a791bbb14bc946ed2eb0b61ec2 Mon Sep 17 00:00:00 2001 From: PlantUML Date: Tue, 1 Mar 2022 09:31:02 +0100 Subject: [PATCH] Support for Graphviz 3.0 --- .../plantuml/cucadiagram/dot/GraphvizVersionFinder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java index 699481d9c..80189cd25 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java +++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizVersionFinder.java @@ -72,14 +72,15 @@ public class GraphvizVersionFinder { public GraphvizVersion getVersion() { final String dotVersion = dotVersion(); - final Pattern p = Pattern.compile("\\d\\.\\d\\d"); + final Pattern p = Pattern.compile("([23])\\.(\\d\\d?)"); final Matcher m = p.matcher(dotVersion); final boolean find = m.find(); if (find == false) { return DEFAULT; } - final String vv = m.group(0); - final int v = Integer.parseInt(vv.replaceAll("\\.", "")); + final int major = Integer.parseInt(m.group(1)); + final int minor = Integer.parseInt(m.group(2)); + final int v = 100 * major + minor; return new GraphvizVersion() { public boolean useShield() { return v <= 228;