diff --git a/core/src/main/java/com/threerings/getdown/Log.java b/core/src/main/java/com/threerings/getdown/Log.java index 2ad08a4..049c5bf 100644 --- a/core/src/main/java/com/threerings/getdown/Log.java +++ b/core/src/main/java/com/threerings/getdown/Log.java @@ -143,5 +143,5 @@ public final class Log protected final FieldPosition _fpos = new FieldPosition(SimpleDateFormat.DATE_FIELD); } - protected static final Level[] LEVELS = {Level.FINE, Level.INFO, Level.WARNING, Level.SEVERE}; + private static final Level[] LEVELS = {Level.FINE, Level.INFO, Level.WARNING, Level.SEVERE}; } diff --git a/core/src/main/java/com/threerings/getdown/util/LaunchUtil.java b/core/src/main/java/com/threerings/getdown/util/LaunchUtil.java index cc51794..1fa15ee 100644 --- a/core/src/main/java/com/threerings/getdown/util/LaunchUtil.java +++ b/core/src/main/java/com/threerings/getdown/util/LaunchUtil.java @@ -198,7 +198,7 @@ public final class LaunchUtil /** * Checks whether a Java Virtual Machine can be located in the supplied path. */ - protected static String checkJVMPath (String vmhome, boolean windebug) + private static String checkJVMPath(String vmhome, boolean windebug) { String vmbase = vmhome + File.separator + "bin" + File.separator; String vmpath = vmbase + "java"; @@ -222,11 +222,11 @@ public final class LaunchUtil } /** Flag indicating that we're on Windows; initialized when this class is first loaded. */ - protected static boolean _isWindows; + private static boolean _isWindows; /** Flag indicating that we're on MacOS; initialized when this class is first loaded. */ - protected static boolean _isMacOS; + private static boolean _isMacOS; /** Flag indicating that we're on Linux; initialized when this class is first loaded. */ - protected static boolean _isLinux; + private static boolean _isLinux; static { try { diff --git a/core/src/main/java/com/threerings/getdown/util/MessageUtil.java b/core/src/main/java/com/threerings/getdown/util/MessageUtil.java index f2ee9a2..85e94f5 100644 --- a/core/src/main/java/com/threerings/getdown/util/MessageUtil.java +++ b/core/src/main/java/com/threerings/getdown/util/MessageUtil.java @@ -140,5 +140,5 @@ public final class MessageUtil { /** Text prefixed by this character will be considered tainted when doing recursive * translations and won't be translated. */ - protected static final String TAINT_CHAR = "~"; + private static final String TAINT_CHAR = "~"; } diff --git a/core/src/test/java/com/threerings/getdown/cache/ResourceCacheTest.java b/core/src/test/java/com/threerings/getdown/cache/ResourceCacheTest.java index 6acffda..54bde28 100644 --- a/core/src/test/java/com/threerings/getdown/cache/ResourceCacheTest.java +++ b/core/src/test/java/com/threerings/getdown/cache/ResourceCacheTest.java @@ -75,7 +75,7 @@ public class ResourceCacheTest assertTrue(lastAccessedFile.lastModified() > lastAccessed); } - @Rule public TemporaryFolder _folder = new TemporaryFolder(); + @Rule public final TemporaryFolder _folder = new TemporaryFolder(); private File _fileToCache; private ResourceCache _cache; diff --git a/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java b/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java index 76970aa..517abf8 100644 --- a/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java +++ b/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java @@ -679,7 +679,7 @@ public abstract class Getdown /** The last percentage at which we checked for another getdown running, or -1 for not * having checked at all. */ - protected int _lastCheck = -1; + private int _lastCheck = -1; }; if (!dl.download(resources, _app.maxConcurrentDownloads())) { // if we aborted due to detecting another getdown running, we want to report here diff --git a/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java b/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java index 3859f6a..843e160 100644 --- a/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java +++ b/launcher/src/main/java/com/threerings/getdown/launcher/GetdownApp.java @@ -18,6 +18,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; +import java.nio.file.Files; import java.util.ArrayList; import java.util.List; @@ -70,7 +71,7 @@ public class GetdownApp File logFile = new File(envc.appDir, "launcher.log"); try { PrintStream logOut = new PrintStream( - new BufferedOutputStream(new FileOutputStream(logFile)), true); + new BufferedOutputStream(Files.newOutputStream(logFile.toPath())), true); System.setOut(logOut); System.setErr(logOut); } catch (IOException ioe) { @@ -244,7 +245,7 @@ public class GetdownApp }); } - protected JFrame _frame; + private JFrame _frame; }; Getdown.run(getdown); return getdown; diff --git a/launcher/src/main/java/com/threerings/getdown/launcher/ProxyPanel.java b/launcher/src/main/java/com/threerings/getdown/launcher/ProxyPanel.java index 6705868..1e21e4f 100644 --- a/launcher/src/main/java/com/threerings/getdown/launcher/ProxyPanel.java +++ b/launcher/src/main/java/com/threerings/getdown/launcher/ProxyPanel.java @@ -156,7 +156,7 @@ public final class ProxyPanel extends JPanel implements ActionListener } /** Used to look up localized messages. */ - protected String get (String key) + private String get(String key) { // if this string is tainted, we don't translate it, instead we // simply remove the taint character and return it to the caller @@ -188,18 +188,18 @@ public final class ProxyPanel extends JPanel implements ActionListener } } - protected static Dimension clampWidth (Dimension dim, int minWidth) { + private static Dimension clampWidth(Dimension dim, int minWidth) { dim.width = Math.max(dim.width, minWidth); return dim; } - protected final Getdown _getdown; - protected final ResourceBundle _msgs; - protected final boolean _updateAuth; + private final Getdown _getdown; + private final ResourceBundle _msgs; + private final boolean _updateAuth; - protected final JTextField _host; - protected final JTextField _port; - protected final JCheckBox _useAuth; - protected final JTextField _username; - protected final JPasswordField _password; + private final JTextField _host; + private final JTextField _port; + private final JCheckBox _useAuth; + private final JTextField _username; + private final JPasswordField _password; } diff --git a/launcher/src/main/java/com/threerings/getdown/launcher/StatusPanel.java b/launcher/src/main/java/com/threerings/getdown/launcher/StatusPanel.java index 197dc91..9abac12 100644 --- a/launcher/src/main/java/com/threerings/getdown/launcher/StatusPanel.java +++ b/launcher/src/main/java/com/threerings/getdown/launcher/StatusPanel.java @@ -372,7 +372,7 @@ public final class StatusPanel extends JComponent protected RotatingBackgrounds _bg; protected Dimension _psize; - protected ResourceBundle _msgs; + protected final ResourceBundle _msgs; protected int _progress = -1; protected String _status; @@ -383,9 +383,9 @@ public final class StatusPanel extends JComponent protected Label _rlabel, _newrlab; protected UpdateInterface _ifc; - protected Timer _timer; + protected final Timer _timer; - protected long[] _remain = new long[4]; + protected final long[] _remain = new long[4]; protected int _ridx; protected Throttle _rthrottle = new Throttle(1, 1000L);