diff options
author | Sven Göthel <[email protected]> | 2024-01-05 15:31:28 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-05 15:31:28 +0100 |
commit | a41468b95a9a09d407e944cfb3633904cff0d4a5 (patch) | |
tree | cb88e738bc58ccd08d40de49afb45091f5e84220 /src/java | |
parent | 92ddcc2426101f0f3e549d3a8a13e4b785996107 (diff) |
JoalVersion: Avoid using Map.of(..), i.e. streaming API to be compatible w/ JRE 1.8.0
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/com/jogamp/openal/JoalVersion.java | 24 |
1 files 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<String, Integer> 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()); } |