diff --git a/core/java/src/net/i2p/client/I2PClient.java b/core/java/src/net/i2p/client/I2PClient.java index 3942aeb6e74aaa46df5514f5767a2b99b157abf5..2b2474c91a3d0adb8547ff9e47521d388052947e 100644 --- a/core/java/src/net/i2p/client/I2PClient.java +++ b/core/java/src/net/i2p/client/I2PClient.java @@ -47,7 +47,7 @@ public interface I2PClient { public static final SigType DEFAULT_SIGTYPE = SigType.DSA_SHA1; /** - * For router->client payloads. + * For router->client payloads. * * If false, the router will send the MessageStatus, * the client must respond with a ReceiveMessageBegin, diff --git a/core/java/src/net/i2p/client/I2PSession.java b/core/java/src/net/i2p/client/I2PSession.java index 818cb598350ed28d27738f665689b9cb3120549d..069907d9cf0b93a5d0eb22196a5ad0eabd7dc960 100644 --- a/core/java/src/net/i2p/client/I2PSession.java +++ b/core/java/src/net/i2p/client/I2PSession.java @@ -73,7 +73,7 @@ public interface I2PSession { * End-to-End Crypto is disabled, tags and keys are ignored! * * Like sendMessage above, except the key used and the tags sent are exposed to the - * application. <p /> + * application. <p> * * If some application layer message delivery confirmation is used, * rather than i2p's (slow) built in confirmation via guaranteed delivery mode, the @@ -331,7 +331,7 @@ public interface I2PSession { * Suggested implementation: * *<pre> - * if (name.length() == 60 && name.toLowerCase(Locale.US).endsWith(".b32.i2p")) { + * if (name.length() == 60 && name.toLowerCase(Locale.US).endsWith(".b32.i2p")) { * if (session != null) * return session.lookup(Hash.create(Base32.decode(name.toLowerCase(Locale.US).substring(0, 52)))); * else diff --git a/core/java/src/net/i2p/client/impl/I2PClientMessageHandlerMap.java b/core/java/src/net/i2p/client/impl/I2PClientMessageHandlerMap.java index 4cea850b79d25a25cd886ecafac74dc1a920ca74..48d67b09f33d773597c21e5e24fa7d7f605bbeaf 100644 --- a/core/java/src/net/i2p/client/impl/I2PClientMessageHandlerMap.java +++ b/core/java/src/net/i2p/client/impl/I2PClientMessageHandlerMap.java @@ -27,7 +27,7 @@ import net.i2p.data.i2cp.SetDateMessage; * @author jrandom */ class I2PClientMessageHandlerMap { - /** map of message type id --> I2CPMessageHandler */ + /** map of message type id --> I2CPMessageHandler */ protected I2CPMessageHandler _handlers[]; /** for extension */ diff --git a/core/java/src/net/i2p/client/impl/I2PSessionImpl.java b/core/java/src/net/i2p/client/impl/I2PSessionImpl.java index c199fa8c6f9f95ddaf475b6c3f785d66daf4dff2..021a2d901cd9131cbb606c88bb986b53e9dd425b 100644 --- a/core/java/src/net/i2p/client/impl/I2PSessionImpl.java +++ b/core/java/src/net/i2p/client/impl/I2PSessionImpl.java @@ -124,7 +124,7 @@ public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2 /** class that generates new messages */ protected final I2CPMessageProducer _producer; - /** map of Long --> MessagePayloadMessage */ + /** map of Long --> MessagePayloadMessage */ protected Map<Long, MessagePayloadMessage> _availableMessages; /** hashes of lookups we are waiting for */ diff --git a/core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java b/core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java index 9b6f1ff0c8bd170bdbde3d8f4bd01c6dc72c51ab..049bd3d91b58868791836080d15e2afc3d1b492c 100644 --- a/core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java +++ b/core/java/src/net/i2p/client/impl/I2PSessionMuxedImpl.java @@ -34,17 +34,17 @@ import net.i2p.util.Log; * Therefore the compatibility situation is as follows: * * Compatibility: - * old streaming -> new streaming: sends proto anything, rcvs proto anything - * new streaming -> old streaming: sends PROTO_STREAMING, ignores rcvd proto - * old datagram -> new datagram: sends proto anything, rcvs proto anything - * new datagram -> old datagram: sends PROTO_DATAGRAM, ignores rcvd proto + * old streaming -> new streaming: sends proto anything, rcvs proto anything + * new streaming -> old streaming: sends PROTO_STREAMING, ignores rcvd proto + * old datagram -> new datagram: sends proto anything, rcvs proto anything + * new datagram -> old datagram: sends PROTO_DATAGRAM, ignores rcvd proto * In all the above cases, streaming and datagram receive traffic for the other * protocol, same as before. * - * old datagram -> new muxed: doesn't work because the old sends proto 0 but the udp side + * old datagram -> new muxed: doesn't work because the old sends proto 0 but the udp side * of the mux registers with PROTO_DATAGRAM, so the datagrams * go to the streaming side, same as before. - * old streaming -> new muxed: works + * old streaming -> new muxed: works * * Typical Usage: * Streaming + datagrams: @@ -421,7 +421,7 @@ class I2PSessionMuxedImpl extends I2PSessionImpl2 { /** * No, we couldn't put any protocol byte in front of everything and * keep backward compatibility. But there are several bytes that - * are unused AND unchecked in the gzip header in releases <= 0.7. + * are unused AND unchecked in the gzip header in releases <= 0.7. * So let's use 5 of them for a protocol and two 2-byte ports. * * Following are all the methods to hide the diff --git a/core/java/src/net/i2p/crypto/SHA1.java b/core/java/src/net/i2p/crypto/SHA1.java index bfe07630ca2bc97408efd9a15dc38b1dfa77f699..e64a4da0b47a2ab8f3cc31a51cace010c3e9b311 100644 --- a/core/java/src/net/i2p/crypto/SHA1.java +++ b/core/java/src/net/i2p/crypto/SHA1.java @@ -28,8 +28,8 @@ import net.i2p.util.SystemVersion; * * <p>The FIPS PUB 180-2 standard specifies four secure hash algorithms (SHA-1, * SHA-256, SHA-384 and SHA-512) for computing a condensed representation of - * electronic data (message). When a message of any length < 2^^64 bits (for - * SHA-1 and SHA-256) or < 2^^128 bits (for SHA-384 and SHA-512) is input to + * electronic data (message). When a message of any length < 2^^64 bits (for + * SHA-1 and SHA-256) or < 2^^128 bits (for SHA-384 and SHA-512) is input to * an algorithm, the result is an output called a message digest. The message * digests range in length from 160 to 512 bits, depending on the algorithm. * Secure hash algorithms are typically used with other cryptographic diff --git a/core/java/src/net/i2p/crypto/eddsa/math/ed25519/Ed25519LittleEndianEncoding.java b/core/java/src/net/i2p/crypto/eddsa/math/ed25519/Ed25519LittleEndianEncoding.java index 75e1196dd4480a7900dff578d570b6a28275a2e8..670da6471c75de726a75474333bbe0d56f5badd4 100644 --- a/core/java/src/net/i2p/crypto/eddsa/math/ed25519/Ed25519LittleEndianEncoding.java +++ b/core/java/src/net/i2p/crypto/eddsa/math/ed25519/Ed25519LittleEndianEncoding.java @@ -18,22 +18,22 @@ public class Ed25519LittleEndianEncoding extends Encoding { * Assumption: * <p><ul> * <li>p = 2^255 - 19 - * <li>h = h0 + 2^25 * h1 + 2^(26+25) * h2 + ... + 2^230 * h9 where 0 <= |hi| < 2^27 for all i=0,...,9. - * <li>h congruent r modulo p, i.e. h = r + q * p for some suitable 0 <= r < p and an integer q. + * <li>h = h0 + 2^25 * h1 + 2^(26+25) * h2 + ... + 2^230 * h9 where 0 <= |hi| < 2^27 for all i=0,...,9. + * <li>h congruent r modulo p, i.e. h = r + q * p for some suitable 0 <= r < p and an integer q. * </ul><p> * Then q = [2^-255 * (h + 19 * 2^-25 * h9 + 1/2)] where [x] = floor(x). * <p> * Proof: * <p> * We begin with some very raw estimation for the bounds of some expressions: - * <pre>|h| < 2^230 * 2^30 = 2^260 ==> |r + q * p| < 2^260 ==> |q| < 2^10. - * ==> -1/4 <= a := 19^2 * 2^-255 * q < 1/4. - * |h - 2^230 * h9| = |h0 + ... + 2^204 * h8| < 2^204 * 2^30 = 2^234. - * ==> -1/4 <= b := 19 * 2^-255 * (h - 2^230 * h9) < 1/4</pre> - * Therefore 0 < 1/2 - a - b < 1. + * <pre>|h| < 2^230 * 2^30 = 2^260 ==> |r + q * p| < 2^260 ==> |q| < 2^10. + * ==> -1/4 <= a := 19^2 * 2^-255 * q < 1/4. + * |h - 2^230 * h9| = |h0 + ... + 2^204 * h8| < 2^204 * 2^30 = 2^234. + * ==> -1/4 <= b := 19 * 2^-255 * (h - 2^230 * h9) < 1/4</pre> + * Therefore 0 < 1/2 - a - b < 1. * <p> * Set x := r + 19 * 2^-255 * r + 1/2 - a - b then - * 0 <= x < 255 - 20 + 19 + 1 = 2^255 ==> 0 <= 2^-255 * x < 1. Since q is an integer we have + * 0 <= x < 255 - 20 + 19 + 1 = 2^255 ==> 0 <= 2^-255 * x < 1. Since q is an integer we have * * <pre>[q + 2^-255 * x] = q (1)</pre> * <p> diff --git a/core/java/src/net/i2p/data/SigningPublicKey.java b/core/java/src/net/i2p/data/SigningPublicKey.java index bd30d1c3427899f1766c83f3c54ee11c6b4b4f70..0d1ecf496a8bccd7cea219e4b20595180aa99995 100644 --- a/core/java/src/net/i2p/data/SigningPublicKey.java +++ b/core/java/src/net/i2p/data/SigningPublicKey.java @@ -150,7 +150,7 @@ public class SigningPublicKey extends SimpleDataStructure { * Get the portion of this (type 0) SPK that is really padding based on the Key Cert type given, * if any * - * @return leading padding length > 0 or null if no padding or type is unknown + * @return leading padding length > 0 or null if no padding or type is unknown * @throws IllegalArgumentException if this is already typed to a different type * @since 0.9.12 */ diff --git a/core/java/src/net/i2p/data/i2cp/RequestVariableLeaseSetMessage.java b/core/java/src/net/i2p/data/i2cp/RequestVariableLeaseSetMessage.java index 6d172c9195601289ec37b478351eedb782d98b43..4562ba93f44803c593d064f030c94c718c5537d5 100644 --- a/core/java/src/net/i2p/data/i2cp/RequestVariableLeaseSetMessage.java +++ b/core/java/src/net/i2p/data/i2cp/RequestVariableLeaseSetMessage.java @@ -44,7 +44,7 @@ public class RequestVariableLeaseSetMessage extends I2CPMessageImpl { * Does the client support this message? * * @param clientVersion may be null - * @return version != null and version >= 0.9.7 + * @return version != null and version >= 0.9.7 */ public static boolean isSupported(String clientVersion) { return clientVersion != null && diff --git a/core/java/src/net/i2p/kademlia/KBucketSet.java b/core/java/src/net/i2p/kademlia/KBucketSet.java index 09b51ca23449b8ef054b847ac64c0c76d14edfab..f8ce16f195881491a9fc07a5c46b8d75fcb59a78 100644 --- a/core/java/src/net/i2p/kademlia/KBucketSet.java +++ b/core/java/src/net/i2p/kademlia/KBucketSet.java @@ -72,9 +72,9 @@ public class KBucketSet<T extends SimpleDataStructure> { * Use the default trim strategy, which removes a random entry. * @param us the local identity (typically a SHA1Hash or Hash) * The class must have a zero-argument constructor. - * @param max the Kademlia value "k", the max per bucket, k >= 4 + * @param max the Kademlia value "k", the max per bucket, k >= 4 * @param b the Kademlia value "b", split buckets an extra 2**(b-1) times, - * b > 0, use 1 for bittorrent, Kademlia paper recommends 5 + * b > 0, use 1 for bittorrent, Kademlia paper recommends 5 */ public KBucketSet(I2PAppContext context, T us, int max, int b) { this(context, us, max, b, new RandomTrimmer<T>(context, max)); @@ -168,7 +168,7 @@ public class KBucketSet<T extends SimpleDataStructure> { /** * No lock required. - * FIXME will split the closest buckets too far if B > 1 and K < 2**B + * FIXME will split the closest buckets too far if B > 1 and K < 2**B * Won't ever really happen and if it does it still works. */ private boolean shouldSplit(KBucket<T> b) { @@ -625,7 +625,7 @@ public class KBucketSet<T extends SimpleDataStructure> { /** * Make a new SimpleDataStrucure from the data - * @param data size <= SDS length, else throws IAE + * @param data size <= SDS length, else throws IAE * Can be 1 bigger if top byte is zero */ @SuppressWarnings("unchecked") diff --git a/core/java/src/net/i2p/stat/RateAverages.java b/core/java/src/net/i2p/stat/RateAverages.java index 375bf0af8608e42b41e32ffc6837673fe2622711..fbd491ba71527b486a92ad06fa2f9d5ca5544695 100644 --- a/core/java/src/net/i2p/stat/RateAverages.java +++ b/core/java/src/net/i2p/stat/RateAverages.java @@ -38,10 +38,10 @@ public class RateAverages { /** * @since 0.9.4 * @return one of several things: - * if there are any events (current or last) => weighted average + * if there are any events (current or last) => weighted average * otherwise if the useLifetime parameter to Rate.computeAverages was: - * true => the lifetime average value - * false => zero + * true => the lifetime average value + * false => zero */ public double getAverage() { return average; diff --git a/core/java/src/net/i2p/util/EventDispatcher.java b/core/java/src/net/i2p/util/EventDispatcher.java index 04e3731b6cec0901d9b0898eba93759eb439e1de..3128821cc689bbce7e0b40e2f6014015fa0cd276 100644 --- a/core/java/src/net/i2p/util/EventDispatcher.java +++ b/core/java/src/net/i2p/util/EventDispatcher.java @@ -13,7 +13,7 @@ import java.util.Set; /** * Event dispatching interface. It allows objects to receive and - * notify data events (basically String->Object associations) and + * notify data events (basically String->Object associations) and * create notification chains. To ease the usage of this interface, * you could define an EventDispatcherImpl attribute called * <code>_event</code> (as suggested in EventDispatcherImpl documentation) diff --git a/core/java/src/net/i2p/util/InternalServerSocket.java b/core/java/src/net/i2p/util/InternalServerSocket.java index 77cf8c792f4637b2f7227ff8195b209219ff3886..51cb6c6861ff85c9454723b283e8de6b21a267d6 100644 --- a/core/java/src/net/i2p/util/InternalServerSocket.java +++ b/core/java/src/net/i2p/util/InternalServerSocket.java @@ -31,7 +31,7 @@ public class InternalServerSocket extends ServerSocket { //private static Log _log = I2PAppContext.getGlobalContext().logManager().getLog(InternalServerSocket.class); /** - * @param port > 0 + * @param port > 0 */ public InternalServerSocket(int port) throws IOException { if (port <= 0) @@ -87,7 +87,7 @@ public class InternalServerSocket extends ServerSocket { /** * This is how the client connects. * - * @param port > 0 + * @param port > 0 */ static void internalConnect(int port, InternalSocket clientSock) throws IOException { InternalServerSocket iss = _sockets.get(Integer.valueOf(port)); diff --git a/core/java/src/net/i2p/util/InternalSocket.java b/core/java/src/net/i2p/util/InternalSocket.java index a60a53ae9ddb88561006ae41d3b682d65aed6522..8ee9ca3cc49d7ab477f51baa9079252d3235e08d 100644 --- a/core/java/src/net/i2p/util/InternalSocket.java +++ b/core/java/src/net/i2p/util/InternalSocket.java @@ -26,7 +26,7 @@ public class InternalSocket extends Socket { /** * client side - * @param port > 0 + * @param port > 0 */ public InternalSocket(int port) throws IOException { if (port <= 0) @@ -36,7 +36,7 @@ public class InternalSocket extends Socket { /** * Convenience method to return either a Socket or an InternalSocket - * @param port > 0 + * @param port > 0 */ public static Socket getSocket(String host, int port) throws IOException { if (System.getProperty("router.version") != null && diff --git a/core/java/src/net/i2p/util/ObjectCounter.java b/core/java/src/net/i2p/util/ObjectCounter.java index bbe3f58e3968b444aaee799d3c3a496698a82f1a..ff00a8e3985fdfde188ac14b286ce3afb57c357d 100644 --- a/core/java/src/net/i2p/util/ObjectCounter.java +++ b/core/java/src/net/i2p/util/ObjectCounter.java @@ -44,7 +44,7 @@ public class ObjectCounter<K> implements Serializable { } /** - * @return set of objects with counts > 0 + * @return set of objects with counts > 0 */ public Set<K> objects() { return this.map.keySet(); diff --git a/core/java/src/net/i2p/util/PortMapper.java b/core/java/src/net/i2p/util/PortMapper.java index 1a622828ba14bb21bcb4b7d5fa347421a6a1a4ee..5dcf55c1bf6e5388e574bcb0c600e0b108e036de 100644 --- a/core/java/src/net/i2p/util/PortMapper.java +++ b/core/java/src/net/i2p/util/PortMapper.java @@ -50,7 +50,7 @@ public class PortMapper { /** * Add the service - * @param port > 0 + * @param port > 0 * @return success, false if already registered */ public boolean register(String service, int port) { @@ -59,7 +59,7 @@ public class PortMapper { /** * Add the service - * @param port > 0 + * @param port > 0 * @return success, false if already registered * @since 0.9.21 */ diff --git a/core/java/src/net/i2p/util/SimpleTimer2.java b/core/java/src/net/i2p/util/SimpleTimer2.java index 710ebdb3c1f6e3747b4bc0e87bc03ea2139e9f66..15a844a7ef753f77a2644e839e3000b34ae955ea 100644 --- a/core/java/src/net/i2p/util/SimpleTimer2.java +++ b/core/java/src/net/i2p/util/SimpleTimer2.java @@ -208,8 +208,8 @@ public class SimpleTimer2 { * state of a given TimedEvent * * valid transitions: - * {IDLE,CANCELLED,RUNNING} -> SCHEDULED [ -> SCHEDULED ]* -> RUNNING -> {IDLE,CANCELLED,SCHEDULED} - * {IDLE,CANCELLED,RUNNING} -> SCHEDULED [ -> SCHEDULED ]* -> CANCELLED + * {IDLE,CANCELLED,RUNNING} -> SCHEDULED [ -> SCHEDULED ]* -> RUNNING -> {IDLE,CANCELLED,SCHEDULED} + * {IDLE,CANCELLED,RUNNING} -> SCHEDULED [ -> SCHEDULED ]* -> CANCELLED * * anything else is invalid. */ @@ -231,10 +231,10 @@ public class SimpleTimer2 { * in your constructor) * * Other porting: - * SimpleTimer.getInstance().addEvent(new foo(), timeout) => new foo(SimpleTimer2.getInstance(), timeout) - * SimpleTimer.getInstance().addEvent(this, timeout) => schedule(timeout) - * SimpleTimer.getInstance().addEvent(foo, timeout) => foo.reschedule(timeout) - * SimpleTimer.getInstance().removeEvent(foo) => foo.cancel() + * SimpleTimer.getInstance().addEvent(new foo(), timeout) => new foo(SimpleTimer2.getInstance(), timeout) + * SimpleTimer.getInstance().addEvent(this, timeout) => schedule(timeout) + * SimpleTimer.getInstance().addEvent(foo, timeout) => foo.reschedule(timeout) + * SimpleTimer.getInstance().removeEvent(foo) => foo.cancel() * * There's no global locking, but for scheduling, we synchronize on this * to reduce the chance of duplicates on the queue. diff --git a/core/java/src/net/i2p/util/SystemVersion.java b/core/java/src/net/i2p/util/SystemVersion.java index bd159fb1ab991f18b7cc9e35d0287b5ef3d7aecc..9bf6f49c346884bb6792e365146cee381fa50f6f 100644 --- a/core/java/src/net/i2p/util/SystemVersion.java +++ b/core/java/src/net/i2p/util/SystemVersion.java @@ -149,7 +149,7 @@ public abstract class SystemVersion { } /** - * Better than (new VersionComparator()).compare(System.getProperty("java.version"), "1.6") >= 0 + * Better than (new VersionComparator()).compare(System.getProperty("java.version"), "1.6") >= 0 * as it handles Android also, where java.version = "0". * * @return true if Java 1.6 or higher, or Android API 9 or higher @@ -159,7 +159,7 @@ public abstract class SystemVersion { } /** - * Better than (new VersionComparator()).compare(System.getProperty("java.version"), "1.7") >= 0 + * Better than (new VersionComparator()).compare(System.getProperty("java.version"), "1.7") >= 0 * as it handles Android also, where java.version = "0". * * @return true if Java 1.7 or higher, or Android API 19 or higher @@ -193,8 +193,8 @@ public abstract class SystemVersion { * http://mark.koli.ch/2009/10/javas-osarch-system-property-is-the-bitness-of-the-jre-not-the-operating-system.html * http://mark.koli.ch/2009/10/reliably-checking-os-bitness-32-or-64-bit-on-windows-with-a-tiny-c-app.html * sun.arch.data.model not on all JVMs - * sun.arch.data.model == 64 => 64 bit processor - * sun.arch.data.model == 32 => A 32 bit JVM but could be either 32 or 64 bit processor or libs + * sun.arch.data.model == 64 => 64 bit processor + * sun.arch.data.model == 32 => A 32 bit JVM but could be either 32 or 64 bit processor or libs * os.arch contains "64" could be 32 or 64 bit libs */ public static boolean is64Bit() { diff --git a/core/java/src/net/i2p/util/Translate.java b/core/java/src/net/i2p/util/Translate.java index dd76f04e86182f0fb533b627926222636623c861..0c42f8056ba9f7853309567b5dcf8b8ee47f6a55 100644 --- a/core/java/src/net/i2p/util/Translate.java +++ b/core/java/src/net/i2p/util/Translate.java @@ -67,7 +67,7 @@ public abstract class Translate { * * @param s string to be translated containing {0} * The {0} will be replaced by the parameter. - * Single quotes must be doubled, i.e. ' -> '' in the string. + * Single quotes must be doubled, i.e. ' -> '' in the string. * @param o parameter, not translated. * To translate parameter also, use _t("foo {0} bar", _t("baz")) * Do not double the single quotes in the parameter.