Skip to content

Commit 7c40dca

Browse files
authored
Bump JavaFX to 17.0.15/24.0.1 (#3927)
1 parent 48e3f79 commit 7c40dca

8 files changed

Lines changed: 794 additions & 436 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/util/SelfDependencyPatcher.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,18 @@ private static final class DependencyDescriptor {
107107
static List<DependencyDescriptor> readDependencies() {
108108
//noinspection ConstantConditions
109109
try (Reader reader = new InputStreamReader(SelfDependencyPatcher.class.getResourceAsStream(DEPENDENCIES_LIST_FILE), UTF_8)) {
110-
Map<String, List<DependencyDescriptor>> allDependencies =
111-
JsonUtils.GSON.fromJson(reader, mapTypeOf(String.class, listTypeOf(DependencyDescriptor.class)));
112-
return allDependencies.get(Platform.getPlatform().toString());
110+
Map<String, Map<String, List<DependencyDescriptor>>> allDependencies =
111+
JsonUtils.GSON.fromJson(reader, mapTypeOf(String.class, mapTypeOf(String.class, listTypeOf(DependencyDescriptor.class))));
112+
Map<String, List<DependencyDescriptor>> platform = allDependencies.get(Platform.getPlatform().toString());
113+
if (platform == null)
114+
return null;
115+
116+
if (JavaRuntime.CURRENT_VERSION >= 22) {
117+
List<DependencyDescriptor> modernDependencies = platform.get("modern");
118+
if (modernDependencies != null)
119+
return modernDependencies;
120+
}
121+
return platform.get("classic");
113122
} catch (IOException e) {
114123
throw new UncheckedIOException(e);
115124
}

0 commit comments

Comments
 (0)