From 4d7a3f7e9a6a37d79f2577dcc3f9094f943aeff1 Mon Sep 17 00:00:00 2001 From: Vhati Date: Fri, 15 Dec 2017 23:04:05 -0500 Subject: [PATCH] Trivial code cleanup --- src/main/java/net/vhati/modmanager/core/FTLUtilities.java | 4 ++-- .../java/net/vhati/modmanager/core/SlipstreamConfig.java | 2 +- src/main/java/net/vhati/modmanager/json/URLFetcher.java | 8 ++++---- .../net/vhati/modmanager/ui/StatusbarMouseListener.java | 6 ++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/vhati/modmanager/core/FTLUtilities.java b/src/main/java/net/vhati/modmanager/core/FTLUtilities.java index 5e27655..b9fceec 100644 --- a/src/main/java/net/vhati/modmanager/core/FTLUtilities.java +++ b/src/main/java/net/vhati/modmanager/core/FTLUtilities.java @@ -224,7 +224,7 @@ public class FTLUtilities { if ( System.getProperty( "os.name" ).startsWith( "Windows" ) ) { - for ( File candidateDir : new File[] {datsDir, datsDir.getParentFile()} ) { + for ( File candidateDir : new File[] { datsDir, datsDir.getParentFile() } ) { if ( candidateDir == null ) continue; File exeFile = new File( candidateDir, "FTLGame.exe" ); @@ -236,7 +236,7 @@ public class FTLUtilities { } else if ( System.getProperty( "os.name" ).equals( "Linux" ) ) { - for ( File candidateDir : new File[] {datsDir, datsDir.getParentFile()} ) { + for ( File candidateDir : new File[] { datsDir, datsDir.getParentFile() } ) { if ( candidateDir == null ) continue; File exeFile = new File( candidateDir, "FTL" ); diff --git a/src/main/java/net/vhati/modmanager/core/SlipstreamConfig.java b/src/main/java/net/vhati/modmanager/core/SlipstreamConfig.java index fc051a6..dccc548 100644 --- a/src/main/java/net/vhati/modmanager/core/SlipstreamConfig.java +++ b/src/main/java/net/vhati/modmanager/core/SlipstreamConfig.java @@ -36,7 +36,7 @@ public class SlipstreamConfig { } /** - * Returns a copy of an existing SlipstreamConfig object. + * Copy constructor. */ public SlipstreamConfig( SlipstreamConfig srcConfig ) { this.configFile = srcConfig.getConfigFile(); diff --git a/src/main/java/net/vhati/modmanager/json/URLFetcher.java b/src/main/java/net/vhati/modmanager/json/URLFetcher.java index e8c251b..ef425d7 100644 --- a/src/main/java/net/vhati/modmanager/json/URLFetcher.java +++ b/src/main/java/net/vhati/modmanager/json/URLFetcher.java @@ -76,7 +76,7 @@ public class URLFetcher { int responseCode = httpConn.getResponseCode(); if ( responseCode == HttpURLConnection.HTTP_NOT_MODIFIED ) { - log.debug( String.format( "No need to update \"%s\", the server's copy has not been modified since the previous check.", localFile.getName() ) ); + log.debug( String.format( "No need to update \"%s\", the server's copy has not been modified since the previous check", localFile.getName() ) ); // Update the local file's timestamp as if it had downloaded. localFile.setLastModified( new Date().getTime() ); @@ -98,12 +98,12 @@ public class URLFetcher { } } else { - log.error( String.format( "Download request failed for \"%s\": HTTP Code %d (%s).", httpConn.getURL(), responseCode, httpConn.getResponseMessage() ) ); + log.error( String.format( "Download request failed for \"%s\": HTTP Code %d (%s)", httpConn.getURL(), responseCode, httpConn.getResponseMessage() ) ); return false; } } catch ( IOException e ) { - log.error( String.format( "Error downloading the latest \"%s\".", localFile.getName() ), e ); + log.error( String.format( "Error downloading the latest \"%s\"", localFile.getName() ), e ); } finally { try {if ( urlIn != null ) urlIn.close();} @@ -123,7 +123,7 @@ public class URLFetcher { bw.flush(); } catch ( IOException e ) { - log.error( String.format( "Error writing eTag to \"%s\".", eTagFile.getName() ), e ); + log.error( String.format( "Error writing eTag to \"%s\"", eTagFile.getName() ), e ); } finally { try {if ( etagOut != null ) etagOut.close();} diff --git a/src/main/java/net/vhati/modmanager/ui/StatusbarMouseListener.java b/src/main/java/net/vhati/modmanager/ui/StatusbarMouseListener.java index 206379d..b8685e2 100644 --- a/src/main/java/net/vhati/modmanager/ui/StatusbarMouseListener.java +++ b/src/main/java/net/vhati/modmanager/ui/StatusbarMouseListener.java @@ -16,8 +16,10 @@ import net.vhati.modmanager.ui.Statusbar; * Then add this mouseListener to a component. */ public class StatusbarMouseListener extends MouseAdapter { - private Statusbar bar = null; - private String text = null; + + protected Statusbar bar = null; + protected String text = null; + public StatusbarMouseListener( Statusbar bar, String text ) { this.bar = bar;