2
0
mirror of https://github.com/HMCL-dev/HMCL.git synced 2025-02-17 17:09:55 +08:00

Suppress compilation warnings ()

* Suppress compilation warnings

* update
This commit is contained in:
Glavo 2023-05-24 22:05:30 +08:00 committed by GitHub
parent 6cb4d24600
commit 9152550bda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 1 deletions
HMCL/src/main/java
moe/mickey/minecraft/skin/fx
org/jackhuang/hmcl/ui
HMCLCore/src/main/java/org/jackhuang/hmcl/auth/yggdrasil

View File

@ -19,6 +19,7 @@ public class SkinTransition extends Transition {
return count; return count;
} }
@SafeVarargs
public SkinTransition(Duration duration, Function<Double, Double> expression, WritableValue<Number>... observables) { public SkinTransition(Duration duration, Function<Double, Double> expression, WritableValue<Number>... observables) {
setCycleDuration(duration); setCycleDuration(duration);
this.expression = expression; this.expression = expression;

View File

@ -39,6 +39,7 @@ import javafx.util.Duration;
import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.FXUtils;
import org.jackhuang.hmcl.util.javafx.MappedObservableList; import org.jackhuang.hmcl.util.javafx.MappedObservableList;
@SuppressWarnings("deprecation")
public class TabHeader extends Control implements TabControl, PageAware { public class TabHeader extends Control implements TabControl, PageAware {
public TabHeader(Tab<?>... tabs) { public TabHeader(Tab<?>... tabs) {

View File

@ -472,6 +472,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
} }
@Override @Override
@SuppressWarnings("unchecked")
public void loadVersion(Profile profile, String versionId) { public void loadVersion(Profile profile, String versionId) {
this.profile = profile; this.profile = profile;
this.versionId = versionId; this.versionId = versionId;
@ -555,7 +556,6 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
} else if (javaAutoDeterminedOption.isSelected()) { } else if (javaAutoDeterminedOption.isSelected()) {
versionSetting.setJavaAutoSelected(); versionSetting.setJavaAutoSelected();
} else { } else {
//noinspection unchecked
versionSetting.setJavaVersion(((Pair<JavaVersionType, JavaVersion>) newValue.getUserData()).getValue()); versionSetting.setJavaVersion(((Pair<JavaVersionType, JavaVersion>) newValue.getUserData()).getValue());
} }
}); });

View File

@ -84,6 +84,7 @@ public class YggdrasilSession {
String name = tryCast(storage.get("displayName"), String.class).orElseThrow(() -> new IllegalArgumentException("displayName is missing")); String name = tryCast(storage.get("displayName"), String.class).orElseThrow(() -> new IllegalArgumentException("displayName is missing"));
String clientToken = tryCast(storage.get("clientToken"), String.class).orElseThrow(() -> new IllegalArgumentException("clientToken is missing")); String clientToken = tryCast(storage.get("clientToken"), String.class).orElseThrow(() -> new IllegalArgumentException("clientToken is missing"));
String accessToken = tryCast(storage.get("accessToken"), String.class).orElseThrow(() -> new IllegalArgumentException("accessToken is missing")); String accessToken = tryCast(storage.get("accessToken"), String.class).orElseThrow(() -> new IllegalArgumentException("accessToken is missing"));
@SuppressWarnings("unchecked")
Map<String, String> userProperties = tryCast(storage.get("userProperties"), Map.class).orElse(null); Map<String, String> userProperties = tryCast(storage.get("userProperties"), Map.class).orElse(null);
return new YggdrasilSession(clientToken, accessToken, new GameProfile(uuid, name), null, userProperties); return new YggdrasilSession(clientToken, accessToken, new GameProfile(uuid, name), null, userProperties);
} }