[libbluray-devel] [Git][videolan/libbluray][master] 3 commits: Log cleanup failure

Petri Hintukainen (@hpi) gitlab at videolan.org
Wed Sep 21 16:02:02 UTC 2022



Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
7e81caae by Petri Hintukainen at 2022-09-21T18:55:55+03:00
Log cleanup failure

- - - - -
215b8bb4 by Petri Hintukainen at 2022-09-21T18:57:43+03:00
Fix return value

- - - - -
2fb14228 by Petri Hintukainen at 2022-09-21T19:00:30+03:00
Silence warning and simplify

- - - - -


4 changed files:

- src/libbluray/bdj/java-j2se/java/io/FileInputStream.java
- src/libbluray/bdj/java/java/io/BDFileSystem.java
- src/libbluray/bdj/java/org/videolan/BDJAppProxy.java
- src/libbluray/bdj/java/org/videolan/VFSCache.java


Changes:

=====================================
src/libbluray/bdj/java-j2se/java/io/FileInputStream.java
=====================================
@@ -73,11 +73,10 @@ public class FileInputStream extends InputStream
 
         if (file.isAbsolute()) {
             String cachedName = BDJLoader.getCachedFile(name);
-            if (cachedName != name) {
+            if (!cachedName.equals(name)) {
                 getLogger().info("Using cached " + cachedName + " for " + name);
-                name = cachedName;
             }
-            openImpl(name);
+            openImpl(cachedName);
         } else {
             /* relative paths are problematic ... */
             /* Those should be mapped to xlet home directory, which is inside .jar file. */


=====================================
src/libbluray/bdj/java/java/io/BDFileSystem.java
=====================================
@@ -228,13 +228,15 @@ public abstract class BDFileSystem extends FileSystem {
     }
 
     public boolean isInvalid(File f) {
+        boolean res = false;
         try {
             Method m = fs.getClass().getDeclaredMethod("isInvalid", new Class[] { File.class });
             Object[] args = new Object[] {(Object)f};
             Boolean result = (Boolean)m.invoke(fs, args);
-            return result.booleanValue();
+            res = result.booleanValue();
         } finally {
-            return false;
+            /* return here will drop all exceptions from try block (and override possible return value from try block) */
+            return res;
         }
     }
 


=====================================
src/libbluray/bdj/java/org/videolan/BDJAppProxy.java
=====================================
@@ -157,7 +157,8 @@ class BDJAppProxy implements DVBJProxy, Runnable {
         context.release();
 
         if (new File(persistentApp).delete()) {
-            new File(persistentOrg).delete();
+            if (!(new File(persistentOrg).delete()))
+                logger.info("Error removing " + persistentOrg);
         }
     }
 


=====================================
src/libbluray/bdj/java/org/videolan/VFSCache.java
=====================================
@@ -137,7 +137,8 @@ class VFSCache {
 
         if (exception != null) {
             logger.error("Error caching " + srcPath + ": " + exception);
-            new File(dstPath).delete();
+            if (!(new File(dstPath).delete()))
+                logger.info("Error removing " + dstPath);
             return false;
         }
 



View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/dc59f1fdc04edc11f26878fa30a7c8269be4b9fd...2fb14228ce01520abef68b0887a5cb5f0054ed5b

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/dc59f1fdc04edc11f26878fa30a7c8269be4b9fd...2fb14228ce01520abef68b0887a5cb5f0054ed5b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the libbluray-devel mailing list