forked from I2P_Developers/i2p.i2p
Findbugs all over
- volatile -> atomic - unused code and fields - closing streams - hashCode / equals - known non-null - Number.valueOf - new String Still avoiding SAM, BOB, SusiMail
This commit is contained in:
@ -1104,7 +1104,6 @@ public class ConsoleUpdateManager implements UpdateManager {
|
||||
|
||||
case PLUGIN:
|
||||
Properties props = PluginStarter.pluginProperties(_context, id);
|
||||
String oldVersion = props.getProperty("version");
|
||||
String xpi2pURL = props.getProperty("updateURL");
|
||||
if (xpi2pURL != null) {
|
||||
try {
|
||||
@ -1472,6 +1471,12 @@ public class ConsoleUpdateManager implements UpdateManager {
|
||||
return VersionComparator.comp(version, r.version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() { return version.hashCode(); }
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) { return (o instanceof Version) && version.equals(((Version)o).version); }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Version " + version;
|
||||
|
@ -632,7 +632,7 @@ public class PluginStarter implements Runnable {
|
||||
|
||||
ClassLoader cl = null;
|
||||
if (app.classpath != null) {
|
||||
String cp = new String(app.classpath);
|
||||
String cp = app.classpath;
|
||||
if (cp.indexOf("$") >= 0) {
|
||||
cp = cp.replace("$I2P", ctx.getBaseDir().getAbsolutePath());
|
||||
cp = cp.replace("$CONFIG", ctx.getConfigDir().getAbsolutePath());
|
||||
|
@ -85,7 +85,7 @@ public class WebAppStarter {
|
||||
throw new IOException("Web app " + warPath + " does not exist");
|
||||
Long oldmod = warModTimes.get(warPath);
|
||||
if (oldmod == null) {
|
||||
warModTimes.put(warPath, new Long(newmod));
|
||||
warModTimes.put(warPath, Long.valueOf(newmod));
|
||||
} else if (oldmod.longValue() < newmod) {
|
||||
// copy war to temporary directory
|
||||
File warTmpDir = new SecureDirectory(ctx.getTempDir(), "war-copy-" + appName + ctx.random().nextInt());
|
||||
|
Reference in New Issue
Block a user