diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java index 37da75d7e08eb7d207d3e47b882f1d66de3c214a..96f9a0814aa70c580d5b76a55ebe7816ac84d182 100644 --- a/core/java/src/net/i2p/data/DataHelper.java +++ b/core/java/src/net/i2p/data/DataHelper.java @@ -109,6 +109,8 @@ public class DataHelper { } /** + * Writes the props to the stream, sorted by property name. + * * jrandom disabled UTF-8 in mid-2004, for performance reasons, * i.e. slow foo.getBytes("UTF-8") * Re-enable it so we can pass UTF-8 tunnel names through the I2CP SessionConfig. @@ -145,6 +147,11 @@ public class DataHelper { } } + /* + * Reads the props from the byte array + * @param props returned OrderedProperties (sorted by property name) + * @return new offset + */ public static int toProperties(byte target[], int offset, Properties props) throws DataFormatException, IOException { if (props != null) { OrderedProperties p = new OrderedProperties(); @@ -174,6 +181,11 @@ public class DataHelper { } } + /** + * Writes the props to the byte array, not sorted + * (unless the target param is an OrderedProperties) + * @return new offset + */ public static int fromProperties(byte source[], int offset, Properties target) throws DataFormatException, IOException { int size = (int)fromLong(source, offset, 2); offset += 2; @@ -196,6 +208,10 @@ public class DataHelper { return offset + size; } + /** + * Writes the props to returned byte array, not sorted + * (unless the opts param is an OrderedProperties) + */ public static byte[] toProperties(Properties opts) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(2); @@ -209,8 +225,8 @@ public class DataHelper { } /** - * Pretty print the mapping - * + * Pretty print the mapping, unsorted + * (unless the options param is an OrderedProperties) */ public static String toString(Properties options) { StringBuilder buf = new StringBuilder(); @@ -278,6 +294,7 @@ public class DataHelper { } /** + * Writes the props to the file, unsorted. * Note that this does not escape the \r or \n that are unescaped in loadProps() above. */ public static void storeProps(Properties props, File file) throws IOException { diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodSearchJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodSearchJob.java index f3a78b67edf06914efa8154f55b444f64a9f7d03..09f593c80a39308f0c9f0b65f2f8116e820dc128 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodSearchJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodSearchJob.java @@ -25,6 +25,8 @@ import net.i2p.util.Log; * * NOTE: Unused directly - see FloodOnlySearchJob extension which overrides almost everything. * TODO: Comment out or delete what we don't use here. + * + * Note that this does NOT extend SearchJob. */ public class FloodSearchJob extends JobImpl { protected Log _log; diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java index 4fbaf381e60d38685385c63f69ceb1f82d6ee911..719aea3d3cf78edc23c475c6f49753fdaa71736f 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java @@ -258,6 +258,8 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad /** * Ok, the initial set of searches to the floodfill peers timed out, lets fall back on the * wider kademlia-style searches + * + * Unused - called only by FloodSearchJob which is overridden - don't use this. */ void searchFull(Hash key, List<Job> onFind, List<Job> onFailed, long timeoutMs, boolean isLease) { synchronized (_activeFloodQueries) { _activeFloodQueries.remove(key); } diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java index 85cb962859f24250f862d65b3bbda06f2c92ae86..312fce6a7a250c247b4fa88ae5d4339258849351 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java @@ -827,6 +827,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade { * will fire the appropriate jobs on success or timeout (or if the kademlia search completes * without any match) * + * Unused - called only by FNDF.searchFull() from FloodSearchJob which is overridden - don't use this. */ SearchJob search(Hash key, Job onFindJob, Job onFailedLookupJob, long timeoutMs, boolean isLease) { if (!_initialized) return null;