From 0c19216c4c1ab3d2e5e60007524e400a8cf50e91 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Tue, 24 Mar 2020 13:08:23 +0000 Subject: [PATCH] Profiles: Remove unused ProfileManager.summarizePeers() --- .../src/net/i2p/router/ProfileManager.java | 5 -- .../peermanager/ProfileManagerImpl.java | 56 ------------------- 2 files changed, 61 deletions(-) diff --git a/router/java/src/net/i2p/router/ProfileManager.java b/router/java/src/net/i2p/router/ProfileManager.java index f861ab1861..2527d511c5 100644 --- a/router/java/src/net/i2p/router/ProfileManager.java +++ b/router/java/src/net/i2p/router/ProfileManager.java @@ -8,8 +8,6 @@ package net.i2p.router; * */ -import java.util.Properties; - import net.i2p.data.Hash; public interface ProfileManager { @@ -165,7 +163,4 @@ public interface ProfileManager { * */ void messageReceived(Hash peer, String style, long msToReceive, int bytesRead); - - /** provide a simple summary of a number of peers, suitable for publication in the netDb */ - Properties summarizePeers(int numPeers); } diff --git a/router/java/src/net/i2p/router/peermanager/ProfileManagerImpl.java b/router/java/src/net/i2p/router/peermanager/ProfileManagerImpl.java index 3f94394922..f7deae8304 100644 --- a/router/java/src/net/i2p/router/peermanager/ProfileManagerImpl.java +++ b/router/java/src/net/i2p/router/peermanager/ProfileManagerImpl.java @@ -8,8 +8,6 @@ package net.i2p.router.peermanager; * */ -import java.util.Properties; - import net.i2p.data.Hash; import net.i2p.router.ProfileManager; import net.i2p.router.RouterContext; @@ -352,58 +350,4 @@ public class ProfileManagerImpl implements ProfileManager { private PeerProfile getProfileNonblocking(Hash peer) { return _context.profileOrganizer().getProfileNonblocking(peer); } - - /** - * provide a simple summary of a number of peers, suitable for publication in the netDb - * @deprecated unused - */ - @Deprecated - public Properties summarizePeers(int numPeers) { -/**** - Set peers = new HashSet(numPeers); - // lets get the fastest ones we've got (this fails over to include just plain reliable, - // or even notFailing peers if there aren't enough fast ones) - _context.profileOrganizer().selectFastPeers(numPeers, null, peers); -****/ - Properties props = new Properties(); -/**** - for (Iterator iter = peers.iterator(); iter.hasNext(); ) { - Hash peer = (Hash)iter.next(); - PeerProfile prof = getProfile(peer); - if (prof == null) continue; - - StringBuilder buf = new StringBuilder(64); - - buf.append("status: "); - if (_context.profileOrganizer().isFast(peer)) { - buf.append("fast"); - } else if (_context.profileOrganizer().isHighCapacity(peer)) { - buf.append("highCapacity"); - } else if (_context.profileOrganizer().isFailing(peer)) { - buf.append("failing"); - } else { - buf.append("notFailing"); - } - - if (_context.profileOrganizer().isWellIntegrated(peer)) - buf.append("Integrated "); - else - buf.append(" "); - - buf.append("capacity: ").append(num(prof.getCapacityValue())).append(" "); - buf.append("speed: ").append(num(prof.getSpeedValue())).append(" "); - buf.append("integration: ").append(num(prof.getIntegrationValue())); - - props.setProperty("profile." + peer.toBase64().replace('=', '_'), buf.toString()); - } -****/ - return props; - } - -/**** - private final static DecimalFormat _fmt = new DecimalFormat("##0.00", new DecimalFormatSymbols(Locale.UK)); - private final static String num(double val) { - synchronized (_fmt) { return _fmt.format(val); } - } -****/ } -- GitLab