[CLEANUP] Formatted code

This commit is contained in:
Jeroen Ketelaar
2019-05-21 23:07:31 -05:00
parent f67d0ce985
commit 00b09a64f5
3 changed files with 15 additions and 16 deletions
@@ -24,9 +24,9 @@ import java.net.URL;
* @author JKetelaar * @author JKetelaar
*/ */
public class LocalPublicServerExecuter extends ServerExecuter { public class LocalPublicServerExecuter extends ServerExecuter {
private String serverName; private String serverName;
private String serverUrl; private String serverUrl;
private String providerUrl; private String providerUrl;
private ServerProviderInfo serverProviderInfo; private ServerProviderInfo serverProviderInfo;
public LocalPublicServerExecuter(final String serverName, final ServerProviderInfo serverProviderInfo, String serverUrl, String providerUrl) { public LocalPublicServerExecuter(final String serverName, final ServerProviderInfo serverProviderInfo, String serverUrl, String providerUrl) {
@@ -80,8 +80,8 @@ public class LocalPublicServerExecuter extends ServerExecuter {
BuildPath.add(destination.toURI().toURL()); BuildPath.add(destination.toURI().toURL());
ServerLoader serverLoader = new ServerLoader(classPath); ServerLoader serverLoader = new ServerLoader(classPath);
final String[] classNames = serverLoader.getServerClassNames(); final String[] classNames = serverLoader.getServerClassNames();
if (classNames.length == 0) { if (classNames.length == 0) {
UILog.log( UILog.log(
"Error", "Error",
@@ -16,8 +16,8 @@ import java.net.MalformedURLException;
*/ */
public class LocalServerExecuter extends ServerExecuter { public class LocalServerExecuter extends ServerExecuter {
private final Constructor<?> serverProviderConstructor; private final Constructor<?> serverProviderConstructor;
private ClassPath classPath; private ClassPath classPath;
private String serverName; private String serverName;
public LocalServerExecuter(Constructor<?> serverProviderConstructor, public LocalServerExecuter(Constructor<?> serverProviderConstructor,
ClassPath classPath, final String serverName) { ClassPath classPath, final String serverName) {
@@ -36,10 +36,9 @@ public class PublicServerExecuter extends ServerExecuter {
} }
}; };
private String serverName;
private PBLocalPreferences settings;
private final String cacheVersionKey = "cachedProviderVersion"; private final String cacheVersionKey = "cachedProviderVersion";
private String serverName;
private PBLocalPreferences settings;
public PublicServerExecuter(final String serverName) { public PublicServerExecuter(final String serverName) {
this.serverName = serverName; this.serverName = serverName;
@@ -58,14 +57,14 @@ public class PublicServerExecuter extends ServerExecuter {
Core.verbose("Downloading: " + jarUrl + " ..."); Core.verbose("Downloading: " + jarUrl + " ...");
String providerVersion = serverProviderInfo.getProviderVersion(); String providerVersion = serverProviderInfo.getProviderVersion();
if(providerVersion == null) { if (providerVersion == null) {
providerVersion = "error"; providerVersion = "error";
} }
settings = new PBLocalPreferences(serverProviderInfo.getClientCRC32()+".json"); settings = new PBLocalPreferences(serverProviderInfo.getClientCRC32() + ".json");
if(settings.getSetting(cacheVersionKey) != null) { if (settings.getSetting(cacheVersionKey) != null) {
Core.verbose(String.format("Latest provider version: %s, local provider version: %s", settings.getSetting(cacheVersionKey), providerVersion)); Core.verbose(String.format("Latest provider version: %s, local provider version: %s", settings.getSetting(cacheVersionKey), providerVersion));
if(!settings.getSetting(cacheVersionKey).equals(providerVersion)) { if (!settings.getSetting(cacheVersionKey).equals(providerVersion)) {
Core.verbose("Local provider outdated, clearing cache."); Core.verbose("Local provider outdated, clearing cache.");
Directories.clearCache(); Directories.clearCache();
} }
@@ -88,8 +87,8 @@ public class PublicServerExecuter extends ServerExecuter {
BuildPath.add(destination.toURI().toURL()); BuildPath.add(destination.toURI().toURL());
ServerLoader serverLoader = new ServerLoader(classPath); ServerLoader serverLoader = new ServerLoader(classPath);
final String[] classNames = serverLoader.getServerClassNames(); final String[] classNames = serverLoader.getServerClassNames();
if (classNames == null || classNames.length == 0) { if (classNames == null || classNames.length == 0) {
UILog.log( UILog.log(
"Error", "Error",