forked from I2P_Developers/i2p.i2p
Findbugs all over:
- Serializable - hashCode() - Make DataStructureImpl Serializable (removed from DataStructure in 2005)
This commit is contained in:
@@ -1584,6 +1584,12 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
return super.equals(o) && (o instanceof VersionAvailable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
// findbugs
|
||||
return super.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VersionAvailable \"" + version + "\" " + sourceMap +
|
||||
|
||||
@@ -9,6 +9,7 @@ package net.i2p.router.web;
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.Writer;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
@@ -30,7 +31,7 @@ public class BanlistRenderer {
|
||||
_context = context;
|
||||
}
|
||||
|
||||
private static class HashComparator implements Comparator<Hash> {
|
||||
private static class HashComparator implements Comparator<Hash>, Serializable {
|
||||
public int compare(Hash l, Hash r) {
|
||||
return l.toBase64().compareTo(r.toBase64());
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package net.i2p.router.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.text.Collator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -171,6 +171,7 @@ public class ConfigStatsHelper extends HelperBase {
|
||||
|
||||
/**
|
||||
* Translated sort
|
||||
* Inner class, can't be Serializable
|
||||
* @since 0.9.4
|
||||
*/
|
||||
private class AlphaComparator implements Comparator<String> {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.i2p.router.web;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.Writer;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
@@ -440,7 +441,7 @@ public class GraphHelper extends FormHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private static class AlphaComparator implements Comparator<SummaryListener> {
|
||||
private static class AlphaComparator implements Comparator<SummaryListener>, Serializable {
|
||||
public int compare(SummaryListener l, SummaryListener r) {
|
||||
String lName = l.getRate().getRateStat().getName();
|
||||
String rName = r.getRate().getRateStat().getName();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.i2p.router.web;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
@@ -238,7 +239,7 @@ public class HomeHelper extends HelperBase {
|
||||
}
|
||||
|
||||
/** ignore case, current locale */
|
||||
private static class AppComparator implements Comparator<App> {
|
||||
private static class AppComparator implements Comparator<App>, Serializable {
|
||||
public int compare(App l, App r) {
|
||||
return l.name.toLowerCase().compareTo(r.name.toLowerCase());
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.i2p.router.web;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Serializable;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -204,14 +205,14 @@ public class JobQueueHelper extends HelperBase {
|
||||
}
|
||||
|
||||
/** @since 0.8.9 */
|
||||
private static class JobStatsComparator implements Comparator<JobStats> {
|
||||
private static class JobStatsComparator implements Comparator<JobStats>, Serializable {
|
||||
public int compare(JobStats l, JobStats r) {
|
||||
return l.getName().compareTo(r.getName());
|
||||
}
|
||||
}
|
||||
|
||||
/** @since 0.9.5 */
|
||||
private static class JobCountComparator implements Comparator<String> {
|
||||
private static class JobCountComparator implements Comparator<String>, Serializable {
|
||||
private final ObjectCounter<String> _counter;
|
||||
|
||||
public JobCountComparator(ObjectCounter<String> counter) {
|
||||
|
||||
@@ -9,6 +9,7 @@ package net.i2p.router.web;
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.Writer;
|
||||
import java.math.BigInteger; // debug
|
||||
import java.text.Collator;
|
||||
@@ -46,6 +47,9 @@ public class NetDbRenderer {
|
||||
_context = ctx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inner class, can't be Serializable
|
||||
*/
|
||||
private class LeaseSetComparator implements Comparator<LeaseSet> {
|
||||
public int compare(LeaseSet l, LeaseSet r) {
|
||||
Destination dl = l.getDestination();
|
||||
@@ -59,7 +63,7 @@ public class NetDbRenderer {
|
||||
}
|
||||
|
||||
/** for debugging @since 0.7.14 */
|
||||
private static class LeaseSetRoutingKeyComparator implements Comparator<LeaseSet> {
|
||||
private static class LeaseSetRoutingKeyComparator implements Comparator<LeaseSet>, Serializable {
|
||||
private final Hash _us;
|
||||
public LeaseSetRoutingKeyComparator(Hash us) {
|
||||
_us = us;
|
||||
@@ -69,7 +73,7 @@ public class NetDbRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
private static class RouterInfoComparator implements Comparator<RouterInfo> {
|
||||
private static class RouterInfoComparator implements Comparator<RouterInfo>, Serializable {
|
||||
public int compare(RouterInfo l, RouterInfo r) {
|
||||
return l.getIdentity().getHash().toBase64().compareTo(r.getIdentity().getHash().toBase64());
|
||||
}
|
||||
@@ -365,9 +369,13 @@ public class NetDbRenderer {
|
||||
return Translate.getString(name, _context, Messages.COUNTRY_BUNDLE_NAME);
|
||||
}
|
||||
|
||||
/** sort by translated country name using rules for the current language setting */
|
||||
/**
|
||||
* Sort by translated country name using rules for the current language setting
|
||||
* Inner class, can't be Serializable
|
||||
*/
|
||||
private class CountryComparator implements Comparator<String> {
|
||||
Collator coll;
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final Collator coll;
|
||||
|
||||
public CountryComparator() {
|
||||
super();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.i2p.router.web;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.Writer;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Comparator;
|
||||
@@ -330,7 +331,7 @@ class ProfileOrganizerRenderer {
|
||||
* Used for floodfill-only page
|
||||
* @since 0.9.8
|
||||
*/
|
||||
private static class HashComparator implements Comparator<PeerProfile> {
|
||||
private static class HashComparator implements Comparator<PeerProfile>, Serializable {
|
||||
public int compare(PeerProfile left, PeerProfile right) {
|
||||
return left.getPeer().toBase64().compareTo(right.getPeer().toBase64());
|
||||
}
|
||||
|
||||
@@ -252,6 +252,7 @@ public class StatsGenerator {
|
||||
|
||||
/**
|
||||
* Translated sort
|
||||
* Inner class, can't be Serializable
|
||||
* @since 0.9.3
|
||||
*/
|
||||
private class AlphaComparator implements Comparator<String> {
|
||||
|
||||
@@ -461,7 +461,10 @@ public class SummaryHelper extends HelperBase {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/** compare translated nicknames - put "shared clients" first in the sort */
|
||||
/**
|
||||
* Compare translated nicknames - put "shared clients" first in the sort
|
||||
* Inner class, can't be Serializable
|
||||
*/
|
||||
private class AlphaComparator implements Comparator<Destination> {
|
||||
private final String xsc = _("shared clients");
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.i2p.router.web;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -133,7 +134,7 @@ public class TunnelRenderer {
|
||||
out.write("</div>");
|
||||
}
|
||||
|
||||
private static class TunnelComparator implements Comparator<HopConfig> {
|
||||
private static class TunnelComparator implements Comparator<HopConfig>, Serializable {
|
||||
public int compare(HopConfig l, HopConfig r) {
|
||||
return (r.getProcessedMessagesCount() - l.getProcessedMessagesCount());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user