From ddf84543ab1fbddc0afed03767f094d76ad0bfab Mon Sep 17 00:00:00 2001 From: wilsonwatson Date: Thu, 26 Sep 2024 15:32:03 -0500 Subject: [PATCH] fix bug with terminal instructions --- src/tools/java/frc/tools/VerifyProfiling.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tools/java/frc/tools/VerifyProfiling.java b/src/tools/java/frc/tools/VerifyProfiling.java index 14ed6218..a0f51850 100644 --- a/src/tools/java/frc/tools/VerifyProfiling.java +++ b/src/tools/java/frc/tools/VerifyProfiling.java @@ -5,6 +5,8 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardCopyOption; +import java.nio.file.StandardOpenOption; import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.HashMap; @@ -104,6 +106,8 @@ public void visitLabel(Label label) { if (!reachedTerminal) { current.goesTo.add(newCurrent); newCurrent.comesFrom.add(current); + } else { + reachedTerminal = false; } current = newCurrent; } @@ -216,10 +220,10 @@ public void visitEnd() { .replace(")", "_").replace("/", "_").replace(";", "_") + ".png"); try { Files.createDirectories(p.getParent()); - Files.write(p, sb.toString().getBytes()); + Files.write(p, sb.toString().getBytes(), StandardOpenOption.CREATE); var os = Runtime.getRuntime().exec("dot " + p.toString() + " -Tpng") .getInputStream(); - Files.copy(os, p2); + Files.copy(os, p2, StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { e.printStackTrace(); }