From b4e846e4206e688050b659f2d66581d26e3dc1ce Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Wed, 17 May 2017 16:26:41 +0300 Subject: [PATCH] Check head.state file existence before validating its integrity This prevents unnecessary NoSuchFileExceptions from being logged at startup. refs #7124 Change-Id: I500c937ec8894f6c97dcfe73b01efc4adc9b59a6 --- .../org.simantics.acorn/src/org/simantics/acorn/HeadState.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/HeadState.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/HeadState.java index ea54a4185..106134264 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/HeadState.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/HeadState.java @@ -99,6 +99,8 @@ public class HeadState { } public static boolean validateHeadStateIntegrity(Path headState) { + if (!Files.exists(headState)) + return false; try { byte[] bytes = Files.readAllBytes(headState); MessageDigest sha1 = MessageDigest.getInstance(SHA_1); -- 2.47.1