Skip to content

清理 Lang - #6707

Open
CiiLu wants to merge 1 commit into
HMCL-dev:mainfrom
CiiLu:tare/language
Open

清理 Lang#6707
CiiLu wants to merge 1 commit into
HMCL-dev:mainfrom
CiiLu:tare/language

Conversation

@CiiLu

@CiiLu CiiLu commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the 100+ label Aug 18, 2026
@CiiLu
CiiLu marked this pull request as draft August 18, 2026 12:06
@CiiLu
CiiLu marked this pull request as ready for review August 18, 2026 12:13
JavaVersionType javaVersionType = setting.getInheritable(GameSettings::javaTypeProperty);
if (setting.getInheritable(GameSettings::notCheckJVMProperty)) {
task = getJavaTask.thenApplyAsync(java -> Lang.requireNonNullElse(java, JavaRuntime.getDefault()));
task = getJavaTask.thenApplyAsync(java -> Objects.requireNonNullElse(java, JavaRuntime.getDefault()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能用 Objects.requireNonNullElse

}

installable.bind(Bindings.createBooleanBinding(() -> compatible.get() && txtName.validate(), txtName.textProperty(), compatible));
installable.bind(Bindings.createBooleanBinding(() -> compatible.get() && txtName.validate(), txtName.textProperty(), compatible));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String libraryId = library.getLibraryId();
String version = analyzer.getVersion(libraryId).orElse(null);
String libraryVersion = Lang.requireNonNullElse(getVersion(libraryId), version);
String libraryVersion = Objects.requireNonNullElse(getVersion(libraryId), version);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能使用 Objects.requireNonNullElse

Comment on lines +303 to +306
mainClass = Objects.requireNonNullElse(mainClass, patch.getMainClass());
assetIndex = Objects.requireNonNullElse(patch.getAssetIndex(), assetIndex);
javaMajors = Objects.requireNonNullElse(patch.getJavaMajors(), javaMajors);
mainJar = Objects.requireNonNullElse(patch.getMainJar(), mainJar);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些地方不能用 Objects.requireNonNullElse

if (!existed.containsKey(componentID)) {
Task<MultiMCInstancePatch> task = new GetTask(MultiMCComponents.getMetaURL(
componentID, Lang.requireNonNullElse(require.getEqualsVersion(), require.getSuggests()), mcVersion
componentID, Objects.requireNonNullElse(require.getEqualsVersion(), require.getSuggests()), mcVersion

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能用 Objects.requireNonNullElse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants