From: jprocter Date: Thu, 8 Mar 2007 13:14:30 +0000 (+0000) Subject: remove unnecessary existence checks. X-Git-Tag: Release_0.2~169 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=072605343e509712550096c62a0b567a2892c9a2;p=vamsas.git remove unnecessary existence checks. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@351 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/uk/ac/vamsas/client/simpleclient/FileLock.java b/src/uk/ac/vamsas/client/simpleclient/FileLock.java index ef29f47..c7d6150 100644 --- a/src/uk/ac/vamsas/client/simpleclient/FileLock.java +++ b/src/uk/ac/vamsas/client/simpleclient/FileLock.java @@ -34,8 +34,11 @@ public class FileLock extends Lock { try { advisory=new NativeLock(_lock, block); } catch (Exception e) { - log.fatal("Failed to create advisory lock file "+_lock,e); - throw new Error("Failed to create advisory lock file "+_lock); + if (!_lock.exists()) { + // advisory cannot be created. this is serious. + log.fatal("Failed to create advisory lock file "+_lock,e); + throw new Error("Failed to create advisory lock file "+_lock); + } } return advisory.isLocked(); }