From a2b3ac523b4eb02b85cb651647ab8687ddbe9c95 Mon Sep 17 00:00:00 2001 From: Gravit Date: Tue, 15 Jan 2019 10:32:46 +0700 Subject: [PATCH] [ANY] IDEA Code Cleanup --- .../launchserver/asm/ClassMetadataReader.java | 2 +- .../JsonFilePermissionsHandler.java | 2 +- .../auth/provider/RejectAuthProvider.java | 34 +++++------ .../launchserver/binary/tasks/TaskUtil.java | 16 ++--- .../command/service/ConfigListCommand.java | 2 +- .../command/service/ReloadListCommand.java | 2 +- .../command/service/ServerStatusCommand.java | 2 +- .../service/SwapAuthProviderCommand.java | 58 +++++++++---------- .../launchserver/manangers/MirrorManager.java | 2 +- .../manangers/ReconfigurableManager.java | 2 +- .../websocket/WebSocketFrameHandler.java | 2 +- .../socket/websocket/json/SimpleResponse.java | 2 +- .../json/admin/ExecCommandResponse.java | 2 +- .../json/auth/CheckServerResponse.java | 2 +- .../json/auth/JoinServerResponse.java | 2 +- .../json/update/LauncherResponse.java | 2 +- .../json/update/UpdateListResponse.java | 2 +- .../ru/gravit/launcher/client/DirBridge.java | 2 +- .../launcher/client/FunctionalBridge.java | 5 +- .../launcher/client/LauncherSettings.java | 2 +- .../request/update/LauncherRequest.java | 3 +- .../request/websockets/ClientJSONPoint.java | 2 +- .../gravit/launcher/server/ServerAgent.java | 2 +- .../launcher/profiles/ClientProfile.java | 12 ++-- modules | 2 +- 25 files changed, 73 insertions(+), 93 deletions(-) diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/asm/ClassMetadataReader.java b/LaunchServer/src/main/java/ru/gravit/launchserver/asm/ClassMetadataReader.java index fd6e8ca5..abc16cd6 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/asm/ClassMetadataReader.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/asm/ClassMetadataReader.java @@ -98,7 +98,7 @@ public ArrayList getSuperClasses(String type) { } @Override - public void close() throws IOException { + public void close() { cp.stream().forEach(IOHelper::close); cp.clear(); } 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 72aa37ca..efcc369b 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 @@ -22,7 +22,7 @@ public class JsonFilePermissionsHandler extends PermissionsHandler implements Re public static Map map; @Override - public void reload() throws Exception { + public void reload() { map.clear(); Path path = Paths.get(filename); Type type = new TypeToken>(){}.getType(); 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 efe8af0a..eeda33f8 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 @@ -40,24 +40,22 @@ public void close() { @Override public void reconfig(String action, String[] args) { - if(action.equals("message")) - { - message = args[0]; - LogHelper.info("New reject message: %s", message); - } - else if(action.equals("whitelist.add")) - { - if(whitelist == null) whitelist = new ArrayList<>(); - whitelist.add(args[0]); - } - else if(action.equals("whitelist.remove")) - { - if(whitelist == null) whitelist = new ArrayList<>(); - whitelist.remove(args[0]); - } - else if(action.equals("whitelist.clear")) - { - whitelist.clear(); + switch (action) { + case "message": + message = args[0]; + LogHelper.info("New reject message: %s", message); + break; + case "whitelist.add": + if (whitelist == null) whitelist = new ArrayList<>(); + whitelist.add(args[0]); + break; + case "whitelist.remove": + if (whitelist == null) whitelist = new ArrayList<>(); + whitelist.remove(args[0]); + break; + case "whitelist.clear": + whitelist.clear(); + break; } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/TaskUtil.java b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/TaskUtil.java index 8175b7e1..0bc00498 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/TaskUtil.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/binary/tasks/TaskUtil.java @@ -8,22 +8,14 @@ public final class TaskUtil { public static void addCounted(List tasks, int count, Predicate pred, LauncherBuildTask taskAdd) { List indexes = new ArrayList<>(); - tasks.stream().filter(pred).forEach(e -> { - indexes.add(e); - }); - indexes.forEach(e -> { - tasks.add(tasks.indexOf(e)+count, taskAdd); - }); + tasks.stream().filter(pred).forEach(e -> indexes.add(e)); + indexes.forEach(e -> tasks.add(tasks.indexOf(e)+count, taskAdd)); } public static void replaceCounted(List tasks, int count, Predicate pred, LauncherBuildTask taskRep) { List indexes = new ArrayList<>(); - tasks.stream().filter(pred).forEach(e -> { - indexes.add(e); - }); - indexes.forEach(e -> { - tasks.set(tasks.indexOf(e)+count, taskRep); - }); + tasks.stream().filter(pred).forEach(e -> indexes.add(e)); + indexes.forEach(e -> tasks.set(tasks.indexOf(e)+count, taskRep)); } public static void addPre(List tasks, Predicate pred, LauncherBuildTask taskAdd) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ConfigListCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ConfigListCommand.java index 186d0e1e..3e2a19e2 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ConfigListCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ConfigListCommand.java @@ -19,7 +19,7 @@ public String getUsageDescription() { } @Override - public void invoke(String... args) throws Exception { + public void invoke(String... args) { server.reconfigurableManager.printReconfigurables(); } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ReloadListCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ReloadListCommand.java index e588a796..5273fdb5 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ReloadListCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ReloadListCommand.java @@ -19,7 +19,7 @@ public String getUsageDescription() { } @Override - public void invoke(String... args) throws Exception { + public void invoke(String... args) { server.reloadManager.printReloadables(); } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ServerStatusCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ServerStatusCommand.java index 8978453b..d43e4026 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ServerStatusCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/ServerStatusCommand.java @@ -22,7 +22,7 @@ public String getUsageDescription() { } @Override - public void invoke(String... args) throws Exception { + public void invoke(String... args) { LogHelper.info("Show server status"); LogHelper.info("Memory: free %d | total: %d | max: %d", JVMHelper.RUNTIME.freeMemory(), JVMHelper.RUNTIME.totalMemory(),JVMHelper.RUNTIME.maxMemory()); long uptime = JVMHelper.RUNTIME_MXBEAN.getUptime() / 1000; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/SwapAuthProviderCommand.java b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/SwapAuthProviderCommand.java index 6a69c785..b6d84a92 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/SwapAuthProviderCommand.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/command/service/SwapAuthProviderCommand.java @@ -29,38 +29,34 @@ public void invoke(String... args) throws Exception { verifyArgs(args,2); if(providersCache == null) providersCache = new AuthProvider[server.config.authProvider.length]; int index = Integer.valueOf(args[0]); - if(args[1].equals("accept")) - { - if(providersCache[index] == null) - { - AcceptAuthProvider provider = new AcceptAuthProvider(); - providersCache[index] = server.config.authProvider[index]; - server.config.authProvider[index] = provider; - LogHelper.info("AuthProvider[%d] is AcceptAuthProvider",index); - } - else LogHelper.error("Changes detected. Use undo"); - } else if(args[1].equals("reject")) - { - if(providersCache[index] == null) - { - RejectAuthProvider rejectAuthProvider; - if(args.length < 3) rejectAuthProvider = new RejectAuthProvider(); - else rejectAuthProvider = new RejectAuthProvider(args[2]); - providersCache[index] = server.config.authProvider[index]; - server.config.authProvider[index] = rejectAuthProvider; - LogHelper.info("AuthProvider[%d] is RejectAuthProvider",index); - } - else LogHelper.error("Changes detected. Use undo"); - } else if(args[1].equals("undo")) - { - if(providersCache[index] == null) LogHelper.error("Cache clean. Undo impossible"); - else - { - server.config.authProvider[index].close(); - server.config.authProvider[index] = providersCache[index]; - providersCache[index] = null; - } + switch (args[1]) { + case "accept": + if (providersCache[index] == null) { + AcceptAuthProvider provider = new AcceptAuthProvider(); + providersCache[index] = server.config.authProvider[index]; + server.config.authProvider[index] = provider; + LogHelper.info("AuthProvider[%d] is AcceptAuthProvider", index); + } else LogHelper.error("Changes detected. Use undo"); + break; + case "reject": + if (providersCache[index] == null) { + RejectAuthProvider rejectAuthProvider; + if (args.length < 3) rejectAuthProvider = new RejectAuthProvider(); + else rejectAuthProvider = new RejectAuthProvider(args[2]); + providersCache[index] = server.config.authProvider[index]; + server.config.authProvider[index] = rejectAuthProvider; + LogHelper.info("AuthProvider[%d] is RejectAuthProvider", index); + } else LogHelper.error("Changes detected. Use undo"); + break; + case "undo": + if (providersCache[index] == null) LogHelper.error("Cache clean. Undo impossible"); + else { + server.config.authProvider[index].close(); + server.config.authProvider[index] = providersCache[index]; + providersCache[index] = null; + } + break; } } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/MirrorManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/MirrorManager.java index 89633b36..8faf84a4 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/MirrorManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/MirrorManager.java @@ -34,7 +34,7 @@ public URL getClientsURL(String client) throws MalformedURLException { protected ArrayList list = new ArrayList<>(); private Mirror defaultMirror; - public void addMirror(String mirror) throws MalformedURLException { + public void addMirror(String mirror) { Mirror m = new Mirror(mirror); m.enabled = true; if (defaultMirror == null) defaultMirror = m; 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 36a7cddd..ccaed96d 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java @@ -19,7 +19,7 @@ public void printHelp(String name) { RECONFIGURABLE.get(name).printConfigHelp(); } - public void call(String name, String action, String[] args) throws Exception { + public void call(String name, String action, String[] args) { RECONFIGURABLE.get(name).reconfig(action,args); } public void printReconfigurables() diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/WebSocketFrameHandler.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/WebSocketFrameHandler.java index 7f548c8d..670c4bf1 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/WebSocketFrameHandler.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/WebSocketFrameHandler.java @@ -31,7 +31,7 @@ public void channelActive(ChannelHandlerContext ctx) { } @Override - protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) throws Exception { + protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) { // ping and pong frames already handled if (frame instanceof TextWebSocketFrame) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/SimpleResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/SimpleResponse.java index 8c6f34f7..7f78179d 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/SimpleResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/SimpleResponse.java @@ -11,7 +11,7 @@ public String getType() { } @Override - public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) { } } diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/admin/ExecCommandResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/admin/ExecCommandResponse.java index e05ca52c..3ecd04d9 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/admin/ExecCommandResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/admin/ExecCommandResponse.java @@ -15,7 +15,7 @@ public String getType() { } @Override - public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) { if (!client.isAuth) { service.sendObject(ctx, new WebSocketService.ErrorResult("Access denied")); return; diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/CheckServerResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/CheckServerResponse.java index c88c8486..db7940ce 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/CheckServerResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/CheckServerResponse.java @@ -18,7 +18,7 @@ public String getType() { } @Override - public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) { try { LaunchServer.server.config.authHandler.checkServer(username, serverID); } catch (AuthException e) { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/JoinServerResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/JoinServerResponse.java index 0ece3b78..612c9e4a 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/JoinServerResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/auth/JoinServerResponse.java @@ -19,7 +19,7 @@ public String getType() { } @Override - public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) { boolean success; try { success = LaunchServer.server.config.authHandler.joinServer(username, accessToken, serverID); diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/LauncherResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/LauncherResponse.java index a3003988..28cc86ad 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/LauncherResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/LauncherResponse.java @@ -24,7 +24,7 @@ public String getType() { } @Override - public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) { byte[] bytes = Base64.getDecoder().decode(hash); if (launcher_type == 1) // JAR { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/UpdateListResponse.java b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/UpdateListResponse.java index ac7d68d1..520ec3b5 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/UpdateListResponse.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/socket/websocket/json/update/UpdateListResponse.java @@ -16,7 +16,7 @@ public String getType() { } @Override - public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) throws Exception { + public void execute(WebSocketService service, ChannelHandlerContext ctx, Client client) { if (!client.isAuth) { service.sendObject(ctx, new WebSocketService.ErrorResult("Access denied")); return; diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/DirBridge.java b/Launcher/src/main/java/ru/gravit/launcher/client/DirBridge.java index 0b3890b1..4d7b346d 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/DirBridge.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/DirBridge.java @@ -61,7 +61,7 @@ public static Path getLauncherDir(String projectname) throws IOException { } @LauncherAPI - public static Path getLegacyLauncherDir(String projectname) throws IOException { + public static Path getLegacyLauncherDir(String projectname) { return IOHelper.HOME_DIR.resolve(projectname); } diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java b/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java index 8b94f5fe..ddee8bdb 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/FunctionalBridge.java @@ -17,7 +17,6 @@ import java.io.IOException; import java.nio.file.Path; -import java.security.SignatureException; import java.util.concurrent.atomic.AtomicReference; public class FunctionalBridge { @@ -33,7 +32,7 @@ public class FunctionalBridge { public static Thread getHWID = null; @LauncherAPI - public static HashedDirRunnable offlineUpdateRequest(String dirName, Path dir, SignedObjectHolder hdir, FileNameMatcher matcher, boolean digest) throws Exception { + public static HashedDirRunnable offlineUpdateRequest(String dirName, Path dir, SignedObjectHolder hdir, FileNameMatcher matcher, boolean digest) { return () -> { if (hdir == null) { Request.requestError(java.lang.String.format("Директории '%s' нет в кэше", dirName)); @@ -44,7 +43,7 @@ public static HashedDirRunnable offlineUpdateRequest(String dirName, Path dir, S } @LauncherAPI - public static LegacyLauncherRequest.Result offlineLauncherRequest() throws IOException, SignatureException { + public static LegacyLauncherRequest.Result offlineLauncherRequest() throws IOException { if (settings.lastDigest == null || settings.lastProfiles.isEmpty()) { Request.requestError("Запуск в оффлайн-режиме невозможен"); } diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/LauncherSettings.java b/Launcher/src/main/java/ru/gravit/launcher/client/LauncherSettings.java index 49a079fd..89aef608 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/LauncherSettings.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/LauncherSettings.java @@ -62,7 +62,7 @@ public void load() throws SignatureException { } @LauncherAPI - public void save() throws SignatureException { + public void save() { LogHelper.debug("Save settings file"); try { try (HOutput output = new HOutput(IOHelper.newOutput(file))) { 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 adf44662..f8ed16ff 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 @@ -14,7 +14,6 @@ import java.io.IOException; import java.nio.file.Path; -import java.security.SignatureException; import java.util.ArrayList; import java.util.List; @@ -46,7 +45,7 @@ public byte[] getDigest() { public static final boolean EXE_BINARY = IOHelper.hasExtension(BINARY_PATH, "exe"); @LauncherAPI - public static void update(LauncherConfig config, Result result) throws SignatureException, IOException { + public static void update(LauncherConfig config, Result result) throws IOException { List args = new ArrayList<>(8); args.add(IOHelper.resolveJavaBin(null).toString()); if (LogHelper.isDebugEnabled()) diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ClientJSONPoint.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ClientJSONPoint.java index 070e61d8..eb4c9aa0 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ClientJSONPoint.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/websockets/ClientJSONPoint.java @@ -51,7 +51,7 @@ public void send(String js) throws IOException { session.getBasicRemote().sendText(js); } - public void sendAsync(String js) throws IOException { + public void sendAsync(String js) { session.getAsyncRemote().sendText(js); } } \ No newline at end of file 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 e90e1f32..8727ca82 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerAgent.java @@ -30,7 +30,7 @@ public static void addJVMClassPath(String path) throws IOException { inst.appendToSystemClassLoaderSearch(new JarFile(path)); } - public static void addJVMClassPath(JarFile file) throws IOException { + public static void addJVMClassPath(JarFile file) { LogHelper.debug("Load %s", file.getName()); inst.appendToSystemClassLoaderSearch(file); } 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 93ab5517..f9e3c86d 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/profiles/ClientProfile.java @@ -6,7 +6,6 @@ import ru.gravit.utils.helper.IOHelper; import ru.gravit.utils.helper.VerifyHelper; -import java.io.IOException; import java.net.InetSocketAddress; import java.util.*; @@ -383,7 +382,7 @@ else if(f.dependenciesCount.size() <= 1) } } - public void pushOptional(HashedDir dir, boolean digest) throws IOException { + public void pushOptional(HashedDir dir, boolean digest) { for (OptionalFile opt : updateOptional) { if (!opt.mark) dir.removeR(opt.file); } @@ -592,10 +591,7 @@ public boolean equals(Object obj) { } 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; - } + return other.whitelist == null; + } else return whitelist.equals(other.whitelist); + } } diff --git a/modules b/modules index ee2f9e66..bb4430df 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit ee2f9e6646a8f1972ceda68d56e88e71ab74f78f +Subproject commit bb4430df933db257638191857577824820b18c4a