Trivial code cleanup
This commit is contained in:
parent
8912fec70e
commit
4d7a3f7e9a
4 changed files with 11 additions and 9 deletions
|
@ -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" );
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue