Skip to content

Commit

Permalink
[REFACTOR] IDEA Code Inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
gravit0 committed Mar 21, 2024
1 parent df5e6bd commit e93620f
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import pro.gravit.launchserver.modules.impl.LaunchServerInitContext;
import pro.gravit.utils.Version;

import java.io.IOException;

public class FxRuntimeOptimizerModule extends LauncherModule {
private transient final Logger logger = LogManager.getLogger(FxRuntimeOptimizerModule.class);
public static final Version version = new Version(1, 0, 0, 1, Version.Type.STABLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.stream.Stream;

public class RuntimeOptimizerHook implements MainBuildTask.IOHookSet.IOHook<BuildContext> {
private transient final Logger logger = LogManager.getLogger(RuntimeOptimizerHook.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import java.io.*;
import java.net.URI;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ private void build(BuildContext context, String scriptName, MirrorWorkspace.Buil
logger.info("Execute {}", String.join(" ", cmd));
var workdirString = context.replace(inst.workdir());
Path workdir = workdirString != null ? Path.of(workdirString) : context.scriptBuildDir;
if(!cmd.isEmpty() && cmd.get(0).startsWith("%")) {
BuildInCommand buildInCommand = buildInCommands.get(cmd.get(0));
if(!cmd.isEmpty() && cmd.getFirst().startsWith("%")) {
BuildInCommand buildInCommand = buildInCommands.get(cmd.getFirst());
if(buildInCommand == null) {
throw new IllegalArgumentException(String.format("Build-in command %s not found", cmd.get(0)));
throw new IllegalArgumentException(String.format("Build-in command %s not found", cmd.getFirst()));
}
List<String> cmdArgs = cmd.subList(1, cmd.size());
buildInCommand.run(cmdArgs, context, module, server, workdir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import java.io.*;
import java.net.URI;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public MicrosoftXBoxLiveRequest(String accessToken) {
public record MicrosoftXBoxLiveResponse(String IssueInstant, String NotAfter, String Token,
Map<String, List<Map<String, String>>> DisplayClaims) { //XBox Live and XSTS
public String getUHS() {
return DisplayClaims.get("xui").get(0).get("uhs");
return DisplayClaims.get("xui").getFirst().get("uhs");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void handle(ChannelHandlerContext ctx, FullHttpRequest msg, NettyConnectC
sendHttpResponse(ctx, simpleJsonResponse(HttpResponseStatus.BAD_REQUEST, new RemoteControlResponse<Void>("Missing required parameter: command")));
return;
}
command = token.commands.get(0);
command = token.commands.getFirst();
}
String finalCommand = command;
if (token.startWithMode ? token.commands.stream().noneMatch(finalCommand::startsWith) : !token.commands.contains(command)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pro.gravit.utils.helper.IOHelper;
import pro.gravit.utils.helper.LogHelper;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
Expand Down

0 comments on commit e93620f

Please sign in to comment.