diff options
Diffstat (limited to 'netx/net/sourceforge/jnlp/cache/CacheUtil.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/cache/CacheUtil.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/netx/net/sourceforge/jnlp/cache/CacheUtil.java b/netx/net/sourceforge/jnlp/cache/CacheUtil.java index bb88325..4143738 100644 --- a/netx/net/sourceforge/jnlp/cache/CacheUtil.java +++ b/netx/net/sourceforge/jnlp/cache/CacheUtil.java @@ -165,23 +165,20 @@ public class CacheUtil { try { if (otherJavawsRunning.isFile()) { FileOutputStream fis = new FileOutputStream(otherJavawsRunning); - try { - FileChannel channel = fis.getChannel(); - if (channel.tryLock() == null) { - if (JNLPRuntime.isDebug()) { - System.out.println("Other instances of netx are running"); - } - return false; - } - + + FileChannel channel = fis.getChannel(); + if (channel.tryLock() == null) { if (JNLPRuntime.isDebug()) { - System.out.println("No other instances of netx are running"); + System.out.println("Other instances of netx are running"); } - return true; + return false; + } - } finally { - fis.close(); + if (JNLPRuntime.isDebug()) { + System.out.println("No other instances of netx are running"); } + return true; + } else { if (JNLPRuntime.isDebug()) { System.out.println("No instance file found"); |