[libbluray-devel] [Git][videolan/libbluray][master] 4 commits: Improve JNI version log message

Petri Hintukainen (@hpi) gitlab at videolan.org
Sun Jul 31 19:36:28 UTC 2022



Petri Hintukainen pushed to branch master at VideoLAN / libbluray


Commits:
cf8b0387 by Petri Hintukainen at 2022-07-30T22:09:33+03:00
Improve JNI version log message

- - - - -
00512462 by hpi1 at 2022-07-31T22:29:26+03:00
BD-J: log JVM version

- - - - -
13b3e665 by hpi1 at 2022-07-31T22:29:26+03:00
Logger: mark variables final

- - - - -
7ad20527 by Petri Hintukainen at 2022-07-31T22:29:26+03:00
Update JVM search paths: add OpenJDK 17 (LTS).

- - - - -


3 changed files:

- src/libbluray/bdj/bdj.c
- src/libbluray/bdj/java/org/videolan/Libbluray.java
- src/libbluray/bdj/java/org/videolan/Logger.java


Changes:

=====================================
src/libbluray/bdj/bdj.c
=====================================
@@ -405,6 +405,7 @@ static void *_load_jvm(const char **p_java_home, const char *app_java_home)
 #    ifdef __FreeBSD__
                                             "/usr/local/openjdk8",
                                             "/usr/local/openjdk11",
+                                            "/usr/local/openjdk17",
 #    else
                                             "/usr/lib/jvm/default-java",
                                             "/usr/lib/jvm/default",
@@ -414,6 +415,8 @@ static void *_load_jvm(const char **p_java_home, const char *app_java_home)
                                             "/usr/lib/jvm/java-8-openjdk-" JAVA_ARCH,
                                             "/usr/lib/jvm/java-11-openjdk",
                                             "/usr/lib/jvm/java-11-openjdk-" JAVA_ARCH,
+                                            "/usr/lib/jvm/java-17-openjdk",
+                                            "/usr/lib/jvm/java-17-openjdk-" JAVA_ARCH,
 #    endif
     };
     static const char * const jvm_dir[]  = {"jre/lib/" JAVA_ARCH "/server",
@@ -1059,7 +1062,7 @@ BDJAVA* bdj_open(const char *path, struct bluray *bd,
 
     if (debug_mask & DBG_JNI) {
         int version = (int)(*env)->GetVersion(env);
-        BD_DEBUG(DBG_BDJ, "Java version: %d.%d\n", version >> 16, version & 0xffff);
+        BD_DEBUG(DBG_BDJ, "Java JNI version: %d.%d\n", version >> 16, version & 0xffff);
     }
 
     if (!_bdj_init(env, bd, path, bdj_disc_id, cfg)) {


=====================================
src/libbluray/bdj/java/org/videolan/Libbluray.java
=====================================
@@ -126,6 +126,11 @@ public class Libbluray {
         }
         initOnce = true;
 
+        Logger.getLogger("Libbluray").info(
+            "Using Java " + System.getProperty("java.vm.specification.version", "?") +
+            " (" + System.getProperty("java.vm.version", "?") + ")" +
+            " from '" + System.getProperty("java.home", "?") + "'");
+
         /* hook system properties (provide Xlet-specific user.dir) */
         try {
             hookProperties();


=====================================
src/libbluray/bdj/java/org/videolan/Logger.java
=====================================
@@ -25,8 +25,11 @@ public class Logger {
     static {
         String prop;
 
-        use_throw = false;
-        use_trace = false;
+        prop = System.getProperty("debug.unimplemented.throw");
+        use_throw = (prop != null && prop.equalsIgnoreCase("YES"));
+
+        prop = System.getProperty("debug.trace");
+        use_trace = (prop == null || !prop.equalsIgnoreCase("NO"));
 
         // capture stdout and stderr from on-disc applets
         // (those produce useful debug information sometimes)
@@ -36,15 +39,6 @@ public class Logger {
         } catch (java.io.UnsupportedEncodingException uee) {
             System.err.println("Error capturing stdout/stderr: " + uee);
         }
-
-        prop = System.getProperty("debug.unimplemented.throw");
-        if (prop != null && prop.equalsIgnoreCase("YES")) {
-            use_throw = true;
-        }
-        prop = System.getProperty("debug.trace");
-        if (prop == null || !prop.equalsIgnoreCase("NO")) {
-            use_trace = true;
-        }
     }
 
     private static class Location {
@@ -190,7 +184,7 @@ public class Logger {
         }
     }
 
-    private String name;
-    private static boolean use_trace;
-    private static boolean use_throw;
+    private final String name;
+    private static final boolean use_trace;
+    private static final boolean use_throw;
 }



View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/8e501bcab48b402653be3ca8ec103217098eb477...7ad20527681e590aa66e89b07f10943f6ed14ef3

-- 
View it on GitLab: https://code.videolan.org/videolan/libbluray/-/compare/8e501bcab48b402653be3ca8ec103217098eb477...7ad20527681e590aa66e89b07f10943f6ed14ef3
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