1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
From: Fridrich Strba <fstrba@suse.com>
Date: Sat, 25 Oct 2025 07:30:12 +0000
Subject: Fix build with java 23
1) Thread.stop and ThreadGroup.stop are deprecated since 1.2 and removed
in Java 23. Before that, they only throw UnsupportedOperationException
when called. So call them by reflection and if they don't exist, just
ignore them.
2) Implement the new WindowPeer interface method
getAppropriateGraphicsConfiguration as a pass-through method
Fixes #46.
---
.../bdj/java-j2se/java/awt/peer/BDFramePeer.java | 4 ++++
.../bdj/java-j2se/org/videolan/PortingHelper.java | 22 ++++++++++++++++++++--
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java b/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java
index 87895de..4514408 100644
--- a/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java
+++ b/src/libbluray/bdj/java-j2se/java/awt/peer/BDFramePeer.java
@@ -157,6 +157,10 @@ public class BDFramePeer extends BDComponentPeer implements FramePeer
return true;
}
+ public GraphicsConfiguration getAppropriateGraphicsConfiguration(GraphicsConfiguration gc) {
+ return gc;
+ }
+
//
// ComponentPeer
//
diff --git a/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java b/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java
index 1cb5f43..55fd1c2 100644
--- a/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java
+++ b/src/libbluray/bdj/java-j2se/org/videolan/PortingHelper.java
@@ -19,14 +19,32 @@
package org.videolan;
+import java.lang.reflect.InvocationTargetException;
+
public class PortingHelper {
public static void stopThread(Thread t) {
- t.stop();
+ try {
+ Thread.class.getMethod("stop").invoke(t);
+ } catch (NoSuchMethodException e) {
+ // ignore
+ } catch (IllegalAccessException e) {
+ // ignore
+ } catch (InvocationTargetException e) {
+ // ignore
+ }
}
public static void stopThreadGroup(ThreadGroup t) {
- t.stop();
+ try {
+ ThreadGroup.class.getMethod("stop").invoke(t);
+ } catch (NoSuchMethodException e) {
+ // ignore
+ } catch (IllegalAccessException e) {
+ // ignore
+ } catch (InvocationTargetException e) {
+ // ignore
+ }
}
public static String dumpStack(Thread t) {
|