UMLGraph
UMLGraph copied to clipboard
Dot having problems with paths longer than 255 characters?
The following applies to UMLGraph 5.6_6.1 SNAPSHOT with graphviz 2.34.zip
I had a problem with dot when running UMLGraph after I made a change to the output location. Since the change rendered longer paths to target and source I started suspecting a maximum path length problem with dot.
I made some changes in the function "runGraphviz" of the file UmlGraphDoc.java.
Basically the idea is to change working directory to where the files are and run dot there with no path prepended. It fixed the problem.
I'm lacking possibility to paste the full code here but this is a snippet:
private static void RunGraphViz(...) {
if(dotExecutable == null {
dotExecutable = "dot";
}
File outFolder = new File(outputFolder, packageName.replace(".", "/") + "/");
File dotFile = new File(name + ".dot");
File pngFile = new File(name + ".png");
File mapFile = new File(name + ".map");
ProcessBuilder pb = new ProcessBuilder(dotExecutable, "-Tcmapx", "-o", mapFile.getName(), "-Tpng", "-o", pngFile.getName(), dotFile.getName());
pb.directory(outFolder);
try {
Process p = pb.start();
.
.
.
<The rest of the function unchanged>
Many thanks for the proposed change! Can you please fork the project from GitHub supply the change as a pull request?
Ok, will try to do that.
There is a small problem though. The computer and source code environment where the problem occurred and was fixed is on an isolated environment with no GitHub access. Hence I need to create a setup (not allowed to copy the work code) where the problem is reproduced on a connected environment. Further I have never done any work using GitHub before and have basic knowledge of Git so it would take some time. It would be fun though.
Sorry for my late reply, I thought I would get feedback via mail but haven't seen any. Just checked manually now out of curiosity.
Great, I will be expecting it! I'm sure you will find it interesting working with git and GitHub.
Note that if you have git and email in the isolated environment you can email a git-compatible patch over to the computer with the GitHub access.