From 96d1d853e83986afd1870f34d5681835454dc17f Mon Sep 17 00:00:00 2001 From: zaxar163 Date: Sun, 6 Jan 2019 15:48:40 +0400 Subject: [PATCH] Formatting fixes. (TODO: reformat by IDEA) --- .../ru/gravit/launchserver/LaunchServer.java | 11 +- .../auth/hwid/JsonHWIDHandler.java | 2 - .../JsonFilePermissionsHandler.java | 2 +- .../auth/provider/AuthProvider.java | 4 +- .../auth/provider/AuthProviderResult.java | 2 +- .../auth/provider/MySQLAuthProvider.java | 2 +- .../auth/provider/RejectAuthProvider.java | 4 +- .../binary/JARLauncherBinary.java | 67 +-------- .../binary/tasks/MainBuildTask.java | 35 +++-- .../binary/tasks/ProGuardBuildTask.java | 15 +- .../binary/tasks/UnpackBuildTask.java | 17 ++- .../command/basic/RestartCommand.java | 1 - .../command/basic/StopCommand.java | 1 - .../command/basic/TestCommand.java | 2 +- .../command/handler/CommandHandler.java | 8 +- .../manangers/NodeTransformer.java | 43 ------ .../manangers/ReconfigurableManager.java | 6 +- .../manangers/hook/AuthHookManager.java | 6 +- .../manangers/hook/BuildHookManager.java | 1 - .../manangers/hook/SocketHookManager.java | 6 +- .../launchserver/response/Response.java | 3 +- .../ru/gravit/launchserver/socket/Client.java | 2 +- .../ru/gravit/launcher/JSApplication.java | 3 - .../minecraft/MinecraftProfileTexture.java | 3 - .../authlib/yggdrasil/CompatBridge.java | 6 - .../authlib/yggdrasil/CompatProfile.java | 1 - .../authlib/yggdrasil/LegacyBridge.java | 4 - .../YggdrasilAuthenticationService.java | 1 - .../ru/gravit/launcher/request/Request.java | 1 - .../request/update/LauncherRequest.java | 1 - .../request/update/LegacyLauncherRequest.java | 1 - .../websockets/JsonRequestAdapter.java | 1 - .../gravit/launcher/server/ServerAgent.java | 1 - .../gravit/launcher/server/ServerWrapper.java | 3 +- .../ru/gravit/launcher/AutogenConfig.java | 6 +- .../ru/gravit/launcher/LauncherConfig.java | 2 - .../launcher/profiles/ClientProfile.java | 130 +++++++++++++++++- .../ru/gravit/utils/helper/JVMHelper.java | 3 - 38 files changed, 204 insertions(+), 203 deletions(-) delete mode 100644 LaunchServer/src/main/java/ru/gravit/launchserver/manangers/NodeTransformer.java diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java index fc50a453..061d8fc0 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/LaunchServer.java @@ -65,7 +65,11 @@ import ru.gravit.launchserver.config.HWIDHandlerAdapter; import ru.gravit.launchserver.config.PermissionsHandlerAdapter; import ru.gravit.launchserver.config.TextureProviderAdapter; -import ru.gravit.launchserver.manangers.*; +import ru.gravit.launchserver.manangers.MirrorManager; +import ru.gravit.launchserver.manangers.ModulesManager; +import ru.gravit.launchserver.manangers.ReconfigurableManager; +import ru.gravit.launchserver.manangers.ReloadManager; +import ru.gravit.launchserver.manangers.SessionManager; import ru.gravit.launchserver.manangers.hook.AuthHookManager; import ru.gravit.launchserver.manangers.hook.BuildHookManager; import ru.gravit.launchserver.manangers.hook.SocketHookManager; @@ -264,7 +268,8 @@ public static void main(String... args) throws Throwable { public final Path privateKeyFile; public final Path updatesDir; - public static LaunchServer server; + + public static LaunchServer server = null; public final Path profilesDir; // Server config @@ -587,8 +592,6 @@ private void generateConfigIfNotExists() throws IOException { } } - - @SuppressWarnings("ReturnOfCollectionOrArrayField") public Collection getProfiles() { return profilesList; } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/JsonHWIDHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/JsonHWIDHandler.java index 7fb92075..b218d1f2 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/JsonHWIDHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/hwid/JsonHWIDHandler.java @@ -17,11 +17,9 @@ public final class JsonHWIDHandler extends HWIDHandler { private static final Gson gson = new Gson(); - @SuppressWarnings("unused") private URL url; private URL urlBan; private URL urlUnBan; - @SuppressWarnings("unused") private URL urlGet; public class banRequest { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java index b779b882..72aa37ca 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java @@ -11,9 +11,9 @@ import com.google.gson.reflect.TypeToken; +import ru.gravit.launcher.ClientPermissions; import ru.gravit.launcher.Launcher; import ru.gravit.launchserver.Reloadable; -import ru.gravit.launcher.ClientPermissions; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.LogHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProvider.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProvider.java index 3607206e..87d08685 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProvider.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProvider.java @@ -13,8 +13,6 @@ public abstract class AuthProvider implements AutoCloseable { private static final Map> AUTH_PROVIDERS = new ConcurrentHashMap<>(8); private static boolean registredProv = false; - protected transient LaunchServer server = LaunchServer.server; - public static AuthProviderResult authError(String message) throws AuthException { throw new AuthException(message); @@ -42,7 +40,7 @@ public static void registerProviders() { } public AuthHandler getAccociateHandler(int this_position) { - return server.config.authHandler; + return LaunchServer.server.config.authHandler; } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProviderResult.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProviderResult.java index f89f3c33..4d8ec016 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProviderResult.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/AuthProviderResult.java @@ -1,7 +1,7 @@ package ru.gravit.launchserver.auth.provider; -import ru.gravit.launchserver.LaunchServer; import ru.gravit.launcher.ClientPermissions; +import ru.gravit.launchserver.LaunchServer; public class AuthProviderResult { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/MySQLAuthProvider.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/MySQLAuthProvider.java index 48be4086..b3554bd5 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/MySQLAuthProvider.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/MySQLAuthProvider.java @@ -5,8 +5,8 @@ import java.sql.ResultSet; import java.sql.SQLException; -import ru.gravit.launchserver.auth.AuthException; import ru.gravit.launcher.ClientPermissions; +import ru.gravit.launchserver.auth.AuthException; import ru.gravit.launchserver.auth.MySQLSourceConfig; import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.SecurityHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/RejectAuthProvider.java b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/RejectAuthProvider.java index 16ca7081..efe8af0a 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/RejectAuthProvider.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/auth/provider/RejectAuthProvider.java @@ -1,12 +1,12 @@ package ru.gravit.launchserver.auth.provider; +import java.util.ArrayList; + import ru.gravit.launchserver.Reconfigurable; import ru.gravit.launchserver.auth.AuthException; import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.SecurityHelper; -import java.util.ArrayList; - public final class RejectAuthProvider extends AuthProvider implements Reconfigurable { public RejectAuthProvider() { } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java index 93adb743..f1c75680 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/JARLauncherBinary.java @@ -1,49 +1,17 @@ package ru.gravit.launchserver.binary; -import static ru.gravit.utils.helper.IOHelper.newZipEntry; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; -import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.jar.JarFile; -import java.util.zip.ZipEntry; -import java.util.zip.ZipException; -import java.util.zip.ZipInputStream; -import java.util.zip.ZipOutputStream; -import javassist.CannotCompileException; -import javassist.NotFoundException; -import proguard.Configuration; -import proguard.ConfigurationParser; -import proguard.ParseException; -import proguard.ProGuard; -import ru.gravit.launcher.AutogenConfig; -import ru.gravit.launcher.Launcher; -import ru.gravit.launcher.LauncherConfig; -import ru.gravit.launcher.serialize.HOutput; import ru.gravit.launchserver.LaunchServer; -import ru.gravit.launchserver.asm.ClassMetadataReader; import ru.gravit.launchserver.binary.tasks.LauncherBuildTask; import ru.gravit.launchserver.binary.tasks.MainBuildTask; import ru.gravit.launchserver.binary.tasks.ProGuardBuildTask; import ru.gravit.launchserver.binary.tasks.UnpackBuildTask; -import ru.gravit.launchserver.manangers.hook.BuildHookManager.ZipBuildHook; -import ru.gravit.utils.helper.CommonHelper; import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.LogHelper; -import ru.gravit.utils.helper.SecurityHelper; -import ru.gravit.utils.helper.SecurityHelper.DigestAlgorithm; -import ru.gravit.utils.helper.UnpackHelper; public final class JARLauncherBinary extends LauncherBinary { //public ClassMetadataReader reader; @@ -51,20 +19,10 @@ public final class JARLauncherBinary extends LauncherBinary { public JARLauncherBinary(LaunchServer server) throws IOException { super(server); tasks = new ArrayList<>(); - tasks.add(new UnpackBuildTask()); - tasks.add(new MainBuildTask()); - if(server.config.enabledProGuard) tasks.add(new ProGuardBuildTask()); + tasks.add(new UnpackBuildTask(server)); + tasks.add(new MainBuildTask(server)); + if(server.config.enabledProGuard) tasks.add(new ProGuardBuildTask(server)); syncBinaryFile = server.dir.resolve(server.config.binaryName + ".jar"); - /*runtimeDir = server.dir.resolve(Launcher.RUNTIME_DIR); - guardDir = server.dir.resolve(Launcher.GUARD_DIR); - initScriptFile = runtimeDir.resolve(Launcher.INIT_SCRIPT_FILE); - obfJar = server.dir.resolve(server.config.binaryName + "-obfPre.jar"); - obfOutJar = server.config.buildPostTransform.enabled ? server.dir.resolve(server.config.binaryName + "-obf.jar") - : syncBinaryFile; - cleanJar = server.dir.resolve(server.config.binaryName + "-clean.jar"); - reader = new ClassMetadataReader(); - UnpackHelper.unpack(IOHelper.getResourceURL("Launcher.jar"), cleanJar); - reader.getCp().add(new JarFile(cleanJar.toFile()));*/ } @Override @@ -118,25 +76,6 @@ public void build() throws IOException { } for (ZipBuildHook h : server.buildHookManager.getProguardBuildHooks()) h.build(output); - } - if (server.config.buildPostTransform.enabled) - transformedBuild();*/ - } - - private void transformedBuild() throws IOException { - /*List cmd = new ArrayList<>(1); - for (String v : server.config.buildPostTransform.script) - cmd.add(CommonHelper.replace(v, "launcher-output", IOHelper.toAbsPathString(syncBinaryFile), "launcher-obf", - IOHelper.toAbsPathString(obfJar), "launcher-nonObf", IOHelper.toAbsPathString(binaryFile))); - ProcessBuilder builder = new ProcessBuilder(); - builder.directory(IOHelper.toAbsPath(server.dir).toFile()); - builder.inheritIO(); - builder.command(cmd); - Process proc = builder.start(); - try { - LogHelper.debug("Transformer process return code: " + proc.waitFor()); - } catch (InterruptedException e) { - LogHelper.error(e); }*/ } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/MainBuildTask.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/MainBuildTask.java index 4389c636..8fceaab3 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/MainBuildTask.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/MainBuildTask.java @@ -1,21 +1,7 @@ package ru.gravit.launchserver.binary.tasks; -import javassist.CannotCompileException; -import javassist.NotFoundException; -import ru.gravit.launcher.AutogenConfig; -import ru.gravit.launcher.Launcher; -import ru.gravit.launcher.LauncherConfig; -import ru.gravit.launcher.serialize.HOutput; -import ru.gravit.launchserver.LaunchServer; -import ru.gravit.launchserver.binary.BuildContext; -import ru.gravit.launchserver.binary.JAConfigurator; -import ru.gravit.launchserver.binary.JARLauncherBinary; -import ru.gravit.utils.helper.IOHelper; -import ru.gravit.utils.helper.LogHelper; -import ru.gravit.utils.helper.SecurityHelper; -import ru.gravit.utils.helper.UnpackHelper; +import static ru.gravit.utils.helper.IOHelper.newZipEntry; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.file.FileVisitResult; @@ -29,14 +15,26 @@ import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; -import static ru.gravit.utils.helper.IOHelper.newZipEntry; +import javassist.CannotCompileException; +import javassist.NotFoundException; +import ru.gravit.launcher.AutogenConfig; +import ru.gravit.launcher.Launcher; +import ru.gravit.launcher.LauncherConfig; +import ru.gravit.launcher.serialize.HOutput; +import ru.gravit.launchserver.LaunchServer; +import ru.gravit.launchserver.binary.BuildContext; +import ru.gravit.launchserver.binary.JAConfigurator; +import ru.gravit.utils.helper.IOHelper; +import ru.gravit.utils.helper.LogHelper; +import ru.gravit.utils.helper.SecurityHelper; +import ru.gravit.utils.helper.UnpackHelper; public class MainBuildTask implements LauncherBuildTask { - public static LaunchServer server = LaunchServer.server; public final Path runtimeDir; public final Path guardDir; public final Path binaryFile; public Path cleanJar; + private final LaunchServer server; private final class RuntimeDirVisitor extends SimpleFileVisitor { private final ZipOutputStream output; private final Map runtime; @@ -106,7 +104,8 @@ private static ZipEntry newEntry(String fileName) { private static ZipEntry newGuardEntry(String fileName) { return newZipEntry(Launcher.GUARD_DIR + IOHelper.CROSS_SEPARATOR + fileName); } - public MainBuildTask() { + public MainBuildTask(LaunchServer srv) { + server = srv; runtimeDir = server.dir.resolve(Launcher.RUNTIME_DIR); guardDir = server.dir.resolve(Launcher.GUARD_DIR); binaryFile = server.dir.resolve(server.config.binaryName + "-main.jar"); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/ProGuardBuildTask.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/ProGuardBuildTask.java index 73ebd9c3..72366ea2 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/ProGuardBuildTask.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/ProGuardBuildTask.java @@ -1,17 +1,22 @@ package ru.gravit.launchserver.binary.tasks; +import java.io.IOException; +import java.nio.file.Path; + import proguard.Configuration; import proguard.ConfigurationParser; import proguard.ParseException; import proguard.ProGuard; import ru.gravit.launchserver.LaunchServer; -import java.io.IOException; -import java.nio.file.Path; - public class ProGuardBuildTask implements LauncherBuildTask { - public static LaunchServer server = LaunchServer.server; - @Override + private final LaunchServer server; + + public ProGuardBuildTask(LaunchServer server) { + this.server = server; + } + + @Override public String getName() { return "ProGuard"; } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/UnpackBuildTask.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/UnpackBuildTask.java index 95242ede..a6ec622a 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/UnpackBuildTask.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/UnpackBuildTask.java @@ -1,16 +1,21 @@ package ru.gravit.launchserver.binary.tasks; -import ru.gravit.launchserver.LaunchServer; -import ru.gravit.utils.helper.IOHelper; -import ru.gravit.utils.helper.UnpackHelper; - import java.io.IOException; import java.net.URL; import java.nio.file.Path; +import ru.gravit.launchserver.LaunchServer; +import ru.gravit.utils.helper.IOHelper; +import ru.gravit.utils.helper.UnpackHelper; + public class UnpackBuildTask implements LauncherBuildTask { - public static LaunchServer server = LaunchServer.server; - @Override + private final LaunchServer server; + + public UnpackBuildTask(LaunchServer server) { + this.server = server; + } + + @Override public String getName() { return "UnpackFromResources"; } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/RestartCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/RestartCommand.java index 4af32282..34fbdb3e 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/RestartCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/RestartCommand.java @@ -19,7 +19,6 @@ public String getUsageDescription() { } @Override - @SuppressWarnings("CallToSystemExit") public void invoke(String... args) { server.fullyRestart(); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/StopCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/StopCommand.java index ddb75200..bb1983ac 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/StopCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/StopCommand.java @@ -20,7 +20,6 @@ public String getUsageDescription() { } @Override - @SuppressWarnings("CallToSystemExit") public void invoke(String... args) { JVMHelper.RUNTIME.exit(0); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/TestCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/TestCommand.java index c80a19fb..da213930 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/TestCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/basic/TestCommand.java @@ -36,7 +36,7 @@ public void invoke(String... args) throws Exception { } if (args[0].equals("profile")) { ClientProfile profile = new ClientProfile("1.7.10","asset1.7.10",0,"Test1.7.10","localhost",25565,true,false,"net.minecraft.launchwrapper.Launch"); - try(Writer writer = IOHelper.newWriter(LaunchServer.server.dir.resolve("profiles").resolve("Test.cfg"))) + try(Writer writer = IOHelper.newWriter(server.dir.resolve("profiles").resolve("Test.cfg"))) { LaunchServer.gson.toJson(profile,writer); } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java index 885fcdc3..3858c826 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/handler/CommandHandler.java @@ -44,7 +44,13 @@ import ru.gravit.launchserver.command.hash.UnindexAssetCommand; import ru.gravit.launchserver.command.modules.LoadModuleCommand; import ru.gravit.launchserver.command.modules.ModulesCommand; -import ru.gravit.launchserver.command.service.*; +import ru.gravit.launchserver.command.service.ConfigCommand; +import ru.gravit.launchserver.command.service.ConfigHelpCommand; +import ru.gravit.launchserver.command.service.ConfigListCommand; +import ru.gravit.launchserver.command.service.ReloadAllCommand; +import ru.gravit.launchserver.command.service.ReloadCommand; +import ru.gravit.launchserver.command.service.ReloadListCommand; +import ru.gravit.launchserver.command.service.SwapAuthProviderCommand; import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.VerifyHelper; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/NodeTransformer.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/NodeTransformer.java deleted file mode 100644 index aa5b2986..00000000 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/NodeTransformer.java +++ /dev/null @@ -1,43 +0,0 @@ -package ru.gravit.launchserver.manangers; - -import java.util.ArrayList; -import java.util.List; - -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.tree.ClassNode; - -import ru.gravit.launcher.LauncherConfig; -import ru.gravit.launchserver.asm.SafeClassWriter; -import ru.gravit.launchserver.binary.JARLauncherBinary; -import ru.gravit.launchserver.binary.tasks.MainBuildTask; -import ru.gravit.launchserver.manangers.hook.BuildHookManager.Transformer; - -public class NodeTransformer implements Transformer { - @FunctionalInterface - public interface ClassNodeTransformer { - void transform(ClassNode node, String classname, JARLauncherBinary data); - } - - private final List transLst; - - public List getTransLst() { - return transLst; - } - - public NodeTransformer() { - transLst = new ArrayList<>(); - } - - @Override - public byte[] transform(byte[] input, String classname, MainBuildTask data) { - //ClassReader cr = new ClassReader(input); - //ClassNode cn = new ClassNode(); - //cr.accept(cn, data.server.config.env.equals(LauncherConfig.LauncherEnvironment.PROD) || data.server.config.env.equals(LauncherConfig.LauncherEnvironment.STD) ? ClassReader.SKIP_DEBUG : 0); - //for (ClassNodeTransformer tr : transLst) tr.transform(cn, classname, data); - //ClassWriter cw = new SafeClassWriter(data.reader, ClassWriter.COMPUTE_MAXS); - //cn.accept(cw); - //return cw.toByteArray(); - return null; - } -} diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java index 3f0f5a0a..36a7cddd 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java @@ -1,12 +1,12 @@ package ru.gravit.launchserver.manangers; +import java.util.HashMap; +import java.util.Objects; + import ru.gravit.launchserver.Reconfigurable; import ru.gravit.utils.helper.LogHelper; import ru.gravit.utils.helper.VerifyHelper; -import java.util.HashMap; -import java.util.Objects; - public class ReconfigurableManager { private final HashMap RECONFIGURABLE = new HashMap<>(); public void registerReconfigurable(String name, Reconfigurable reconfigurable) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/AuthHookManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/AuthHookManager.java index 729ae1f6..273e2437 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/AuthHookManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/AuthHookManager.java @@ -1,11 +1,11 @@ package ru.gravit.launchserver.manangers.hook; -import ru.gravit.launchserver.response.auth.AuthResponse; -import ru.gravit.launchserver.socket.Client; - import java.util.HashSet; import java.util.Set; +import ru.gravit.launchserver.response.auth.AuthResponse; +import ru.gravit.launchserver.socket.Client; + public class AuthHookManager { private Set PRE_HOOKS = new HashSet<>(); private Set POST_HOOKS = new HashSet<>(); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/BuildHookManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/BuildHookManager.java index e5c33d2b..78b79bc3 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/BuildHookManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/BuildHookManager.java @@ -10,7 +10,6 @@ import ru.gravit.launcher.modules.TestClientModule; import ru.gravit.launchserver.binary.BuildContext; import ru.gravit.launchserver.binary.JAConfigurator; -import ru.gravit.launchserver.binary.JARLauncherBinary; import ru.gravit.launchserver.binary.tasks.MainBuildTask; import ru.gravit.launchserver.manangers.NodeTransformer; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/SocketHookManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/SocketHookManager.java index 87699daf..ecba8769 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/SocketHookManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/hook/SocketHookManager.java @@ -1,12 +1,12 @@ package ru.gravit.launchserver.manangers.hook; -import ru.gravit.launcher.request.RequestException; -import ru.gravit.launchserver.socket.SocketContext; - import java.net.Socket; import java.util.HashSet; import java.util.Set; +import ru.gravit.launcher.request.RequestException; +import ru.gravit.launchserver.socket.SocketContext; + public class SocketHookManager { @FunctionalInterface public interface SocketPreHook diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/response/Response.java b/LaunchServer/src/main/java/ru/gravit/launchserver/response/Response.java index 4abd5a2a..cc1784d6 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/response/Response.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/response/Response.java @@ -104,8 +104,7 @@ protected final void debug(String message, Object... args) { public abstract void reply() throws Exception; - @SuppressWarnings("MethodMayBeStatic") // Intentionally not static - protected final void writeNoError(HOutput output) throws IOException { + protected static final void writeNoError(HOutput output) throws IOException { output.writeString("", 0); } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/Client.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/Client.java index 8799e3e9..40346ddc 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/Client.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/Client.java @@ -1,7 +1,7 @@ package ru.gravit.launchserver.socket; -import ru.gravit.launcher.profiles.ClientProfile; import ru.gravit.launcher.ClientPermissions; +import ru.gravit.launcher.profiles.ClientProfile; public class Client { public long session; diff --git a/Launcher/src/main/java/ru/gravit/launcher/JSApplication.java b/Launcher/src/main/java/ru/gravit/launcher/JSApplication.java index b2c5721d..eb7f8010 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/JSApplication.java +++ b/Launcher/src/main/java/ru/gravit/launcher/JSApplication.java @@ -4,7 +4,6 @@ import java.util.concurrent.atomic.AtomicReference; -@SuppressWarnings("AbstractClassNeverImplemented") public abstract class JSApplication extends Application { private static final AtomicReference INSTANCE = new AtomicReference<>(); @@ -13,8 +12,6 @@ public static JSApplication getInstance() { return INSTANCE.get(); } - - @SuppressWarnings("ConstructorNotProtectedInAbstractClass") public JSApplication() { INSTANCE.set(this); } diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/minecraft/MinecraftProfileTexture.java b/LauncherAPI/src/main/java/com/mojang/authlib/minecraft/MinecraftProfileTexture.java index 700534b8..721b69b7 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/minecraft/MinecraftProfileTexture.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/minecraft/MinecraftProfileTexture.java @@ -41,17 +41,14 @@ public MinecraftProfileTexture(String url, String hash) { this.hash = hash; } - @SuppressWarnings("unused") public String getHash() { return hash; } - @SuppressWarnings({"unused", "SameReturnValue"}) public String getMetadata(String key) { return null; } - @SuppressWarnings("unused") public String getUrl() { return url; } diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatBridge.java b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatBridge.java index 69304fa2..b722c10b 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatBridge.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatBridge.java @@ -13,18 +13,15 @@ import java.util.UUID; // Used to bypass Launcher's class name obfuscation and access API -@SuppressWarnings("unused") @LauncherAPI public final class CompatBridge { public static final int PROFILES_MAX_BATCH_SIZE = SerializeLimits.MAX_BATCH_SIZE; - @SuppressWarnings("unused") public static CompatProfile checkServer(String username, String serverID) throws Exception { LogHelper.debug("CompatBridge.checkServer, Username: '%s', Server ID: %s", username, serverID); return CompatProfile.fromPlayerProfile(new CheckServerRequest(username, serverID).request()); } - @SuppressWarnings("unused") public static boolean joinServer(String username, String accessToken, String serverID) throws Exception { // Join server @@ -32,17 +29,14 @@ public static boolean joinServer(String username, String accessToken, String ser return new JoinServerRequest(username, accessToken, serverID).request(); } - @SuppressWarnings("unused") public static CompatProfile profileByUsername(String username) throws Exception { return CompatProfile.fromPlayerProfile(new ProfileByUsernameRequest(username).request()); } - @SuppressWarnings("unused") public static CompatProfile profileByUUID(UUID uuid) throws Exception { return CompatProfile.fromPlayerProfile(new ProfileByUUIDRequest(uuid).request()); } - @SuppressWarnings("unused") public static CompatProfile[] profilesByUsername(String... usernames) throws Exception { PlayerProfile[] profiles = new BatchProfileByUsernameRequest(usernames).request(); diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatProfile.java b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatProfile.java index 14da7047..fd19a64c 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatProfile.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/CompatProfile.java @@ -7,7 +7,6 @@ import java.util.UUID; -@SuppressWarnings("unused") @LauncherAPI public final class CompatProfile { public static final String SKIN_URL_PROPERTY = Launcher.SKIN_URL_PROPERTY; diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/LegacyBridge.java b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/LegacyBridge.java index 72a7b255..378145e6 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/LegacyBridge.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/LegacyBridge.java @@ -10,27 +10,23 @@ // Used by 1.6.4 and below versions @LauncherAPI public final class LegacyBridge { - @SuppressWarnings("unused") public static boolean checkServer(String username, String serverID) throws Exception { LogHelper.debug("LegacyBridge.checkServer, Username: '%s', Server ID: %s", username, serverID); return new CheckServerRequest(username, serverID).request() != null; } - @SuppressWarnings("unused") public static String getCloakURL(String username) { LogHelper.debug("LegacyBridge.getCloakURL: '%s'", username); return CommonHelper.replace(System.getProperty("launcher.legacy.cloaksURL", "http://skins.minecraft.net/MinecraftCloaks/%username%.png"), "username", IOHelper.urlEncode(username)); } - @SuppressWarnings("unused") public static String getSkinURL(String username) { LogHelper.debug("LegacyBridge.getSkinURL: '%s'", username); return CommonHelper.replace(System.getProperty("launcher.legacy.skinsURL", "http://skins.minecraft.net/MinecraftSkins/%username%.png"), "username", IOHelper.urlEncode(username)); } - @SuppressWarnings("unused") public static String joinServer(String username, String accessToken, String serverID) { // Join server diff --git a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilAuthenticationService.java b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilAuthenticationService.java index 6cf0b6d6..6579f2e4 100644 --- a/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilAuthenticationService.java +++ b/LauncherAPI/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilAuthenticationService.java @@ -10,7 +10,6 @@ import java.net.Proxy; public final class YggdrasilAuthenticationService implements AuthenticationService { - @SuppressWarnings("UnusedParameters") public YggdrasilAuthenticationService(Proxy proxy, String clientToken) { LogHelper.debug("Patched AuthenticationService created: '%s'", clientToken); } diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/Request.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/Request.java index b184fc5e..e75f0be8 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/Request.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/Request.java @@ -54,7 +54,6 @@ protected final void readError(HInput input) throws IOException { } @LauncherAPI - @SuppressWarnings("DesignForExtension") public R request() throws Exception { if (!started.compareAndSet(false, true)) throw new IllegalStateException("Request already started"); diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java index d694773e..adf44662 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java @@ -83,7 +83,6 @@ public Integer getType() { } @Override - @SuppressWarnings("CallToSystemExit") protected Result requestDo(HInput input, HOutput output) throws Exception { Path launcherPath = IOHelper.getCodeSource(LauncherRequest.class); byte[] digest = SecurityHelper.digest(SecurityHelper.DigestAlgorithm.SHA512, launcherPath); diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LegacyLauncherRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LegacyLauncherRequest.java index 0c5ec83b..c387c5b6 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LegacyLauncherRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LegacyLauncherRequest.java @@ -93,7 +93,6 @@ public Integer getType() { } @Override - @SuppressWarnings("CallToSystemExit") protected Result requestDo(HInput input, HOutput output) throws Exception { output.writeBoolean(EXE_BINARY); output.flush(); diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/JsonRequestAdapter.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/JsonRequestAdapter.java index 72411843..da6d860d 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/JsonRequestAdapter.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/JsonRequestAdapter.java @@ -12,7 +12,6 @@ public JsonRequestAdapter(ClientWebSocketService service) { this.service = service; } - @SuppressWarnings("unchecked") @Override public RequestInterface deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { String typename = json.getAsJsonObject().getAsJsonPrimitive(PROP_NAME).getAsString(); diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java index 2acd9202..2b248e36 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java @@ -46,7 +46,6 @@ public static long getObjSize(Object obj) { public static Boolean isAutoloadLibraries = Boolean.getBoolean(System.getProperty("serverwrapper,agentlibrariesload", "false")); public static Boolean isAgentProxy = Boolean.getBoolean(System.getProperty("serverwrapper,agentproxy", "false")); - @SuppressWarnings("JavaLangInvokeHandleSignature") public static void premain(String agentArgument, Instrumentation instrumentation) { LogHelper.debug("Server Agent"); inst = instrumentation; 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 9e8e84a8..8fa85a88 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -85,8 +85,7 @@ public static void initGson() Launcher.gson = Launcher.gsonBuilder.create(); } - @SuppressWarnings("ConfusingArgumentToVarargsMethod") - public static void main(String[] args) throws Throwable { + public static void main(String... args) throws Throwable { ServerWrapper wrapper = new ServerWrapper(); LogHelper.printVersion("ServerWrapper"); LogHelper.printLicense("ServerWrapper"); diff --git a/libLauncher/src/main/java/ru/gravit/launcher/AutogenConfig.java b/libLauncher/src/main/java/ru/gravit/launcher/AutogenConfig.java index 6213046c..ffbd4ff1 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/AutogenConfig.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/AutogenConfig.java @@ -5,7 +5,8 @@ public class AutogenConfig { public String address; public int port; public int clientPort; - private boolean isInitModules; + @SuppressWarnings("unused") + private boolean isInitModules; public boolean isUsingWrapper; public boolean isDownloadJava; //Выставление этого флага требует модификации runtime части public String secretKeyClient; @@ -17,11 +18,8 @@ public class AutogenConfig { // 3 - Production (дебаг выключен, минимальный объем сообщений, stacktrace не выводится) AutogenConfig() { - } - @SuppressWarnings("UnnecessaryReturnStatement") public void initModules() { - if (isInitModules) return; } } diff --git a/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java b/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java index bff7bfcb..067df7a0 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java @@ -84,7 +84,6 @@ public LauncherConfig(HInput input) throws IOException, InvalidKeySpecException } @LauncherAPI - @SuppressWarnings("AssignmentToCollectionOrArrayFieldFromParameter") public LauncherConfig(String address, int port, RSAPublicKey publicKey, Map runtime, String projectname) { this.address = InetSocketAddress.createUnresolved(address, port); this.publicKey = Objects.requireNonNull(publicKey, "publicKey"); @@ -97,7 +96,6 @@ public LauncherConfig(String address, int port, RSAPublicKey publicKey, Map runtime) { this.address = InetSocketAddress.createUnresolved(address, port); this.publicKey = Objects.requireNonNull(publicKey, "publicKey"); diff --git a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java index 06862a2b..44a6248d 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java @@ -10,9 +10,8 @@ import java.net.InetSocketAddress; import java.util.*; -@SuppressWarnings("ComparableImplementedButEqualsNotOverridden") public final class ClientProfile implements Comparable { - public ClientProfile(String version, String assetIndex, int sortIndex, String title, String serverAddress, int serverPort, boolean updateFastCheck, boolean useWhitelist, String mainClass) { + public ClientProfile(String version, String assetIndex, int sortIndex, String title, String serverAddress, int serverPort, boolean updateFastCheck, boolean useWhitelist, String mainClass) { this.version = version; this.assetIndex = assetIndex; this.sortIndex = sortIndex; @@ -421,4 +420,131 @@ public void verify() { // Client launcher VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Main class can't be empty"); } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((assetDir == null) ? 0 : assetDir.hashCode()); + result = prime * result + ((assetIndex == null) ? 0 : assetIndex.hashCode()); + result = prime * result + ((classPath == null) ? 0 : classPath.hashCode()); + result = prime * result + ((clientArgs == null) ? 0 : clientArgs.hashCode()); + result = prime * result + ((dir == null) ? 0 : dir.hashCode()); + result = prime * result + ((jvmArgs == null) ? 0 : jvmArgs.hashCode()); + result = prime * result + ((mainClass == null) ? 0 : mainClass.hashCode()); + result = prime * result + ((serverAddress == null) ? 0 : serverAddress.hashCode()); + result = prime * result + serverPort; + result = prime * result + sortIndex; + result = prime * result + ((title == null) ? 0 : title.hashCode()); + result = prime * result + ((update == null) ? 0 : update.hashCode()); + result = prime * result + ((updateExclusions == null) ? 0 : updateExclusions.hashCode()); + result = prime * result + (updateFastCheck ? 1231 : 1237); + result = prime * result + ((updateOptional == null) ? 0 : updateOptional.hashCode()); + result = prime * result + ((updateShared == null) ? 0 : updateShared.hashCode()); + result = prime * result + ((updateVerify == null) ? 0 : updateVerify.hashCode()); + result = prime * result + (useWhitelist ? 1231 : 1237); + result = prime * result + ((version == null) ? 0 : version.hashCode()); + result = prime * result + ((whitelist == null) ? 0 : whitelist.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + ClientProfile other = (ClientProfile) obj; + if (assetDir == null) { + if (other.assetDir != null) + return false; + } else if (!assetDir.equals(other.assetDir)) + return false; + if (assetIndex == null) { + if (other.assetIndex != null) + return false; + } else if (!assetIndex.equals(other.assetIndex)) + return false; + if (classPath == null) { + if (other.classPath != null) + return false; + } else if (!classPath.equals(other.classPath)) + return false; + if (clientArgs == null) { + if (other.clientArgs != null) + return false; + } else if (!clientArgs.equals(other.clientArgs)) + return false; + if (dir == null) { + if (other.dir != null) + return false; + } else if (!dir.equals(other.dir)) + return false; + if (jvmArgs == null) { + if (other.jvmArgs != null) + return false; + } else if (!jvmArgs.equals(other.jvmArgs)) + return false; + if (mainClass == null) { + if (other.mainClass != null) + return false; + } else if (!mainClass.equals(other.mainClass)) + return false; + if (serverAddress == null) { + if (other.serverAddress != null) + return false; + } else if (!serverAddress.equals(other.serverAddress)) + return false; + if (serverPort != other.serverPort) + return false; + if (sortIndex != other.sortIndex) + return false; + if (title == null) { + if (other.title != null) + return false; + } else if (!title.equals(other.title)) + return false; + if (update == null) { + if (other.update != null) + return false; + } else if (!update.equals(other.update)) + return false; + if (updateExclusions == null) { + if (other.updateExclusions != null) + return false; + } else if (!updateExclusions.equals(other.updateExclusions)) + return false; + if (updateFastCheck != other.updateFastCheck) + return false; + if (updateOptional == null) { + if (other.updateOptional != null) + return false; + } else if (!updateOptional.equals(other.updateOptional)) + return false; + if (updateShared == null) { + if (other.updateShared != null) + return false; + } else if (!updateShared.equals(other.updateShared)) + return false; + if (updateVerify == null) { + if (other.updateVerify != null) + return false; + } else if (!updateVerify.equals(other.updateVerify)) + return false; + if (useWhitelist != other.useWhitelist) + return false; + if (version == null) { + if (other.version != null) + return false; + } else if (!version.equals(other.version)) + return false; + if (whitelist == null) { + if (other.whitelist != null) + return false; + } else if (!whitelist.equals(other.whitelist)) + return false; + return true; + } } diff --git a/libLauncher/src/main/java/ru/gravit/utils/helper/JVMHelper.java b/libLauncher/src/main/java/ru/gravit/utils/helper/JVMHelper.java index 6d608413..32b66599 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/helper/JVMHelper.java +++ b/libLauncher/src/main/java/ru/gravit/utils/helper/JVMHelper.java @@ -14,7 +14,6 @@ import java.util.Map; public final class JVMHelper { - @SuppressWarnings("unused") @LauncherAPI public enum OS { MUSTDIE("mustdie"), LINUX("linux"), MACOSX("macosx"); @@ -84,7 +83,6 @@ public static Class firstClass(String... names) throws ClassNotFoundException } @LauncherAPI - @SuppressWarnings("CallToSystemGC") public static void fullGC() { RUNTIME.gc(); RUNTIME.runFinalization(); @@ -122,7 +120,6 @@ public static void checkStackTrace(Class mainClass) { } } - @SuppressWarnings("CallToSystemGetenv") private static int getCorrectOSArch() { // As always, mustdie must die if (OS_TYPE == OS.MUSTDIE)