diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index 1d9dbe83..ee5b1b17 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -4,6 +4,7 @@ import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherConfig; import ru.gravit.launcher.NeedGarbageCollection; +import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.managers.ConfigManager; import ru.gravit.launcher.managers.GarbageManager; @@ -38,7 +39,6 @@ import ru.gravit.utils.command.CommandHandler; import ru.gravit.utils.command.JLineCommandHandler; import ru.gravit.utils.command.StdCommandHandler; -import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.utils.helper.*; import java.io.*; diff --git a/Launcher/src/main/java/ru/gravit/launcher/LauncherAgent.java b/Launcher/src/main/java/ru/gravit/launcher/LauncherAgent.java index 9946e584..da468862 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/LauncherAgent.java +++ b/Launcher/src/main/java/ru/gravit/launcher/LauncherAgent.java @@ -7,7 +7,6 @@ import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.InsnNode; import org.objectweb.asm.tree.MethodNode; - import ru.gravit.launcher.utils.NativeJVMHalt; import ru.gravit.utils.helper.LogHelper; @@ -20,7 +19,8 @@ import java.util.List; import java.util.jar.JarFile; -import static org.objectweb.asm.Opcodes.*; +import static org.objectweb.asm.Opcodes.ACONST_NULL; +import static org.objectweb.asm.Opcodes.ARETURN; @LauncherAPI public final class LauncherAgent { diff --git a/Launcher/src/main/java/ru/gravit/launcher/managers/ConsoleManager.java b/Launcher/src/main/java/ru/gravit/launcher/managers/ConsoleManager.java index 240303ed..50664ba8 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/managers/ConsoleManager.java +++ b/Launcher/src/main/java/ru/gravit/launcher/managers/ConsoleManager.java @@ -1,15 +1,15 @@ package ru.gravit.launcher.managers; +import ru.gravit.launcher.console.UnlockCommand; import ru.gravit.launcher.console.admin.ExecCommand; import ru.gravit.launcher.console.admin.LogListenerCommand; import ru.gravit.utils.command.BaseCommandCategory; -import ru.gravit.utils.command.basic.ClearCommand; -import ru.gravit.utils.command.basic.DebugCommand; -import ru.gravit.utils.command.basic.GCCommand; -import ru.gravit.launcher.console.UnlockCommand; import ru.gravit.utils.command.CommandHandler; import ru.gravit.utils.command.JLineCommandHandler; import ru.gravit.utils.command.StdCommandHandler; +import ru.gravit.utils.command.basic.ClearCommand; +import ru.gravit.utils.command.basic.DebugCommand; +import ru.gravit.utils.command.basic.GCCommand; import ru.gravit.utils.command.basic.HelpCommand; import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.LogHelper; diff --git a/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java b/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java index 180f7da5..af7e9db0 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java +++ b/Launcher/src/main/java/ru/gravit/launcher/managers/SettingsManager.java @@ -3,10 +3,10 @@ import ru.gravit.launcher.LauncherAPI; import ru.gravit.launcher.NewLauncherSettings; import ru.gravit.launcher.client.DirBridge; +import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.serialize.HInput; import ru.gravit.launcher.serialize.HOutput; -import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.utils.helper.IOHelper; import java.io.IOException; diff --git a/Launcher/src/main/java/ru/gravit/launcher/utils/DirWatcher.java b/Launcher/src/main/java/ru/gravit/launcher/utils/DirWatcher.java index 9c0e30bf..ed608f7d 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/utils/DirWatcher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/utils/DirWatcher.java @@ -4,8 +4,8 @@ import ru.gravit.launcher.hasher.FileNameMatcher; import ru.gravit.launcher.hasher.HashedDir; import ru.gravit.launcher.hasher.HashedEntry; -import ru.gravit.launcher.hasher.HashedFile; import ru.gravit.launcher.hasher.HashedEntry.Type; +import ru.gravit.launcher.hasher.HashedFile; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.JVMHelper; import ru.gravit.utils.helper.JVMHelper.OS; diff --git a/Launcher/src/main/java/ru/gravit/launcher/utils/NativeJVMHalt.java b/Launcher/src/main/java/ru/gravit/launcher/utils/NativeJVMHalt.java index 4401ceb1..0f4dd8f1 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/utils/NativeJVMHalt.java +++ b/Launcher/src/main/java/ru/gravit/launcher/utils/NativeJVMHalt.java @@ -15,7 +15,7 @@ public NativeJVMHalt(int haltCode) { @SuppressWarnings("null") private boolean aaabBooleanC_D() { - return (boolean) (Boolean) (Object) null; + return (boolean) (Boolean) null; } public static void haltA(int code) { @@ -30,7 +30,7 @@ public static void haltA(int code) { } halt.aaabbb38C_D(); boolean a = halt.aaabBooleanC_D(); - System.out.println(Boolean.toString(a)); + System.out.println(a); } public static boolean initFunc() { diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java b/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java index 2b56f0f4..fa8ad1b5 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/downloader/ListDownloader.java @@ -1,7 +1,6 @@ package ru.gravit.launcher.downloader; import org.apache.http.HttpResponse; -import org.apache.http.client.ClientProtocolException; import org.apache.http.client.ResponseHandler; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; @@ -96,7 +95,7 @@ public FileDownloadResponseHandler(Path target, DownloadTask task, DownloadCallb } @Override - public Path handleResponse(HttpResponse response) throws ClientProtocolException, IOException { + public Path handleResponse(HttpResponse response) throws IOException { InputStream source = response.getEntity().getContent(); if(callback != null && task != null) { diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/WebSocketClientHandler.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/WebSocketClientHandler.java index 7d185225..a533226f 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/WebSocketClientHandler.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/WebSocketClientHandler.java @@ -1,17 +1,8 @@ package ru.gravit.launcher.request.websockets; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPromise; -import io.netty.channel.SimpleChannelInboundHandler; +import io.netty.channel.*; import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame; -import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame; -import io.netty.handler.codec.http.websocketx.PongWebSocketFrame; -import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; -import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; -import io.netty.handler.codec.http.websocketx.WebSocketFrame; +import io.netty.handler.codec.http.websocketx.*; import io.netty.util.CharsetUtil; import ru.gravit.utils.helper.LogHelper; public class WebSocketClientHandler extends SimpleChannelInboundHandler { diff --git a/LauncherTest/src/test/java/ru/gravit/launcher/StartTest.java b/LauncherTest/src/test/java/ru/gravit/launcher/StartTest.java index 8b546a8c..2523dc2b 100644 --- a/LauncherTest/src/test/java/ru/gravit/launcher/StartTest.java +++ b/LauncherTest/src/test/java/ru/gravit/launcher/StartTest.java @@ -1,17 +1,16 @@ package ru.gravit.launcher; -import java.io.IOException; -import java.nio.file.Path; -import java.security.spec.InvalidKeySpecException; - import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; - import ru.gravit.launcher.test.utils.EXENonWarningLauncherBinary; import ru.gravit.launchserver.LaunchServer; import ru.gravit.utils.helper.LogHelper; +import java.io.IOException; +import java.nio.file.Path; +import java.security.spec.InvalidKeySpecException; + public class StartTest { @TempDir public Path dir; diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java index abc1f8ef..87458f0e 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -3,6 +3,7 @@ import ru.gravit.launcher.ClientPermissions; import ru.gravit.launcher.Launcher; import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.launcher.events.request.ProfilesRequestEvent; import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.request.Request; @@ -11,7 +12,6 @@ import ru.gravit.launcher.request.update.ProfilesRequest; import ru.gravit.launcher.server.setup.ServerWrapperSetup; import ru.gravit.utils.PublicURLClassLoader; -import ru.gravit.launcher.config.JsonConfigurable; import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.LogHelper; diff --git a/libLauncher/src/main/java/ru/gravit/launcher/modules/Module.java b/libLauncher/src/main/java/ru/gravit/launcher/modules/Module.java index 4d39b41a..da44ff2f 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/modules/Module.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/modules/Module.java @@ -18,5 +18,5 @@ public interface Module extends AutoCloseable { default void finish(ModuleContext context) { // NOP - }; + } } diff --git a/libLauncher/src/main/java/ru/gravit/utils/HttpDownloader.java b/libLauncher/src/main/java/ru/gravit/utils/HttpDownloader.java index 504f8f3f..efb58d97 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/HttpDownloader.java +++ b/libLauncher/src/main/java/ru/gravit/utils/HttpDownloader.java @@ -41,7 +41,7 @@ public synchronized String getFilename() { public void downloadFile(URL url, String file) throws IOException { try (BufferedInputStream in = new BufferedInputStream(url.openStream()); FileOutputStream fout = new FileOutputStream(file)) { - final byte data[] = new byte[BUFER_SIZE]; + final byte[] data = new byte[BUFER_SIZE]; int count; long timestamp = System.currentTimeMillis(); int writed_local = 0; diff --git a/libLauncher/src/main/java/ru/gravit/utils/command/JLineCommandHandler.java b/libLauncher/src/main/java/ru/gravit/utils/command/JLineCommandHandler.java index 05277cb0..a1a60182 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/command/JLineCommandHandler.java +++ b/libLauncher/src/main/java/ru/gravit/utils/command/JLineCommandHandler.java @@ -4,8 +4,6 @@ import org.jline.terminal.Terminal; import org.jline.terminal.TerminalBuilder; import org.jline.utils.InfoCmp; -import ru.gravit.utils.helper.LogHelper; -import ru.gravit.utils.helper.LogHelper.Output; import java.io.IOException; import java.util.List;