From a41468b95a9a09d407e944cfb3633904cff0d4a5 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Fri, 5 Jan 2024 15:31:28 +0100 Subject: JoalVersion: Avoid using Map.of(..), i.e. streaming API to be compatible w/ JRE 1.8.0 --- src/java/com/jogamp/openal/JoalVersion.java | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/java/com/jogamp/openal/JoalVersion.java b/src/java/com/jogamp/openal/JoalVersion.java index 0de3687..b17bbb8 100644 --- a/src/java/com/jogamp/openal/JoalVersion.java +++ b/src/java/com/jogamp/openal/JoalVersion.java @@ -35,7 +35,6 @@ import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.JogampVersion; import com.jogamp.openal.util.ALHelpers; -import java.util.Map; import java.util.jar.Manifest; public class JoalVersion extends JogampVersion { @@ -166,17 +165,22 @@ public class JoalVersion extends JogampVersion { .append(softEventsIsPresent ? "supported" : "unsupported"); sb.append(Platform.getNewline()); if (softEventsIsPresent) { - for (final Map.Entry event : Map.of( - "ALC_EVENT_TYPE_DEVICE_ADDED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEVICE_ADDED_SOFT, - "ALC_EVENT_TYPE_DEVICE_REMOVED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEVICE_REMOVED_SOFT, - "ALC_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT - ).entrySet()) { - final int playbackSupported = alExt.alcEventIsSupportedSOFT(event.getValue(), ALExtConstants.ALC_PLAYBACK_DEVICE_SOFT); - sb.append(" ").append(event.getKey()).append(" event for playback devices is ") + class EventType { + public final String key; + public final int value; + EventType(final String k, final int i) { key = k; value = i; } + } + final EventType[] events = { + new EventType("ALC_EVENT_TYPE_DEVICE_ADDED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEVICE_ADDED_SOFT), + new EventType("ALC_EVENT_TYPE_DEVICE_REMOVED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEVICE_REMOVED_SOFT), + new EventType("ALC_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT", ALExtConstants.ALC_EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT) }; + for (final EventType event : events) { + final int playbackSupported = alExt.alcEventIsSupportedSOFT(event.value, ALExtConstants.ALC_PLAYBACK_DEVICE_SOFT); + sb.append(" ").append(event.key).append(" event for playback devices is ") .append(playbackSupported == ALExtConstants.ALC_EVENT_SUPPORTED_SOFT ? "supported" : "unsupported"); sb.append(Platform.getNewline()); - final int captureSupported = alExt.alcEventIsSupportedSOFT(event.getValue(), ALExtConstants.ALC_CAPTURE_DEVICE_SOFT); - sb.append(" ").append(event.getKey()).append(" event for capture devices is ") + final int captureSupported = alExt.alcEventIsSupportedSOFT(event.value, ALExtConstants.ALC_CAPTURE_DEVICE_SOFT); + sb.append(" ").append(event.key).append(" event for capture devices is ") .append(captureSupported == ALExtConstants.ALC_EVENT_SUPPORTED_SOFT ? "supported" : "unsupported"); sb.append(Platform.getNewline()); } -- cgit v1.2.3