From: Tuukka Lehtonen Date: Wed, 17 May 2017 13:26:41 +0000 (+0300) Subject: Check head.state file existence before validating its integrity X-Git-Tag: v1.28.0~5 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F32%2F532%2F1;p=simantics%2Fplatform.git Check head.state file existence before validating its integrity This prevents unnecessary NoSuchFileExceptions from being logged at startup. refs #7124 Change-Id: I500c937ec8894f6c97dcfe73b01efc4adc9b59a6 --- 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);