[libbluray-devel] Remove useless try {} catch {}

ace20022 git at videolan.org
Fri Nov 28 10:24:04 CET 2014


libbluray | branch: master | ace20022 <ace20022 at ymail.com> | Fri Nov 28 11:19:05 2014 +0200| [891be060dd7a872ef68afb1cf84b7d0faae6cb9b] | committer: hpi1

Remove useless try {} catch {}

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=891be060dd7a872ef68afb1cf84b7d0faae6cb9b
---

 .../bdj/java-j2se/org/videolan/LockFile.java          |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/libbluray/bdj/java-j2se/org/videolan/LockFile.java b/src/libbluray/bdj/java-j2se/org/videolan/LockFile.java
index d1940fa..2d347cd 100644
--- a/src/libbluray/bdj/java-j2se/org/videolan/LockFile.java
+++ b/src/libbluray/bdj/java-j2se/org/videolan/LockFile.java
@@ -33,17 +33,14 @@ class LockFile {
         try {
             RandomAccessFile os = new RandomAccessFile(path, "rw");
             if (os.getChannel().tryLock() != null) {
-                try {
-                    /* Test if locking works: second tryLock() should fail */
-                    if (os.getChannel().tryLock() != null) {
-                        try {
-                            os.close();
-                        } catch (Exception e) {
-                        }
-                        logger.error("File locking is unreliable !");
-                        return null;
+                /* Test if locking works: second tryLock() should fail */
+                if (os.getChannel().tryLock() != null) {
+                    try {
+                        os.close();
+                    } catch (Exception e) {
                     }
-                } catch (Exception e) {
+                    logger.error("File locking is unreliable !");
+                    return null;
                 }
                 return new LockFile(os);
             } else {



More information about the libbluray-devel mailing list