From 2baee7413c755a5c74b2993363260100ba719885 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Wed, 5 May 2010 16:51:54 +0000
Subject: [PATCH]     * Replace size() <= 0 with isEmpty() everywhere, ditto >
 0 -> !isEmpty()

---
 android/src/net/i2p/router/I2PAndroid.java             |  2 +-
 .../java/src/org/klomp/snark/I2PSnarkUtil.java         |  2 +-
 .../java/src/org/klomp/snark/PeerConnectionOut.java    |  2 +-
 .../java/src/org/klomp/snark/PeerCoordinator.java      |  4 ++--
 .../java/src/org/klomp/snark/TrackerClient.java        |  2 +-
 .../java/src/net/i2p/i2ptunnel/I2PTunnelClient.java    |  2 +-
 .../src/net/i2p/i2ptunnel/I2PTunnelClientBase.java     |  2 +-
 .../java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java |  2 +-
 .../src/net/i2p/i2ptunnel/TunnelControllerGroup.java   |  2 +-
 .../src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java     |  2 +-
 .../java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java |  2 +-
 apps/jetty/java/src/org/mortbay/http/HttpContext.java  |  2 +-
 .../net/i2p/client/streaming/I2PServerSocketImpl.java  |  4 ++--
 .../src/net/i2p/router/web/ConfigClientsHelper.java    |  2 +-
 .../java/src/net/i2p/router/web/ConfigStatsHelper.java |  2 +-
 .../src/net/i2p/router/web/ConfigTunnelsHelper.java    |  4 ++--
 .../java/src/net/i2p/router/web/ContextHelper.java     |  4 +++-
 .../java/src/net/i2p/router/web/NetDbRenderer.java     |  4 ++--
 .../java/src/net/i2p/router/web/NewsFetcher.java       |  2 +-
 .../java/src/net/i2p/router/web/ShitlistRenderer.java  |  2 +-
 .../java/src/net/i2p/router/web/SummaryHelper.java     |  2 +-
 .../java/src/net/i2p/router/web/TunnelRenderer.java    | 10 ++++++----
 apps/sam/java/src/net/i2p/sam/SAMStreamSession.java    |  2 +-
 apps/sam/java/src/net/i2p/sam/SAMv1Handler.java        |  2 +-
 apps/sam/java/src/net/i2p/sam/SAMv2StreamSession.java  |  2 +-
 .../java/src/net/i2p/client/streaming/Connection.java  |  2 +-
 .../i2p/client/streaming/ConnectionPacketHandler.java  |  2 +-
 .../net/i2p/client/streaming/MessageInputStream.java   | 10 +++++-----
 .../java/src/net/i2p/client/streaming/PacketLocal.java |  6 +++---
 .../src/java/src/i2p/susi/dns/AddressbookBean.java     |  4 ++--
 .../src/java/src/i2p/susi/dns/SubscriptionsBean.java   |  2 +-
 apps/susimail/src/src/i2p/susi/webmail/WebMail.java    |  8 ++++----
 core/java/src/net/i2p/client/I2PSessionImpl.java       |  4 ++--
 core/java/src/net/i2p/client/I2PSessionImpl2.java      |  4 ++--
 .../src/net/i2p/client/naming/EepGetNamingService.java |  2 +-
 core/java/src/net/i2p/crypto/CryptixAESKeyCache.java   |  2 +-
 core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java  |  2 +-
 core/java/src/net/i2p/crypto/ElGamalAESEngine.java     |  6 +++---
 core/java/src/net/i2p/crypto/HMAC256Generator.java     |  2 +-
 core/java/src/net/i2p/crypto/HMACGenerator.java        |  4 ++--
 core/java/src/net/i2p/crypto/SHA256Generator.java      |  2 +-
 .../src/net/i2p/crypto/TransientSessionKeyManager.java |  8 ++++----
 core/java/src/net/i2p/crypto/YKGenerator.java          |  2 +-
 core/java/src/net/i2p/data/LeaseSet.java               |  2 +-
 core/java/src/net/i2p/stat/BufferedStatLog.java        |  2 +-
 core/java/src/net/i2p/util/Executor.java               |  4 ++--
 core/java/src/net/i2p/util/SimpleTimer.java            |  4 ++--
 .../java/src/org/bouncycastle/crypto/macs/I2PHMac.java |  2 +-
 .../src/net/i2p/data/i2np/DatabaseLookupMessage.java   |  2 +-
 router/java/src/net/i2p/router/Blocklist.java          |  4 ++--
 router/java/src/net/i2p/router/InNetMessagePool.java   |  8 ++++----
 router/java/src/net/i2p/router/JobQueue.java           |  2 +-
 router/java/src/net/i2p/router/Shitlist.java           |  2 +-
 .../message/OutboundClientMessageOneShotJob.java       |  4 ++--
 .../router/networkdb/kademlia/FloodOnlySearchJob.java  |  6 +++---
 .../i2p/router/networkdb/kademlia/FloodSearchJob.java  |  6 +++---
 .../router/networkdb/kademlia/FloodfillMonitorJob.java |  2 +-
 .../kademlia/FloodfillNetworkDatabaseFacade.java       |  4 ++--
 .../networkdb/kademlia/FloodfillPeerSelector.java      |  2 +-
 .../networkdb/kademlia/FloodfillVerifyStoreJob.java    |  2 +-
 .../kademlia/KademliaNetworkDatabaseFacade.java        |  2 +-
 .../i2p/router/networkdb/kademlia/MessageWrapper.java  |  2 +-
 .../i2p/router/networkdb/kademlia/PeerSelector.java    |  2 +-
 .../net/i2p/router/networkdb/kademlia/SearchJob.java   |  8 ++++----
 .../net/i2p/router/networkdb/kademlia/StoreJob.java    |  4 ++--
 .../src/net/i2p/router/networkdb/reseed/Reseeder.java  |  4 ++--
 .../src/net/i2p/router/peermanager/PeerManager.java    |  2 +-
 .../net/i2p/router/transport/CommSystemFacadeImpl.java |  2 +-
 .../net/i2p/router/transport/FIFOBandwidthLimiter.java |  4 ++--
 .../i2p/router/transport/OutboundMessageRegistry.java  |  4 ++--
 .../src/net/i2p/router/transport/TransportImpl.java    |  2 +-
 .../src/net/i2p/router/transport/TransportManager.java |  8 ++++----
 router/java/src/net/i2p/router/transport/UPnP.java     |  4 ++--
 .../net/i2p/router/transport/ntcp/NTCPConnection.java  |  4 ++--
 .../net/i2p/router/transport/ntcp/NTCPTransport.java   |  6 +++---
 .../java/src/net/i2p/router/transport/ntcp/Reader.java |  4 ++--
 .../java/src/net/i2p/router/transport/ntcp/Writer.java |  4 ++--
 .../i2p/router/transport/udp/EstablishmentManager.java |  4 ++--
 .../net/i2p/router/transport/udp/PacketBuilder.java    |  2 +-
 .../src/net/i2p/router/transport/udp/PeerState.java    |  2 +-
 .../src/net/i2p/router/transport/udp/UDPFlooder.java   |  2 +-
 .../src/net/i2p/router/transport/udp/UDPSender.java    |  4 ++--
 .../src/net/i2p/router/tunnel/BatchedPreprocessor.java |  4 ++--
 .../src/net/i2p/router/tunnel/PumpedTunnelGateway.java |  2 +-
 .../src/net/i2p/router/tunnel/TrivialPreprocessor.java |  2 +-
 .../src/net/i2p/router/tunnel/TunnelDispatcher.java    |  8 ++++----
 .../java/src/net/i2p/router/tunnel/TunnelGateway.java  |  2 +-
 .../src/net/i2p/router/tunnel/pool/BuildExecutor.java  |  4 ++--
 .../src/net/i2p/router/tunnel/pool/BuildHandler.java   |  4 ++--
 .../src/net/i2p/router/tunnel/pool/TunnelPool.java     |  8 ++++----
 90 files changed, 158 insertions(+), 154 deletions(-)

diff --git a/android/src/net/i2p/router/I2PAndroid.java b/android/src/net/i2p/router/I2PAndroid.java
index ed626639ce..88d522dd63 100644
--- a/android/src/net/i2p/router/I2PAndroid.java
+++ b/android/src/net/i2p/router/I2PAndroid.java
@@ -69,7 +69,7 @@ public class I2PAndroid extends Activity
 
         // from routerconsole ContextHelper
         List contexts = RouterContext.listContexts();
-        if ( (contexts == null) || (contexts.size() <= 0) ) 
+        if ( (contexts == null) || (contexts.isEmpty()) ) 
             throw new IllegalStateException("No contexts. This is usually because the router is either starting up or shutting down.");
         RouterContext ctx = (RouterContext)contexts.get(0);
 
diff --git a/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java b/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java
index 9804da5d66..35139420c2 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java
@@ -355,7 +355,7 @@ public class I2PSnarkUtil {
         while (tok.hasMoreTokens())
             rv.add(tok.nextToken());
         
-        if (rv.size() <= 0)
+        if (rv.isEmpty())
             return null;
         return rv;
     }
diff --git a/apps/i2psnark/java/src/org/klomp/snark/PeerConnectionOut.java b/apps/i2psnark/java/src/org/klomp/snark/PeerConnectionOut.java
index 3326a60860..81525a1ea8 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/PeerConnectionOut.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/PeerConnectionOut.java
@@ -142,7 +142,7 @@ class PeerConnectionOut implements Runnable
                             it.remove();
                           }
                       }
-                    if (m == null && sendQueue.size() > 0) {
+                    if (m == null && !sendQueue.isEmpty()) {
                       m = (Message)sendQueue.remove(0);
                       SimpleTimer.getInstance().removeEvent(m.expireEvent);
                     }
diff --git a/apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java b/apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java
index af567efc34..c3070913ee 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java
@@ -272,7 +272,7 @@ public class PeerCoordinator implements PeerListener
         peerCount = 0;
       }
 
-    while (removed.size() > 0) {
+    while (!removed.isEmpty()) {
         Peer peer = (Peer)removed.remove(0);
         peer.disconnect();
         removePeerFromPieces(peer);
@@ -428,7 +428,7 @@ public class PeerCoordinator implements PeerListener
               }
           }
 
-        while (uploaders < maxUploaders && interested.size() > 0)
+        while (uploaders < maxUploaders && !interested.isEmpty())
           {
             Peer peer = (Peer)interested.remove(0);
             if (_log.shouldLog(Log.DEBUG))
diff --git a/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java b/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java
index e5d553462f..8822bba931 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java
@@ -163,7 +163,7 @@ public class TrackerClient extends I2PAppThread
         }
     }
 
-    if (tlist.size() <= 0) {
+    if (tlist.isEmpty()) {
         // FIXME really need to get this message to the gui
         stop = true;
         _log.error("No valid trackers for infoHash: " + infoHash);
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
index 8fc2970ad2..89339bf04c 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
@@ -54,7 +54,7 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
             }
         }
 
-        if (dests.size() <= 0) {
+        if (dests.isEmpty()) {
             l.log("No target destinations found");
             notifyEvent("openClientResult", "error");
             return;
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
index b3ffcdb45e..398fd73495 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java
@@ -641,7 +641,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
             while (open) {
                 try {
                     synchronized (_waitingSockets) {
-                        if (_waitingSockets.size() <= 0)
+                        if (_waitingSockets.isEmpty())
                             _waitingSockets.wait();
                         else
                             s = (Socket)_waitingSockets.remove(0);
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java
index fed00886e6..a7fbcf37b5 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelIRCClient.java
@@ -61,7 +61,7 @@ public class I2PTunnelIRCClient extends I2PTunnelClientBase implements Runnable
             }
         }
 
-        if (dests.size() <= 0) {
+        if (dests.isEmpty()) {
             l.log("No target destinations found");
             notifyEvent("openClientResult", "error");
             return;
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java
index 4250dedd07..112f0d62f0 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java
@@ -329,7 +329,7 @@ public class TunnelControllerGroup {
             Set owners = (Set)_sessions.get(session);
             if (owners != null) {
                 owners.remove(controller);
-                if (owners.size() <= 0) {
+                if (owners.isEmpty()) {
                     if (_log.shouldLog(Log.INFO))
                         _log.info("After releasing session " + session + " by " + controller + ", no more owners remain");
                     shouldClose = true;
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java
index ef88102cf0..55feadf218 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java
@@ -224,7 +224,7 @@ public class SOCKS4aServer extends SOCKSServer {
                 throw new SOCKSException(err);
             } else {
                 List<String> proxies = t.getProxies(connPort);
-                if (proxies == null || proxies.size() <= 0) {
+                if (proxies == null || proxies.isEmpty()) {
                     String err = "No outproxy configured for port " + connPort + " and no default configured either - host: " + connHostName;
                     _log.error(err);
                     try {
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java
index 103f6a9454..c87a320dd3 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS5Server.java
@@ -332,7 +332,7 @@ public class SOCKS5Server extends SOCKSServer {
                 throw new SOCKSException(err);
             } else {
                 List<String> proxies = t.getProxies(connPort);
-                if (proxies == null || proxies.size() <= 0) {
+                if (proxies == null || proxies.isEmpty()) {
                     String err = "No outproxy configured for port " + connPort + " and no default configured either";
                     _log.error(err);
                     try {
diff --git a/apps/jetty/java/src/org/mortbay/http/HttpContext.java b/apps/jetty/java/src/org/mortbay/http/HttpContext.java
index 061d3ad17f..1ae1a08b6e 100644
--- a/apps/jetty/java/src/org/mortbay/http/HttpContext.java
+++ b/apps/jetty/java/src/org/mortbay/http/HttpContext.java
@@ -1301,7 +1301,7 @@ public class HttpContext extends Container
 
         List scss= _constraintMap.getMatches(pathInContext);
         String pattern=null;
-        if (scss != null && scss.size() > 0)
+        if (scss != null && !scss.isEmpty())
         {
             Object constraints= null;
 
diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocketImpl.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocketImpl.java
index 2e0609f564..c1378b3a13 100644
--- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocketImpl.java
+++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocketImpl.java
@@ -69,7 +69,7 @@ class I2PServerSocketImpl implements I2PServerSocket {
         I2PSocket ret = null;
         
         while ( (ret == null) && (!closing) ){
-            while (pendingSockets.size() <= 0) {
+            while (pendingSockets.isEmpty()) {
                 if (closing) throw new ConnectException("I2PServerSocket closed");
                 try {
                     synchronized(socketAddedLock) {
@@ -78,7 +78,7 @@ class I2PServerSocketImpl implements I2PServerSocket {
                 } catch (InterruptedException ie) {}
             }
             synchronized (pendingSockets) {
-                if (pendingSockets.size() > 0) {
+                if (!pendingSockets.isEmpty()) {
                     ret = (I2PSocket)pendingSockets.remove(0);
                 }
             } 
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
index 6b172c156f..049b5a02a9 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java
@@ -88,7 +88,7 @@ public class ConfigClientsHelper extends HelperBase {
                 String app = name.substring(PluginStarter.PREFIX.length(), name.lastIndexOf(PluginStarter.ENABLED));
                 String val = props.getProperty(name);
                 Properties appProps = PluginStarter.pluginProperties(_context, app);
-                if (appProps.size() <= 0)
+                if (appProps.isEmpty())
                     continue;
                 StringBuilder desc = new StringBuilder(256);
                 desc.append("<table border=\"0\">")
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java
index 5c22ed1b1e..07c0f3e0f7 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigStatsHelper.java
@@ -70,7 +70,7 @@ public class ConfigStatsHelper extends HelperBase {
      * @return true if a valid stat is available, otherwise false
      */
     public boolean hasMoreStats() {
-        if (_stats.size() <= 0)
+        if (_stats.isEmpty())
             return false;
         _currentIsGraphed = false;
         _currentStatName = (String)_stats.remove(0);
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java
index 2be5a4a00b..4d007e9d76 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java
@@ -163,7 +163,7 @@ public class ConfigTunnelsHelper extends HelperBase {
         // TunnelPoolOptions, so make the boxes readonly.
         // And let's not display them at all unless they have contents, which should be rare.
         Properties props = in.getUnknownOptions();
-        if (props.size() > 0) {
+        if (!props.isEmpty()) {
             buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Inbound options") + ":</td>\n" +
                        "<td colspan=\"2\" align=\"center\"><input name=\"").append(index);
             buf.append(".inboundOptions\" type=\"text\" size=\"32\" disabled=\"true\" " +
@@ -176,7 +176,7 @@ public class ConfigTunnelsHelper extends HelperBase {
             buf.append("\"></td></tr>\n");
         }
         props = out.getUnknownOptions();
-        if (props.size() > 0) {
+        if (!props.isEmpty()) {
             buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Outbound options") + ":</td>\n" +
                        "<td colspan=\"2\" align=\"center\"><input name=\"").append(index);
             buf.append(".outboundOptions\" type=\"text\" size=\"32\" disabled=\"true\" " +
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ContextHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ContextHelper.java
index 0aa2506548..aab5a2ce9b 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ContextHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ContextHelper.java
@@ -6,9 +6,11 @@ import net.i2p.data.Hash;
 import net.i2p.router.RouterContext;
 
 class ContextHelper {
+
+    /** @throws IllegalStateException if no context available */
     public static RouterContext getContext(String contextId) {
         List contexts = RouterContext.listContexts();
-        if ( (contexts == null) || (contexts.size() <= 0) ) 
+        if ( (contexts == null) || (contexts.isEmpty()) ) 
             throw new IllegalStateException("No contexts. This is usually because the router is either starting up or shutting down.");
         if ( (contextId == null) || (contextId.trim().length() <= 0) )
             return (RouterContext)contexts.get(0);
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java
index effcca6bf0..d360e346eb 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java
@@ -185,7 +185,7 @@ public class NetDbRenderer {
         buf.append("<table border=\"0\" cellspacing=\"30\"><tr><th colspan=\"3\">").append(_("Network Database Router Statistics")).append("</th><tr><td>");
         // versions table
         List<String> versionList = new ArrayList(versions.objects());
-        if (versionList.size() > 0) {
+        if (!versionList.isEmpty()) {
             Collections.sort(versionList, Collections.reverseOrder(new VersionComparator()));
             buf.append("<table>\n");
             buf.append("<tr><th>" + _("Version") + "</th><th>" + _("Count") + "</th></tr>\n");
@@ -217,7 +217,7 @@ public class NetDbRenderer {
 
         // country table
         List<String> countryList = new ArrayList(countries.objects());
-        if (countryList.size() > 0) {
+        if (!countryList.isEmpty()) {
             Collections.sort(countryList, new CountryComparator());
             buf.append("<table>\n");
             buf.append("<tr><th align=\"left\">" + _("Country") + "</th><th>" + _("Count") + "</th></tr>\n");
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java b/apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java
index e5c0ef9a17..f7ac8cb942 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/NewsFetcher.java
@@ -322,7 +322,7 @@ public class NewsFetcher implements Runnable, EepGet.StatusListener {
                 handler = new UpdateHandler((RouterContext)_context);
             } else {
                 List contexts = RouterContext.listContexts();
-                if (contexts.size() > 0)
+                if (!contexts.isEmpty())
                     handler = new UpdateHandler((RouterContext)contexts.get(0));
                 else
                     _log.log(Log.CRIT, "No router context to update with?");
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ShitlistRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/ShitlistRenderer.java
index b1e3ccf302..48af67857a 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ShitlistRenderer.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ShitlistRenderer.java
@@ -58,7 +58,7 @@ public class ShitlistRenderer {
             else
                 buf.append(_("Banned until restart or in {0}", expireString));
             Set transports = entry.transports;
-            if ( (transports != null) && (transports.size() > 0) )
+            if ( (transports != null) && (!transports.isEmpty()) )
                 buf.append(" on the following transport: ").append(transports);
             if (entry.cause != null) {
                 buf.append("<br>\n");
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
index e7054ccd99..1e61bde4fb 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java
@@ -373,7 +373,7 @@ public class SummaryHelper extends HelperBase {
         
         StringBuilder buf = new StringBuilder(512);
         buf.append("<h3><a href=\"/i2ptunnel/index.jsp\" target=\"_blank\" title=\"").append(_("Add/remove/edit &amp; control your client and server tunnels")).append("\">").append(_("Local Destinations")).append("</a></h3><hr><div class=\"tunnels\">");
-        if (clients.size() > 0) {
+        if (!clients.isEmpty()) {
             Collections.sort(clients, new AlphaComparator());
             buf.append("<table>");
             
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java
index 101160d41c..da5305ef0d 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java
@@ -201,15 +201,17 @@ public class TunnelRenderer {
         out.write("</table>\n");
         if (in != null) {
             List pending = in.listPending();
-            if (pending.size() > 0)
+            if (!pending.isEmpty()) {
                 out.write("<div class=\"statusnotes\"><center><b>" + _("Build in progress") + ": " + pending.size() + " " + _("inbound") + "</b></center></div>\n");
-            live += pending.size();
+                live += pending.size();
+            }
         }
         if (outPool != null) {
             List pending = outPool.listPending();
-            if (pending.size() > 0)
+            if (!pending.isEmpty()) {
                 out.write("<div class=\"statusnotes\"><center><b>" + _("Build in progress") + ": " + pending.size() + " " + _("outbound") + "</b></center></div>\n");
-            live += pending.size();
+                live += pending.size();
+            }
         }
         if (live <= 0)
             out.write("<div class=\"statusnotes\"><center><b>" + _("No tunnels; waiting for the grace period to end.") + "</center></b></div>\n");
diff --git a/apps/sam/java/src/net/i2p/sam/SAMStreamSession.java b/apps/sam/java/src/net/i2p/sam/SAMStreamSession.java
index aef2802bd8..20d4cacf78 100644
--- a/apps/sam/java/src/net/i2p/sam/SAMStreamSession.java
+++ b/apps/sam/java/src/net/i2p/sam/SAMStreamSession.java
@@ -739,7 +739,7 @@ public class SAMStreamSession {
                 data = null;
                 try {
                     synchronized (_data) {
-                        if (_data.size() > 0) {
+                        if (!_data.isEmpty()) {
                             data = (ByteArray)_data.remove(0);
                         } else if (_shuttingDownGracefully) {
                             /* No data left and shutting down gracefully?
diff --git a/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java b/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java
index a44c905430..487f8fdf1f 100644
--- a/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java
+++ b/apps/sam/java/src/net/i2p/sam/SAMv1Handler.java
@@ -308,7 +308,7 @@ public class SAMv1Handler extends SAMHandler implements SAMRawReceiver, SAMDatag
   protected boolean execDestMessage(String opcode, Properties props) {
 
         if (opcode.equals("GENERATE")) {
-            if (props.size() > 0) {
+            if (!props.isEmpty()) {
                 _log.debug("Properties specified in DEST GENERATE message");
                 return false;
             }
diff --git a/apps/sam/java/src/net/i2p/sam/SAMv2StreamSession.java b/apps/sam/java/src/net/i2p/sam/SAMv2StreamSession.java
index 4197597eb0..6b59435d31 100644
--- a/apps/sam/java/src/net/i2p/sam/SAMv2StreamSession.java
+++ b/apps/sam/java/src/net/i2p/sam/SAMv2StreamSession.java
@@ -371,7 +371,7 @@ public class SAMv2StreamSession extends SAMStreamSession
 						{
 							synchronized ( _data )
 							{
-								if ( _data.size() > 0 )
+								if ( !_data.isEmpty() )
 								{
 									int formerSize = _dataSize ;
 									data = ( ByteArray ) _data.remove ( 0 );
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
index 2cc1a0cf1f..bc8c923699 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
@@ -449,7 +449,7 @@ public class Connection {
             }
             _outboundPackets.notifyAll();
         }
-        if ((acked != null) && (acked.size() > 0) )
+        if ((acked != null) && (!acked.isEmpty()) )
             _ackSinceCongestion = true;
         return acked;
     }
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java b/apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java
index 5292b5f09f..e4a8efbc06 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java
@@ -253,7 +253,7 @@ public class ConnectionPacketHandler {
         else
             return false;
         
-        if ( (acked != null) && (acked.size() > 0) ) {
+        if ( (acked != null) && (!acked.isEmpty()) ) {
             if (_log.shouldLog(Log.DEBUG))
                 _log.debug(acked.size() + " of our packets acked with " + packet);
             // use the highest RTT, since these would likely be bunched together,
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/MessageInputStream.java b/apps/streaming/java/src/net/i2p/client/streaming/MessageInputStream.java
index 38537bc7f3..14b304b268 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/MessageInputStream.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/MessageInputStream.java
@@ -283,15 +283,15 @@ public class MessageInputStream extends InputStream {
             expiration = _readTimeout + System.currentTimeMillis();
         synchronized (_dataLock) {
             for (int i = 0; i < length; i++) {
-                if ( (_readyDataBlocks.size() <= 0) && (i == 0) ) {
+                if ( (_readyDataBlocks.isEmpty()) && (i == 0) ) {
                     // ok, we havent found anything, so lets block until we get 
                     // at least one byte
                     
-                    while (_readyDataBlocks.size() <= 0) {
+                    while (_readyDataBlocks.isEmpty()) {
                         if (_locallyClosed)
                             throw new IOException("Already closed, you wanker");
                         
-                        if ( (_notYetReadyBlocks.size() <= 0) && (_closeReceived) ) {
+                        if ( (_notYetReadyBlocks.isEmpty()) && (_closeReceived) ) {
                             if (_log.shouldLog(Log.INFO))
                                 _log.info("read(...," + offset + ", " + length + ")[" + i 
                                            + "] got EOF after " + _readTotal + " " + toString());
@@ -322,7 +322,7 @@ public class MessageInputStream extends InputStream {
                                                + ") with nonblocking setup: " + toString());
                                 return i;
                             }
-                            if (_readyDataBlocks.size() <= 0) {
+                            if (_readyDataBlocks.isEmpty()) {
                                 if ( (_readTimeout > 0) && (expiration < System.currentTimeMillis()) ) {
                                     if (_log.shouldLog(Log.INFO))
                                         _log.info("read(...," + offset+", " + length+ ")[" + i 
@@ -334,7 +334,7 @@ public class MessageInputStream extends InputStream {
                     }
                     // we looped a few times then got data, so this pass doesnt count
                     i--;
-                } else if (_readyDataBlocks.size() <= 0) {
+                } else if (_readyDataBlocks.isEmpty()) {
                     if (_log.shouldLog(Log.DEBUG))
                         _log.debug("read(...," + offset+", " + length+ ")[" + i 
                                    + "] no more ready blocks, returning");
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/PacketLocal.java b/apps/streaming/java/src/net/i2p/client/streaming/PacketLocal.java
index 3f856ac73d..674ff6179c 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/PacketLocal.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/PacketLocal.java
@@ -70,9 +70,9 @@ public class PacketLocal extends Packet implements MessageOutputStream.WriteStat
      * @deprecated I2PSession throws out the tags
      */
     public void setTagsSent(Set tags) { 
-        if (tags != null && tags.size() > 0)
+        if (tags != null && !tags.isEmpty())
             _log.error("Who is sending tags thru the streaming lib? " + tags.size());
-        if ( (_tagsSent != null) && (_tagsSent.size() > 0) && (tags.size() > 0) ) {
+        if ( (_tagsSent != null) && (!_tagsSent.isEmpty()) && (!tags.isEmpty()) ) {
             //int old = _tagsSent.size();
             //_tagsSent.addAll(tags);
             if (!_tagsSent.equals(tags))
@@ -160,7 +160,7 @@ public class PacketLocal extends Packet implements MessageOutputStream.WriteStat
         if (con != null)
             buf.append(" rtt ").append(con.getOptions().getRTT());
         
-        if ( (_tagsSent != null) && (_tagsSent.size() > 0) ) 
+        if ( (_tagsSent != null) && (!_tagsSent.isEmpty()) ) 
             buf.append(" with tags");
 
         if (_ackOn > 0)
diff --git a/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java b/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java
index ce53d99d45..443293886f 100644
--- a/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java
+++ b/apps/susidns/src/java/src/i2p/susi/dns/AddressbookBean.java
@@ -73,7 +73,7 @@ public class AddressbookBean
 	}
 	public boolean isNotEmpty()
 	{
-		return addressbook != null && addressbook.size() > 0;
+		return addressbook != null && !addressbook.isEmpty();
 	}
 	public AddressbookBean()
 	{
@@ -89,7 +89,7 @@ public class AddressbookBean
 	{
 		long currentTime = System.currentTimeMillis();
 		
-		if( properties.size() > 0 &&  currentTime - configLastLoaded < 10000 )
+		if( !properties.isEmpty() &&  currentTime - configLastLoaded < 10000 )
 			return;
 		
 		FileInputStream fis = null;
diff --git a/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java b/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java
index cc983b54bf..6b1a805769 100644
--- a/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java
+++ b/apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java
@@ -49,7 +49,7 @@ public class SubscriptionsBean
 	{
 		long currentTime = System.currentTimeMillis();
 		
-		if( properties.size() > 0 &&  currentTime - configLastLoaded < 10000 )
+		if( !properties.isEmpty() &&  currentTime - configLastLoaded < 10000 )
 			return;
 		
 		FileInputStream fis = null;
diff --git a/apps/susimail/src/src/i2p/susi/webmail/WebMail.java b/apps/susimail/src/src/i2p/susi/webmail/WebMail.java
index e871dfe817..3771d02422 100644
--- a/apps/susimail/src/src/i2p/susi/webmail/WebMail.java
+++ b/apps/susimail/src/src/i2p/susi/webmail/WebMail.java
@@ -1411,7 +1411,7 @@ public class WebMail extends HttpServlet
 		if( bccToSelf != null && bccToSelf.compareTo( "1" ) == 0 )
 			recipients.add( sender );
 		
-		if( recipients.size() == 0 ) {
+		if( recipients.isEmpty() ) {
 			ok = false;
 			sessionObject.error += "No recipients found.<br>";
 		}
@@ -1442,7 +1442,7 @@ public class WebMail extends HttpServlet
 			}
 			String boundary = "_="+(int)(Math.random()*Integer.MAX_VALUE)+""+(int)(Math.random()*Integer.MAX_VALUE);
 			boolean multipart = false;
-			if( sessionObject.attachments != null && sessionObject.attachments.size() > 0 ) {
+			if( sessionObject.attachments != null && !sessionObject.attachments.isEmpty() ) {
 				multipart = true;
 				body.append( "\r\nMIME-Version: 1.0\r\nContent-type: multipart/mixed; boundary=\"" + boundary + "\"\r\n\r\n" );
 			}
@@ -1515,7 +1515,7 @@ public class WebMail extends HttpServlet
 	{
 		out.println( button( SEND, "Send" ) +
 				button( CANCEL, "Cancel" ) + spacer +
-				(sessionObject.attachments != null && sessionObject.attachments.size() > 0 ? button( DELETE_ATTACHMENT, "Delete Attachment" ) : button2( DELETE_ATTACHMENT, "Delete Attachment" ) ) + spacer +
+				(sessionObject.attachments != null && (!sessionObject.attachments.isEmpty()) ? button( DELETE_ATTACHMENT, "Delete Attachment" ) : button2( DELETE_ATTACHMENT, "Delete Attachment" ) ) + spacer +
 				button( RELOAD, "Reload Config" ) + spacer +
 				button( LOGOUT, "Logout" ) );
 
@@ -1550,7 +1550,7 @@ public class WebMail extends HttpServlet
 				"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
 				"<tr><td align=\"right\">New Attachment:</td><td align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\"><input type=\"submit\" name=\"" + NEW_UPLOAD + "\" value=\"Upload File\"></td></tr>" );
 		
-		if( sessionObject.attachments != null && sessionObject.attachments.size() > 0 ) {
+		if( sessionObject.attachments != null && !sessionObject.attachments.isEmpty() ) {
 			boolean wroteHeader = false;
 			for( Iterator it = sessionObject.attachments.iterator(); it.hasNext(); ) {
 				if( !wroteHeader ) {
diff --git a/core/java/src/net/i2p/client/I2PSessionImpl.java b/core/java/src/net/i2p/client/I2PSessionImpl.java
index e4ee1c290d..285aaa780b 100644
--- a/core/java/src/net/i2p/client/I2PSessionImpl.java
+++ b/core/java/src/net/i2p/client/I2PSessionImpl.java
@@ -451,13 +451,13 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
                 Long msgId = null;
                 Integer size = null;
                 synchronized (AvailabilityNotifier.this) {
-                    if (_pendingIds.size() <= 0) {
+                    if (_pendingIds.isEmpty()) {
                         try {
                             AvailabilityNotifier.this.wait();
                         } catch (InterruptedException ie) { // nop
                         }
                     }
-                    if (_pendingIds.size() > 0) {
+                    if (!_pendingIds.isEmpty()) {
                         msgId = (Long)_pendingIds.remove(0);
                         size = (Integer)_pendingSizes.remove(0);
                     }
diff --git a/core/java/src/net/i2p/client/I2PSessionImpl2.java b/core/java/src/net/i2p/client/I2PSessionImpl2.java
index ac61ee7030..d8d8c8dfce 100644
--- a/core/java/src/net/i2p/client/I2PSessionImpl2.java
+++ b/core/java/src/net/i2p/client/I2PSessionImpl2.java
@@ -236,7 +236,7 @@ class I2PSessionImpl2 extends I2PSessionImpl {
             oldTags = _context.sessionKeyManager().getAvailableTags(dest.getPublicKey(), key);
             long availTimeLeft = _context.sessionKeyManager().getAvailableTimeLeft(dest.getPublicKey(), key);
         
-            if ( (tagsSent == null) || (tagsSent.size() <= 0) ) {
+            if ( (tagsSent == null) || (tagsSent.isEmpty()) ) {
                 if (oldTags < NUM_TAGS) {
                     sentTags = createNewTags(NUM_TAGS);
                     if (_log.shouldLog(Log.DEBUG))
@@ -261,7 +261,7 @@ class I2PSessionImpl2 extends I2PSessionImpl {
             if (false) // rekey
                 newKey = _context.keyGenerator().generateSessionKey();
         
-            if ( (tagsSent != null) && (tagsSent.size() > 0) ) {
+            if ( (tagsSent != null) && (!tagsSent.isEmpty()) ) {
                 if (sentTags == null)
                     sentTags = new HashSet();
                 sentTags.addAll(tagsSent);
diff --git a/core/java/src/net/i2p/client/naming/EepGetNamingService.java b/core/java/src/net/i2p/client/naming/EepGetNamingService.java
index 8ddeaa2480..d833179671 100644
--- a/core/java/src/net/i2p/client/naming/EepGetNamingService.java
+++ b/core/java/src/net/i2p/client/naming/EepGetNamingService.java
@@ -72,7 +72,7 @@ public class EepGetNamingService extends NamingService {
             return d;
 
         List URLs = getURLs();
-        if (URLs.size() == 0)
+        if (URLs.isEmpty())
             return null;
 
         // prevent lookup loops - this cannot be the only lookup service
diff --git a/core/java/src/net/i2p/crypto/CryptixAESKeyCache.java b/core/java/src/net/i2p/crypto/CryptixAESKeyCache.java
index 6231261d3b..5084ae2b0a 100644
--- a/core/java/src/net/i2p/crypto/CryptixAESKeyCache.java
+++ b/core/java/src/net/i2p/crypto/CryptixAESKeyCache.java
@@ -31,7 +31,7 @@ public final class CryptixAESKeyCache {
      */
     public final KeyCacheEntry acquireKey() {
         synchronized (_availableKeys) {
-            if (_availableKeys.size() > 0)
+            if (!_availableKeys.isEmpty())
                 return (KeyCacheEntry)_availableKeys.remove(0);
         }
         return createNew();
diff --git a/core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java b/core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java
index d51e2366c1..2c1e57d8e5 100644
--- a/core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java
+++ b/core/java/src/net/i2p/crypto/DHSessionKeyBuilder.java
@@ -114,7 +114,7 @@ public class DHSessionKeyBuilder {
         this(false);
         DHSessionKeyBuilder builder = null;
         synchronized (_builders) {
-            if (_builders.size() > 0) {
+            if (!_builders.isEmpty()) {
                 builder = (DHSessionKeyBuilder) _builders.remove(0);
                 if (_log.shouldLog(Log.DEBUG)) _log.debug("Removing a builder.  # left = " + _builders.size());
             } else {
diff --git a/core/java/src/net/i2p/crypto/ElGamalAESEngine.java b/core/java/src/net/i2p/crypto/ElGamalAESEngine.java
index 047b0156ef..820a57c672 100644
--- a/core/java/src/net/i2p/crypto/ElGamalAESEngine.java
+++ b/core/java/src/net/i2p/crypto/ElGamalAESEngine.java
@@ -104,7 +104,7 @@ public class ElGamalAESEngine {
             decrypted = decryptExistingSession(data, key, targetPrivateKey, foundTags, usedKey, foundKey);
             if (decrypted != null) {
                 _context.statManager().updateFrequency("crypto.elGamalAES.decryptExistingSession");
-                if ( (foundTags.size() > 0) && (_log.shouldLog(Log.DEBUG)) )
+                if ( (!foundTags.isEmpty()) && (_log.shouldLog(Log.DEBUG)) )
                     _log.debug(id + ": ElG/AES decrypt success with " + st + ": found tags: " + foundTags);
                 wasExisting = true;
             } else {
@@ -118,7 +118,7 @@ public class ElGamalAESEngine {
             decrypted = decryptNewSession(data, targetPrivateKey, foundTags, usedKey, foundKey);
             if (decrypted != null) {
                 _context.statManager().updateFrequency("crypto.elGamalAES.decryptNewSession");
-                if ( (foundTags.size() > 0) && (_log.shouldLog(Log.DEBUG)) )
+                if ( (!foundTags.isEmpty()) && (_log.shouldLog(Log.DEBUG)) )
                     _log.debug("ElG decrypt success: found tags: " + foundTags);
             } else {
                 _context.statManager().updateFrequency("crypto.elGamalAES.decryptFailed");
@@ -131,7 +131,7 @@ public class ElGamalAESEngine {
             //_log.debug("Unable to decrypt the data starting with tag [" + st + "] - did the tag expire recently?", new Exception("Decrypt failure"));
         }
 
-        if (foundTags.size() > 0) {
+        if (!foundTags.isEmpty()) {
             if (foundKey.getData() != null) {
                 if (_log.shouldLog(Log.DEBUG)) 
                     _log.debug("Found key: " + foundKey.toBase64() + " tags: " + foundTags + " wasExisting? " + wasExisting);
diff --git a/core/java/src/net/i2p/crypto/HMAC256Generator.java b/core/java/src/net/i2p/crypto/HMAC256Generator.java
index e84489d971..bf05321094 100644
--- a/core/java/src/net/i2p/crypto/HMAC256Generator.java
+++ b/core/java/src/net/i2p/crypto/HMAC256Generator.java
@@ -22,7 +22,7 @@ public class HMAC256Generator extends HMACGenerator {
     @Override
     protected I2PHMac acquire() {
         synchronized (_available) {
-            if (_available.size() > 0)
+            if (!_available.isEmpty())
                 return (I2PHMac)_available.remove(0);
         }
         // the HMAC is hardcoded to use SHA256 digest size
diff --git a/core/java/src/net/i2p/crypto/HMACGenerator.java b/core/java/src/net/i2p/crypto/HMACGenerator.java
index 9bf06aa70e..aed444ed06 100644
--- a/core/java/src/net/i2p/crypto/HMACGenerator.java
+++ b/core/java/src/net/i2p/crypto/HMACGenerator.java
@@ -89,7 +89,7 @@ public class HMACGenerator {
     
     protected I2PHMac acquire() {
         synchronized (_available) {
-            if (_available.size() > 0)
+            if (!_available.isEmpty())
                 return (I2PHMac)_available.remove(0);
         }
         // the HMAC is hardcoded to use SHA256 digest size
@@ -108,7 +108,7 @@ public class HMACGenerator {
     private byte[] acquireTmp() {
         byte rv[] = null;
         synchronized (_availableTmp) {
-            if (_availableTmp.size() > 0)
+            if (!_availableTmp.isEmpty())
                 rv = (byte[])_availableTmp.remove(0);
         }
         if (rv != null)
diff --git a/core/java/src/net/i2p/crypto/SHA256Generator.java b/core/java/src/net/i2p/crypto/SHA256Generator.java
index e34f4fe914..d24915ed54 100644
--- a/core/java/src/net/i2p/crypto/SHA256Generator.java
+++ b/core/java/src/net/i2p/crypto/SHA256Generator.java
@@ -52,7 +52,7 @@ public final class SHA256Generator {
     private Sha256Standalone acquireGnu() {
         Sha256Standalone rv = null;
         synchronized (_digestsGnu) {
-            if (_digestsGnu.size() > 0)
+            if (!_digestsGnu.isEmpty())
                 rv = (Sha256Standalone)_digestsGnu.remove(0);
         }
         if (rv != null)
diff --git a/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java b/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java
index 17543b1bd8..bd68f1f54b 100644
--- a/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java
+++ b/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java
@@ -307,7 +307,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
     public TagSetHandle tagsDelivered(PublicKey target, SessionKey key, Set<SessionTag> sessionTags) {
         if (_log.shouldLog(Log.DEBUG)) {
             //_log.debug("Tags delivered to set " + set + " on session " + sess);
-            if (sessionTags.size() > 0)
+            if (!sessionTags.isEmpty())
                 _log.debug("Tags delivered: " + sessionTags.size() + " for key: " + key + ": " + sessionTags);
         }
         OutboundSession sess = getSession(target);
@@ -415,7 +415,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
         if (overage > 0)
             clearExcess(overage);
 
-        if ( (sessionTags.size() <= 0) && (_log.shouldLog(Log.DEBUG)) )
+        if ( (sessionTags.isEmpty()) && (_log.shouldLog(Log.DEBUG)) )
             _log.debug("Received 0 tags for key " + key);
         //if (false) aggressiveExpire();
     }
@@ -785,7 +785,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
             long now = _context.clock().now();
             _lastUsed = now;
             synchronized (_tagSets) {
-                while (_tagSets.size() > 0) {
+                while (!_tagSets.isEmpty()) {
                     TagSet set = _tagSets.get(0);
                     if (set.getDate() + SESSION_TAG_DURATION_MS > now) {
                         SessionTag tag = set.consumeNext();
@@ -830,7 +830,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
             synchronized (_tagSets) {
                 for (Iterator<TagSet> iter = _tagSets.iterator(); iter.hasNext();) {
                     TagSet set = iter.next();
-                    if ( (set.getDate() > last) && (set.getTags().size() > 0) ) 
+                    if ( (set.getDate() > last) && (!set.getTags().isEmpty()) ) 
                         last = set.getDate();
                 }
             }
diff --git a/core/java/src/net/i2p/crypto/YKGenerator.java b/core/java/src/net/i2p/crypto/YKGenerator.java
index cc69fb5d8f..ad68ebec1f 100644
--- a/core/java/src/net/i2p/crypto/YKGenerator.java
+++ b/core/java/src/net/i2p/crypto/YKGenerator.java
@@ -110,7 +110,7 @@ class YKGenerator {
     public static BigInteger[] getNextYK() {
         if (true) {
             synchronized (_values) {
-                if (_values.size() > 0) {
+                if (!_values.isEmpty()) {
                     if (_log.shouldLog(Log.DEBUG))
                         _log.debug("Sufficient precalculated YK values - fetch the existing");
                     return (BigInteger[]) _values.remove(0);
diff --git a/core/java/src/net/i2p/data/LeaseSet.java b/core/java/src/net/i2p/data/LeaseSet.java
index 4598a27ff9..a917f6ac05 100644
--- a/core/java/src/net/i2p/data/LeaseSet.java
+++ b/core/java/src/net/i2p/data/LeaseSet.java
@@ -201,7 +201,7 @@ public class LeaseSet extends DataStructureImpl {
      * @return earliest end date of any lease in the set, or -1 if there are no leases
      */
     public long getEarliestLeaseDate() {
-        if (_leases.size() <= 0)
+        if (_leases.isEmpty())
             return -1;
         return _firstExpiration;
     }
diff --git a/core/java/src/net/i2p/stat/BufferedStatLog.java b/core/java/src/net/i2p/stat/BufferedStatLog.java
index 4703a25760..fc7b85c3f5 100644
--- a/core/java/src/net/i2p/stat/BufferedStatLog.java
+++ b/core/java/src/net/i2p/stat/BufferedStatLog.java
@@ -94,7 +94,7 @@ public class BufferedStatLog implements StatLog {
                     _statFilters.clear();
                     while (tok.hasMoreTokens())
                         _statFilters.add(tok.nextToken().trim());
-                    _filtersSpecified = _statFilters.size() > 0;
+                    _filtersSpecified = !_statFilters.isEmpty();
                 }
             }
             _lastFilters = val;
diff --git a/core/java/src/net/i2p/util/Executor.java b/core/java/src/net/i2p/util/Executor.java
index 5fa26ec744..8092d7ac44 100644
--- a/core/java/src/net/i2p/util/Executor.java
+++ b/core/java/src/net/i2p/util/Executor.java
@@ -20,9 +20,9 @@ class Executor implements Runnable {
         while(runn.getAnswer()) {
             SimpleTimer.TimedEvent evt = null;
             synchronized (_readyEvents) {
-                if (_readyEvents.size() <= 0) 
+                if (_readyEvents.isEmpty()) 
                     try { _readyEvents.wait(); } catch (InterruptedException ie) {}
-                if (_readyEvents.size() > 0) 
+                if (!_readyEvents.isEmpty()) 
                     evt = (SimpleTimer.TimedEvent)_readyEvents.remove(0);
             }
 
diff --git a/core/java/src/net/i2p/util/SimpleTimer.java b/core/java/src/net/i2p/util/SimpleTimer.java
index cf8e7e34b4..6a8b855e30 100644
--- a/core/java/src/net/i2p/util/SimpleTimer.java
+++ b/core/java/src/net/i2p/util/SimpleTimer.java
@@ -180,7 +180,7 @@ public class SimpleTimer {
                         long nextEventDelay = -1;
                         Object nextEvent = null;
                         while(runn.getAnswer()) {
-                            if(_events.size() <= 0) {
+                            if(_events.isEmpty()) {
                                 break;
                             }
                             Long when = (Long)_events.firstKey();
@@ -196,7 +196,7 @@ public class SimpleTimer {
                                 break;
                             }
                         }
-                        if (eventsToFire.size() <= 0) { 
+                        if (eventsToFire.isEmpty()) { 
                             if (nextEventDelay != -1) {
                                 if (_log.shouldLog(Log.DEBUG))
                                     _log.debug("Next event in " + nextEventDelay + ": " + nextEvent);
diff --git a/core/java/src/org/bouncycastle/crypto/macs/I2PHMac.java b/core/java/src/org/bouncycastle/crypto/macs/I2PHMac.java
index a566e8a799..1255836135 100644
--- a/core/java/src/org/bouncycastle/crypto/macs/I2PHMac.java
+++ b/core/java/src/org/bouncycastle/crypto/macs/I2PHMac.java
@@ -172,7 +172,7 @@ implements Mac
     private static byte[] acquireTmp(int sz) {
         byte rv[] = null;
         synchronized (_tmpBuf[sz == 32 ? 0 : 1]) {
-            if (_tmpBuf[sz == 32 ? 0 : 1].size() > 0)
+            if (!_tmpBuf[sz == 32 ? 0 : 1].isEmpty())
                 rv = (byte[])_tmpBuf[sz == 32 ? 0 : 1].remove(0);
         }
         if (rv != null)
diff --git a/router/java/src/net/i2p/data/i2np/DatabaseLookupMessage.java b/router/java/src/net/i2p/data/i2np/DatabaseLookupMessage.java
index 3b197ee927..80aaa88918 100644
--- a/router/java/src/net/i2p/data/i2np/DatabaseLookupMessage.java
+++ b/router/java/src/net/i2p/data/i2np/DatabaseLookupMessage.java
@@ -205,7 +205,7 @@ public class DatabaseLookupMessage extends I2NPMessageImpl {
         } else {
             out[curIndex++] = DataHelper.BOOLEAN_FALSE;
         }
-        if ( (_dontIncludePeers == null) || (_dontIncludePeers.size() <= 0) ) {
+        if ( (_dontIncludePeers == null) || (_dontIncludePeers.isEmpty()) ) {
             out[curIndex++] = 0x0;
             out[curIndex++] = 0x0;
         } else {
diff --git a/router/java/src/net/i2p/router/Blocklist.java b/router/java/src/net/i2p/router/Blocklist.java
index 4f14fe8bb1..0f68355db2 100644
--- a/router/java/src/net/i2p/router/Blocklist.java
+++ b/router/java/src/net/i2p/router/Blocklist.java
@@ -472,7 +472,7 @@ public class Blocklist {
         RouterInfo pinfo = _context.netDb().lookupRouterInfoLocally(peer);
         if (pinfo == null) return rv;
         Set<RouterAddress> paddr = pinfo.getAddresses();
-        if (paddr == null || paddr.size() == 0)
+        if (paddr == null || paddr.isEmpty())
             return rv;
         String oldphost = null;
         List<RouterAddress> pladdr = new ArrayList(paddr);
@@ -773,7 +773,7 @@ public class Blocklist {
         //out.write("<h2>Banned IPs</h2>");
         Set<Integer> singles = new TreeSet();
         singles.addAll(_singleIPBlocklist);
-        if (singles.size() > 0) {
+        if (!singles.isEmpty()) {
             out.write("<table><tr><td><b>Transient IPs</b></td></tr>");
             for (Iterator<Integer> iter = singles.iterator(); iter.hasNext(); ) {
                  int ip = iter.next().intValue();
diff --git a/router/java/src/net/i2p/router/InNetMessagePool.java b/router/java/src/net/i2p/router/InNetMessagePool.java
index d7b3b92224..47b799da5c 100644
--- a/router/java/src/net/i2p/router/InNetMessagePool.java
+++ b/router/java/src/net/i2p/router/InNetMessagePool.java
@@ -356,7 +356,7 @@ public class InNetMessagePool implements Service {
             I2NPMessage msg = null;
             Hash from = null;
             synchronized (_pendingDataMessages) {
-                if (_pendingDataMessages.size() > 0) {
+                if (!_pendingDataMessages.isEmpty()) {
                     msg = (I2NPMessage)_pendingDataMessages.remove(0);
                     from = (Hash)_pendingDataMessagesFrom.remove(0);
                 }
@@ -379,7 +379,7 @@ public class InNetMessagePool implements Service {
             I2NPMessage msg = null;
             int remaining = 0;
             synchronized (_pendingGatewayMessages) {
-                if (_pendingGatewayMessages.size() > 0)
+                if (!_pendingGatewayMessages.isEmpty())
                     msg = (I2NPMessage)_pendingGatewayMessages.remove(0);
                 remaining = _pendingGatewayMessages.size();
             }
@@ -397,7 +397,7 @@ public class InNetMessagePool implements Service {
                 I2NPMessage msg = null;
                 try {
                     synchronized (_pendingGatewayMessages) {
-                        if (_pendingGatewayMessages.size() <= 0)
+                        if (_pendingGatewayMessages.isEmpty())
                             _pendingGatewayMessages.wait();
                         else
                             msg = (I2NPMessage)_pendingGatewayMessages.remove(0);
@@ -428,7 +428,7 @@ public class InNetMessagePool implements Service {
                 Hash from = null;
                 try {
                     synchronized (_pendingDataMessages) {
-                        if (_pendingDataMessages.size() <= 0) {
+                        if (_pendingDataMessages.isEmpty()) {
                             _pendingDataMessages.wait();
                         } else {
                             msg = (I2NPMessage)_pendingDataMessages.remove(0);
diff --git a/router/java/src/net/i2p/router/JobQueue.java b/router/java/src/net/i2p/router/JobQueue.java
index facdb8921c..892a678edc 100644
--- a/router/java/src/net/i2p/router/JobQueue.java
+++ b/router/java/src/net/i2p/router/JobQueue.java
@@ -383,7 +383,7 @@ public class JobQueue {
     public synchronized void runQueue(int numThreads) {
             // we're still starting up [serially] and we've got at least one runner,
             // so dont do anything
-            if ( (_queueRunners.size() > 0) && (!_allowParallelOperation) ) return;
+            if ( (!_queueRunners.isEmpty()) && (!_allowParallelOperation) ) return;
 
             // we've already enabled parallel operation, so grow to however many are
             // specified
diff --git a/router/java/src/net/i2p/router/Shitlist.java b/router/java/src/net/i2p/router/Shitlist.java
index 482d4264c0..f675d10565 100644
--- a/router/java/src/net/i2p/router/Shitlist.java
+++ b/router/java/src/net/i2p/router/Shitlist.java
@@ -210,7 +210,7 @@ public class Shitlist {
             fully = true;
         } else {
             e.transports.remove(transport);
-            if (e.transports.size() <= 0)
+            if (e.transports.isEmpty())
                 fully = true;
             else
                 _entries.put(peer, e);
diff --git a/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java b/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java
index 770c228222..45622d1170 100644
--- a/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java
+++ b/router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java
@@ -363,7 +363,7 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
             }
         }
         
-        if (leases.size() <= 0) {
+        if (leases.isEmpty()) {
             if (_log.shouldLog(Log.INFO))
                 _log.info(getJobId() + ": No leases found from: " + _leaseSet);
             return false;
@@ -536,7 +536,7 @@ public class OutboundClientMessageOneShotJob extends JobImpl {
         ReplySelector selector = null;
         if (wantACK) {
             TagSetHandle tsh = null;
-            if ( (sessKey != null) && (tags != null) && (tags.size() > 0) ) {
+            if ( (sessKey != null) && (tags != null) && (!tags.isEmpty()) ) {
                 if (_leaseSet != null) {
                     SessionKeyManager skm = getContext().clientManager().getClientSessionKeyManager(_from.calculateHash());
                     if (skm != null)
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodOnlySearchJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodOnlySearchJob.java
index 1b81b6e37d..9f21962c19 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodOnlySearchJob.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodOnlySearchJob.java
@@ -93,13 +93,13 @@ class FloodOnlySearchJob extends FloodSearchJob {
         _shouldProcessDSRM = floodfillPeers.size() < MIN_FOR_NO_DSRM ||
                              getContext().routingKeyGenerator().getLastChanged() > getContext().clock().now() - 30*60*1000;
 
-        if (floodfillPeers.size() <= 0) {
+        if (floodfillPeers.isEmpty()) {
             // ask anybody, they may not return the answer but they will return a few ff peers we can go look up,
             // so this situation should be temporary
             if (_log.shouldLog(Log.WARN))
                 _log.warn("Running netDb searches against the floodfill peers, but we don't know any");
             floodfillPeers = new ArrayList(_facade.getAllRouters());
-            if (floodfillPeers.size() <= 0) {
+            if (floodfillPeers.isEmpty()) {
                 if (_log.shouldLog(Log.ERROR))
                     _log.error("We don't know any peers at all");
                 failed();
@@ -256,7 +256,7 @@ class FloodOnlySearchJob extends FloodSearchJob {
         _facade.complete(_key);
         getContext().statManager().addRateData("netDb.successTime", System.currentTimeMillis()-_created, System.currentTimeMillis()-_created);
         synchronized (_onFind) {
-            while (_onFind.size() > 0)
+            while (!_onFind.isEmpty())
                 getContext().jobQueue().addJob((Job)_onFind.remove(0));
         }
     }
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 09f593c80a..bfa5c59ead 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodSearchJob.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodSearchJob.java
@@ -96,7 +96,7 @@ public class FloodSearchJob extends JobImpl {
                     removed = new ArrayList(_onFailed);
                     _onFailed.clear();
                 }
-                while (removed.size() > 0)
+                while (!removed.isEmpty())
                     getContext().jobQueue().addJob(removed.remove(0));
                 getContext().messageRegistry().unregisterPending(out);
                 return;
@@ -140,7 +140,7 @@ public class FloodSearchJob extends JobImpl {
                 removed = new ArrayList(_onFailed);
                 _onFailed.clear();
             }
-            while (removed.size() > 0)
+            while (!removed.isEmpty())
                 getContext().jobQueue().addJob(removed.remove(0));
         }
     }
@@ -155,7 +155,7 @@ public class FloodSearchJob extends JobImpl {
             removed = new ArrayList(_onFind);
             _onFind.clear();
         }
-        while (removed.size() > 0)
+        while (!removed.isEmpty())
             getContext().jobQueue().addJob(removed.remove(0));
     }
 
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java
index 291080f39f..3964b3a1ea 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java
@@ -83,7 +83,7 @@ class FloodfillMonitorJob extends JobImpl {
         List floodfillPeers = _facade.getFloodfillPeers();
         long now = getContext().clock().now();
         // We know none at all! Must be our turn...
-        if (floodfillPeers == null || floodfillPeers.size() <= 0) {
+        if (floodfillPeers == null || floodfillPeers.isEmpty()) {
             _lastChanged = now;
             return true;
         }
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 61cc5f1aa4..540173ed63 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillNetworkDatabaseFacade.java
@@ -305,13 +305,13 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
         Job fail = null;
         if (onFind != null) {
             synchronized (onFind) {
-                if (onFind.size() > 0)
+                if (!onFind.isEmpty())
                     find = onFind.remove(0);
             } 
         }
         if (onFailed != null) {
             synchronized (onFailed) {
-                if (onFailed.size() > 0)
+                if (!onFailed.isEmpty())
                     fail = onFailed.remove(0);
             }
         }
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
index 9cacb0eed4..c4e1140c2a 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
@@ -313,7 +313,7 @@ class FloodfillPeerSelector extends PeerSelector {
             }
             // are we corrupting _sorted here?
             for (int i = rv.size(); i < howMany; i++) {
-                if (_sorted.size() <= 0)
+                if (_sorted.isEmpty())
                     break;
                 Hash entry = _sorted.first();
                 rv.add(entry);
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillVerifyStoreJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillVerifyStoreJob.java
index 5dd5a261bf..fa944f384d 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillVerifyStoreJob.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillVerifyStoreJob.java
@@ -138,7 +138,7 @@ public class FloodfillVerifyStoreJob extends JobImpl {
         Hash rkey = getContext().routingKeyGenerator().getRoutingKey(_key);
         FloodfillPeerSelector sel = (FloodfillPeerSelector)_facade.getPeerSelector();
         List<Hash> peers = sel.selectFloodfillParticipants(rkey, 1, _ignore, _facade.getKBuckets());
-        if (peers.size() > 0)
+        if (!peers.isEmpty())
             return peers.get(0);
         
         if (_log.shouldLog(Log.WARN))
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 9b01d6404d..d978f8488f 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
@@ -725,7 +725,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
             long age = _context.clock().now() - routerInfo.getPublished();
             return "Peer " + key.toBase64() + " published " + DataHelper.formatDuration(age) + " ago";
         } else if (upLongEnough && !routerInfo.isCurrent(ROUTER_INFO_EXPIRATION_SHORT)) {
-            if (routerInfo.getAddresses().size() <= 0)
+            if (routerInfo.getAddresses().isEmpty())
                 return "Peer " + key.toBase64() + " published > 90m ago with no addresses";
             RouterAddress ra = routerInfo.getTargetAddress("SSU");
             if (ra != null) {
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/MessageWrapper.java b/router/java/src/net/i2p/router/networkdb/kademlia/MessageWrapper.java
index 73ed7ad704..82c7f121f0 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/MessageWrapper.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/MessageWrapper.java
@@ -69,7 +69,7 @@ class MessageWrapper {
             return null;
         TagSetHandle tsh = null;
         PublicKey sentTo = to.getIdentity().getPublicKey();
-        if (sentTags.size() > 0)
+        if (!sentTags.isEmpty())
             tsh = skm.tagsDelivered(sentTo, sentKey, sentTags);
         if (_log.shouldLog(Log.DEBUG))
             _log.debug("Sent to: " + to.getIdentity().getHash() + " with key: " + sentKey + " and tags: " + sentTags.size());
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/PeerSelector.java b/router/java/src/net/i2p/router/networkdb/kademlia/PeerSelector.java
index 7ce9853caa..1744142026 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/PeerSelector.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/PeerSelector.java
@@ -140,7 +140,7 @@ public class PeerSelector {
         public List<Hash> get(int howMany) {
             List<Hash> rv = new ArrayList(howMany);
             for (int i = 0; i < howMany; i++) {
-                if (_sorted.size() <= 0)
+                if (_sorted.isEmpty())
                     break;
                 rv.add(_sorted.remove(_sorted.firstKey()));
             }
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java
index fe3c754851..9400a17f69 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/SearchJob.java
@@ -265,7 +265,7 @@ class SearchJob extends JobImpl {
         while (sent <= 0) {
             //boolean onlyFloodfill = onlyQueryFloodfillPeers(getContext());
             boolean onlyFloodfill = true;
-            if (_floodfillPeersExhausted && onlyFloodfill && _state.getPending().size() <= 0) {
+            if (_floodfillPeersExhausted && onlyFloodfill && _state.getPending().isEmpty()) {
                 if (_log.shouldLog(Log.WARN))
                     _log.warn(getJobId() + ": no non-floodfill peers left, and no more pending.  Searched: "
                               + _state.getAttempted().size() + " failed: " + _state.getFailed().size());
@@ -273,8 +273,8 @@ class SearchJob extends JobImpl {
                 return;
             }
             List closestHashes = getClosestRouters(_state.getTarget(), toCheck, attempted);
-            if ( (closestHashes == null) || (closestHashes.size() <= 0) ) {
-                if (_state.getPending().size() <= 0) {
+            if ( (closestHashes == null) || (closestHashes.isEmpty()) ) {
+                if (_state.getPending().isEmpty()) {
                     // we tried to find some peers, but there weren't any and no one else is going to answer
                     if (_log.shouldLog(Log.INFO))
                         _log.info(getJobId() + ": No peers left, and none pending!  Already searched: " 
@@ -746,7 +746,7 @@ class SearchJob extends JobImpl {
     private void handleDeferred(boolean success) {
         List deferred = null;
         synchronized (_deferredSearches) {
-            if (_deferredSearches.size() > 0) {
+            if (!_deferredSearches.isEmpty()) {
                 deferred = new ArrayList(_deferredSearches);
                 _deferredSearches.clear();
             }
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/StoreJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/StoreJob.java
index 690f37b87f..ad8217c6a7 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/StoreJob.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/StoreJob.java
@@ -151,8 +151,8 @@ class StoreJob extends JobImpl {
         //else
         //    closestHashes = getClosestRouters(_state.getTarget(), toCheck, _state.getAttempted());
         closestHashes = getClosestFloodfillRouters(_state.getTarget(), toCheck, _state.getAttempted());
-        if ( (closestHashes == null) || (closestHashes.size() <= 0) ) {
-            if (_state.getPending().size() <= 0) {
+        if ( (closestHashes == null) || (closestHashes.isEmpty()) ) {
+            if (_state.getPending().isEmpty()) {
                 if (_log.shouldLog(Log.INFO))
                     _log.info(getJobId() + ": No more peers left and none pending");
                 fail();
diff --git a/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java b/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java
index dbeee1a4df..29fce33a6c 100644
--- a/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java
+++ b/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java
@@ -285,12 +285,12 @@ public class Reseeder {
     private static final String BUNDLE_NAME = "net.i2p.router.web.messages";
 
     /** translate */
-    public String _(String key) {
+    private String _(String key) {
         return Translate.getString(key, _context, BUNDLE_NAME);
     }
 
     /** translate */
-    public String _(String s, Object o, Object o2) {
+    private String _(String s, Object o, Object o2) {
         return Translate.getString(s, o, o2, _context, BUNDLE_NAME);
     }
 
diff --git a/router/java/src/net/i2p/router/peermanager/PeerManager.java b/router/java/src/net/i2p/router/peermanager/PeerManager.java
index 61f5c2062e..bfe038e8c5 100644
--- a/router/java/src/net/i2p/router/peermanager/PeerManager.java
+++ b/router/java/src/net/i2p/router/peermanager/PeerManager.java
@@ -226,7 +226,7 @@ class PeerManager {
         int index = _context.random().nextInt(Integer.MAX_VALUE);
         synchronized (_capabilitiesByPeer) {
             List peers = locked_getPeers(capability);
-            if ( (peers != null) && (peers.size() > 0) ) {
+            if ( (peers != null) && (!peers.isEmpty()) ) {
                 index = index % peers.size();
                 return (Hash)peers.get(index);
             }
diff --git a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
index 50fdd8ddc4..3e5eafd74c 100644
--- a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
+++ b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
@@ -91,7 +91,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
         }
         Vector skews = _manager.getClockSkews();
         if (skews == null ||
-            skews.size() <= 0 ||
+            skews.isEmpty() ||
             (skews.size() < 5 && _context.clock().getUpdatedSuccessfully())) {
             return _context.clock().getOffset();
         }
diff --git a/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java b/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
index e9cde0b9c7..112d366014 100644
--- a/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
+++ b/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
@@ -443,7 +443,7 @@ public class FIFOBandwidthLimiter {
      *
      */
     private final void locked_satisfyInboundUnlimited(List<Request> satisfied) {
-        while (_pendingInboundRequests.size() > 0) {
+        while (!_pendingInboundRequests.isEmpty()) {
             SimpleRequest req = (SimpleRequest)_pendingInboundRequests.remove(0);
             int allocated = req.getPendingInboundRequested();
             _totalAllocatedInboundBytes.addAndGet(allocated);
@@ -558,7 +558,7 @@ public class FIFOBandwidthLimiter {
      *
      */
     private final void locked_satisfyOutboundUnlimited(List<Request> satisfied) {
-        while (_pendingOutboundRequests.size() > 0) {
+        while (!_pendingOutboundRequests.isEmpty()) {
             SimpleRequest req = (SimpleRequest)_pendingOutboundRequests.remove(0);
             int allocated = req.getPendingOutboundRequested();
             _totalAllocatedOutboundBytes.addAndGet(allocated);
diff --git a/router/java/src/net/i2p/router/transport/OutboundMessageRegistry.java b/router/java/src/net/i2p/router/transport/OutboundMessageRegistry.java
index 17108a8e87..b8261d1d2b 100644
--- a/router/java/src/net/i2p/router/transport/OutboundMessageRegistry.java
+++ b/router/java/src/net/i2p/router/transport/OutboundMessageRegistry.java
@@ -185,7 +185,7 @@ public class OutboundMessageRegistry {
                 if (old instanceof List) {
                     List l = (List)old;
                     l.remove(msg);
-                    if (l.size() > 0) {
+                    if (!l.isEmpty()) {
                         _selectorToMessage.put(sel, l);
                         stillActive = true;
                     }
@@ -221,7 +221,7 @@ public class OutboundMessageRegistry {
                     }
                 }
             }
-            if (removing.size() > 0) {
+            if (!removing.isEmpty()) {
                 for (int i = 0; i < removing.size(); i++) {
                     MessageSelector sel = (MessageSelector)removing.get(i);
                     OutNetMessage msg = null;
diff --git a/router/java/src/net/i2p/router/transport/TransportImpl.java b/router/java/src/net/i2p/router/transport/TransportImpl.java
index e046cdde81..77604083e9 100644
--- a/router/java/src/net/i2p/router/transport/TransportImpl.java
+++ b/router/java/src/net/i2p/router/transport/TransportImpl.java
@@ -147,7 +147,7 @@ public abstract class TransportImpl implements Transport {
     public OutNetMessage getNextMessage() {
         OutNetMessage msg = null;
         synchronized (_sendPool) {
-            if (_sendPool.size() <= 0) return null;
+            if (_sendPool.isEmpty()) return null;
             msg = (OutNetMessage)_sendPool.remove(0); // use priority queues later
         }
         msg.beginSend();
diff --git a/router/java/src/net/i2p/router/transport/TransportManager.java b/router/java/src/net/i2p/router/transport/TransportManager.java
index a479ad52f9..a4088b715b 100644
--- a/router/java/src/net/i2p/router/transport/TransportManager.java
+++ b/router/java/src/net/i2p/router/transport/TransportManager.java
@@ -84,7 +84,7 @@ public class TransportManager implements TransportEventListener {
         }
         if (enableNTCP(_context))
             addTransport(new NTCPTransport(_context));
-        if (_transports.size() <= 0)
+        if (_transports.isEmpty())
             _log.log(Log.CRIT, "No transports are enabled");
     }
     
@@ -223,7 +223,7 @@ public class TransportManager implements TransportEventListener {
       * Use for throttling in the router.
       */
     public boolean haveHighOutboundCapacity() { 
-        if (_transports.size() <= 0)
+        if (_transports.isEmpty())
             return false;
         for (int i = 0; i < _transports.size(); i++) {
             if (!_transports.get(i).haveCapacity(HIGH_CAPACITY_PCT))
@@ -255,7 +255,7 @@ public class TransportManager implements TransportEventListener {
         Vector skews = new Vector();
         for (int i = 0; i < _transports.size(); i++) {
             Vector tempSkews = _transports.get(i).getClockSkews();
-            if ((tempSkews == null) || (tempSkews.size() <= 0)) continue;
+            if ((tempSkews == null) || (tempSkews.isEmpty())) continue;
             skews.addAll(tempSkews);
         }
         if (_log.shouldLog(Log.DEBUG))
@@ -373,7 +373,7 @@ public class TransportManager implements TransportEventListener {
     
     public TransportBid getBid(OutNetMessage msg) {
         List<TransportBid> bids = getBids(msg);
-        if ( (bids == null) || (bids.size() <= 0) )
+        if ( (bids == null) || (bids.isEmpty()) )
             return null;
         else
             return bids.get(0);
diff --git a/router/java/src/net/i2p/router/transport/UPnP.java b/router/java/src/net/i2p/router/transport/UPnP.java
index 0fc538a3f3..aa2261cfc7 100644
--- a/router/java/src/net/i2p/router/transport/UPnP.java
+++ b/router/java/src/net/i2p/router/transport/UPnP.java
@@ -391,7 +391,7 @@ public class UPnP extends ControlPoint implements DeviceChangeListener, EventLis
 	// TODO: extend it! RTFM
 	private void listSubServices(Device dev, StringBuilder sb) {
 		ServiceList sl = dev.getServiceList();
-		if (sl.size() <= 0)
+		if (sl.isEmpty())
 			return;
 		sb.append("<ul>\n");
 		for(int i=0; i<sl.size(); i++) {
@@ -440,7 +440,7 @@ public class UPnP extends ControlPoint implements DeviceChangeListener, EventLis
 		listSubServices(dev, sb);
 		
 		DeviceList dl = dev.getDeviceList();
-		if (dl.size() <= 0)
+		if (dl.isEmpty())
 			return;
 		sb.append("<ul>\n");
 		for(int j=0; j<dl.size(); j++) {
diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java
index 043fb18c26..52c0218fc7 100644
--- a/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java
+++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java
@@ -487,7 +487,7 @@ public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
                 return;
             }
                 //throw new RuntimeException("We should not be preparing a write while we still have one pending");
-            if (_outbound.size() > 0) {
+            if (!_outbound.isEmpty()) {
                 msg = (OutNetMessage)_outbound.remove(0);
                 _currentOutbound = msg;
             } else {
@@ -711,7 +711,7 @@ public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener {
     private final static List _bufs = new ArrayList(NUM_PREP_BUFS);
     private PrepBuffer acquireBuf() {
         synchronized (_bufs) {
-            if (_bufs.size() > 0) {
+            if (!_bufs.isEmpty()) {
                 PrepBuffer b = (PrepBuffer)_bufs.remove(0);
                 b.acquired();
                 return b;
diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
index 779fd97e4f..fea56423b6 100644
--- a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
+++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java
@@ -559,7 +559,7 @@ public class NTCPTransport extends TransportImpl {
         }
         for (int i = 0; expired != null && i < expired.size(); i++)
             ((NTCPConnection)expired.get(i)).close();
-        if ( (expired != null) && (expired.size() > 0) )
+        if ( (expired != null) && (!expired.isEmpty()) )
             _context.statManager().addRateData("ntcp.outboundEstablishFailed", expired.size(), 0);
     }
 
@@ -763,12 +763,12 @@ public class NTCPTransport extends TransportImpl {
             buf.setLength(0);
         }
 
-        if (peers.size() > 0) {
+        if (!peers.isEmpty()) {
 //            buf.append("<tr> <td colspan=\"11\"><hr></td></tr>\n");
             buf.append("<tr class=\"tablefooter\"><td align=\"center\"><b>").append(peers.size()).append(' ').append(_("peers")).append("</b></td><td>&nbsp;</td><td>&nbsp;");
             buf.append("</td><td align=\"center\"><b>").append(formatRate(bpsRecv/1024)).append("/").append(formatRate(bpsSend/1024)).append("</b>");
             buf.append("</td><td align=\"center\"><b>").append(DataHelper.formatDuration(totalUptime/peers.size()));
-            buf.append("</b></td><td align=\"center\"><b>").append(peers.size() > 0 ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
+            buf.append("</b></td><td align=\"center\"><b>").append((!peers.isEmpty()) ? DataHelper.formatDuration(offsetTotal*1000/peers.size()) : "0ms");
             buf.append("</b></td><td align=\"center\"><b>").append(totalSend).append("</b></td><td align=\"center\"><b>").append(totalRecv);
             buf.append("</b></td><td>&nbsp;</td><td>&nbsp;</td></tr>\n");
         }
diff --git a/router/java/src/net/i2p/router/transport/ntcp/Reader.java b/router/java/src/net/i2p/router/transport/ntcp/Reader.java
index c0f77c1a85..ce21e13c31 100644
--- a/router/java/src/net/i2p/router/transport/ntcp/Reader.java
+++ b/router/java/src/net/i2p/router/transport/ntcp/Reader.java
@@ -40,7 +40,7 @@ class Reader {
         }
     }
     public void stopReading() {
-        while (_runners.size() > 0) {
+        while (!_runners.isEmpty()) {
             Runner r = _runners.remove(0);
             r.stop();
         }
@@ -90,7 +90,7 @@ class Reader {
                         } else {
                             _liveReads.remove(con);
                             con = null;
-                            if (_pendingConnections.size() <= 0) {
+                            if (_pendingConnections.isEmpty()) {
                                 _pendingConnections.wait();
                             } else {
                                 con = _pendingConnections.remove(0);
diff --git a/router/java/src/net/i2p/router/transport/ntcp/Writer.java b/router/java/src/net/i2p/router/transport/ntcp/Writer.java
index 45efc30553..ca676c572c 100644
--- a/router/java/src/net/i2p/router/transport/ntcp/Writer.java
+++ b/router/java/src/net/i2p/router/transport/ntcp/Writer.java
@@ -39,7 +39,7 @@ class Writer {
         }
     }
     public void stopWriting() {
-        while (_runners.size() > 0) {
+        while (!_runners.isEmpty()) {
             Runner r = _runners.remove(0);
             r.stop();
         }
@@ -95,7 +95,7 @@ class Writer {
                         } else {
                             _liveWrites.remove(con);
                             con = null;
-                            if (_pendingConnections.size() <= 0) {
+                            if (_pendingConnections.isEmpty()) {
                                 if (_log.shouldLog(Log.DEBUG))
                                     _log.debug("Done writing, but nothing pending, so wait");
                                 _pendingConnections.wait();
diff --git a/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java b/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java
index 64e1bdea2d..1a99c095cd 100644
--- a/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java
+++ b/router/java/src/net/i2p/router/transport/udp/EstablishmentManager.java
@@ -359,14 +359,14 @@ public class EstablishmentManager {
 /********
     private int locked_admitQueued() {
         int admitted = 0;
-        while ( (_queuedOutbound.size() > 0) && (_outboundStates.size() < getMaxConcurrentEstablish()) ) {
+        while ( (!_queuedOutbound.isEmpty()) && (_outboundStates.size() < getMaxConcurrentEstablish()) ) {
             // ok, active shrunk, lets let some queued in.  duplicate the synchronized 
             // section from the add(
 
             RemoteHostId to = (RemoteHostId)_queuedOutbound.keySet().iterator().next();
             List queued = (List)_queuedOutbound.remove(to);
 
-            if (queued.size() <= 0)
+            if (queued.isEmpty())
                 continue;
             
             OutNetMessage msg = (OutNetMessage)queued.get(0);
diff --git a/router/java/src/net/i2p/router/transport/udp/PacketBuilder.java b/router/java/src/net/i2p/router/transport/udp/PacketBuilder.java
index 4b16d078da..53791ffa99 100644
--- a/router/java/src/net/i2p/router/transport/udp/PacketBuilder.java
+++ b/router/java/src/net/i2p/router/transport/udp/PacketBuilder.java
@@ -131,7 +131,7 @@ public class PacketBuilder {
             }
         }
 
-        if ( (partialACKsRemaining != null) && (partialACKsRemaining.size() > 0) ) {
+        if ( (partialACKsRemaining != null) && (!partialACKsRemaining.isEmpty()) ) {
             int origNumRemaining = partialACKsRemaining.size();
             int numPartialOffset = off;
             // leave it blank for now, since we could skip some
diff --git a/router/java/src/net/i2p/router/transport/udp/PeerState.java b/router/java/src/net/i2p/router/transport/udp/PeerState.java
index 06e528a944..86b3aad6ee 100644
--- a/router/java/src/net/i2p/router/transport/udp/PeerState.java
+++ b/router/java/src/net/i2p/router/transport/udp/PeerState.java
@@ -749,7 +749,7 @@ public class PeerState {
             }
             if (_currentACKs.isEmpty())
                 _wantACKSendSince = -1;
-            if (alwaysIncludeRetransmissions || rv.size() > 0) {
+            if (alwaysIncludeRetransmissions || !rv.isEmpty()) {
                 // now repeat by putting in some old ACKs
                 // randomly selected from the Resend queue.
                 // Maybe we should only resend each one a certain number of times...
diff --git a/router/java/src/net/i2p/router/transport/udp/UDPFlooder.java b/router/java/src/net/i2p/router/transport/udp/UDPFlooder.java
index 38bf62246e..aa34b1a4bf 100644
--- a/router/java/src/net/i2p/router/transport/udp/UDPFlooder.java
+++ b/router/java/src/net/i2p/router/transport/udp/UDPFlooder.java
@@ -66,7 +66,7 @@ class UDPFlooder implements Runnable {
         while (_alive) {
             try {
                 synchronized (_peers) {
-                    if (_peers.size() <= 0)
+                    if (_peers.isEmpty())
                         _peers.wait();
                 }
             } catch (InterruptedException ie) {}
diff --git a/router/java/src/net/i2p/router/transport/udp/UDPSender.java b/router/java/src/net/i2p/router/transport/udp/UDPSender.java
index 6d1cd7c3a7..745b50df4b 100644
--- a/router/java/src/net/i2p/router/transport/udp/UDPSender.java
+++ b/router/java/src/net/i2p/router/transport/udp/UDPSender.java
@@ -106,12 +106,12 @@ public class UDPSender {
                 synchronized (_outboundQueue) {
                     // clear out any too-old packets
                     UDPPacket head = null;
-                    if (_outboundQueue.size() > 0) {
+                    if (!_outboundQueue.isEmpty()) {
                         head = (UDPPacket)_outboundQueue.get(0);
                         while (head.getLifetime() > MAX_HEAD_LIFETIME) {
                             _outboundQueue.remove(0);
                             removed++;
-                            if (_outboundQueue.size() > 0)
+                            if (!_outboundQueue.isEmpty())
                                 head = (UDPPacket)_outboundQueue.get(0);
                             else
                                 break;
diff --git a/router/java/src/net/i2p/router/tunnel/BatchedPreprocessor.java b/router/java/src/net/i2p/router/tunnel/BatchedPreprocessor.java
index 879eb78e70..4533956d37 100644
--- a/router/java/src/net/i2p/router/tunnel/BatchedPreprocessor.java
+++ b/router/java/src/net/i2p/router/tunnel/BatchedPreprocessor.java
@@ -137,7 +137,7 @@ public class BatchedPreprocessor extends TrivialPreprocessor {
         int beforeLooping = pending.size();
         
         // loop until the queue is empty
-        while (pending.size() > 0) {
+        while (!pending.isEmpty()) {
             int allocated = 0;
             long beforePendingLoop = System.currentTimeMillis();
 
@@ -252,7 +252,7 @@ public class BatchedPreprocessor extends TrivialPreprocessor {
                         _context.statManager().addRateData("tunnel.writeDelay", cur.getLifetime(), cur.getData().length);
                     }
 
-                    if (pending.size() > 0) {
+                    if (!pending.isEmpty()) {
                         // rare
                         _pendingSince = _context.clock().now();
                         _context.statManager().addRateData("tunnel.batchFlushRemaining", pending.size(), beforeSize);
diff --git a/router/java/src/net/i2p/router/tunnel/PumpedTunnelGateway.java b/router/java/src/net/i2p/router/tunnel/PumpedTunnelGateway.java
index fddb30d2ca..a761ef1208 100644
--- a/router/java/src/net/i2p/router/tunnel/PumpedTunnelGateway.java
+++ b/router/java/src/net/i2p/router/tunnel/PumpedTunnelGateway.java
@@ -85,7 +85,7 @@ public class PumpedTunnelGateway extends TunnelGateway {
      */
     void pump(List<Pending> queueBuf) {
         synchronized (_prequeue) {
-            if (_prequeue.size() > 0) {
+            if (!_prequeue.isEmpty()) {
                 queueBuf.addAll(_prequeue);
                 _prequeue.clear();
             } else {
diff --git a/router/java/src/net/i2p/router/tunnel/TrivialPreprocessor.java b/router/java/src/net/i2p/router/tunnel/TrivialPreprocessor.java
index 3dac4dd205..c9b28b8562 100644
--- a/router/java/src/net/i2p/router/tunnel/TrivialPreprocessor.java
+++ b/router/java/src/net/i2p/router/tunnel/TrivialPreprocessor.java
@@ -59,7 +59,7 @@ public class TrivialPreprocessor implements TunnelGateway.QueuePreprocessor {
             buf = new StringBuilder(256);
             buf.append("Trivial preprocessing of ").append(pending.size()).append(" ");
         }
-        while (pending.size() > 0) {
+        while (!pending.isEmpty()) {
             TunnelGateway.Pending msg = pending.remove(0);
             long beforePreproc = System.currentTimeMillis();
             byte preprocessed[][] = preprocess(msg);
diff --git a/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java b/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java
index 7dfbded7d8..b7659077cc 100644
--- a/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java
+++ b/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java
@@ -649,7 +649,7 @@ public class TunnelDispatcher implements Service {
     public void dropBiggestParticipating() {
 
        List<HopConfig> partTunnels = listParticipatingTunnels();
-       if ((partTunnels == null) || (partTunnels.size() == 0)) {
+       if ((partTunnels == null) || (partTunnels.isEmpty())) {
            if (_log.shouldLog(Log.ERROR))
                _log.error("Not dropping tunnel, since partTunnels was null or had 0 items!");
            return;
@@ -745,7 +745,7 @@ public class TunnelDispatcher implements Service {
             Long dropTime = new Long(cfg.getExpiration() + 2*Router.CLOCK_FUDGE_FACTOR + LEAVE_BATCH_TIME);
             boolean noTunnels;
             synchronized (LeaveTunnel.this) {
-                noTunnels = _configs.size() <= 0;
+                noTunnels = _configs.isEmpty();
                 _configs.add(cfg);
                 _times.add(dropTime);
             
@@ -777,13 +777,13 @@ public class TunnelDispatcher implements Service {
             long now = getContext().clock().now() + LEAVE_BATCH_TIME; // leave all expiring in next 10 sec
             while (true) {
                 synchronized (LeaveTunnel.this) {
-                    if (_configs.size() <= 0)
+                    if (_configs.isEmpty())
                         return;
                     nextTime = _times.get(0);
                     if (nextTime.longValue() <= now) {
                         cur = _configs.remove(0);
                         _times.remove(0);
-                        if (_times.size() > 0)
+                        if (!_times.isEmpty())
                             nextTime = _times.get(0);
                         else
                             nextTime = null;
diff --git a/router/java/src/net/i2p/router/tunnel/TunnelGateway.java b/router/java/src/net/i2p/router/tunnel/TunnelGateway.java
index bf093f7a26..7291c8706a 100644
--- a/router/java/src/net/i2p/router/tunnel/TunnelGateway.java
+++ b/router/java/src/net/i2p/router/tunnel/TunnelGateway.java
@@ -294,7 +294,7 @@ public class TunnelGateway {
                 //if (_queue.size() > 10000) // stay in the synchronized block
                 //    System.out.println("foo!");
                 afterChecked = _context.clock().now();
-                if (_queue.size() > 0) {
+                if (!_queue.isEmpty()) {
                     if ( (remaining > 0) && (_log.shouldLog(Log.DEBUG)) )
                         _log.debug("Remaining before delayed flush preprocessing: " + _queue);
                     wantRequeue = _preprocessor.preprocessQueue(_queue, _sender, _receiver);
diff --git a/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java b/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java
index aa6417fdac..8b08b6ec8c 100644
--- a/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java
+++ b/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java
@@ -298,7 +298,7 @@ class BuildExecutor implements Runnable {
                         }
                     }
                 } else {
-                    if ( (allowed > 0) && (wanted.size() > 0) ) {
+                    if ( (allowed > 0) && (!wanted.isEmpty()) ) {
                         Collections.shuffle(wanted, _context.random());
                         Collections.sort(wanted, new TunnelPoolComparator());
 
@@ -307,7 +307,7 @@ class BuildExecutor implements Runnable {
                         if (allowed > 2)
                             allowed = 2;
                         
-                        for (int i = 0; (i < allowed) && (wanted.size() > 0); i++) {
+                        for (int i = 0; (i < allowed) && (!wanted.isEmpty()); i++) {
                             TunnelPool pool = wanted.remove(0);
                             //if (pool.countWantedTunnels() <= 0)
                             //    continue;
diff --git a/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java b/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java
index 01eb674f4d..705552c190 100644
--- a/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java
+++ b/router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java
@@ -139,14 +139,14 @@ class BuildHandler {
                         } else {
                             break;
                         }
-                    } while (_inboundBuildMessages.size() > 0);
+                    } while (!_inboundBuildMessages.isEmpty());
                     
                     if (dropExpired > 0)
                         _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Too slow"));
 
                     // now pull off the oldest requests first (we're doing a tail-drop
                     // when adding)
-                    for (int i = 0; i < toHandle && _inboundBuildMessages.size() > 0; i++)
+                    for (int i = 0; i < toHandle && !_inboundBuildMessages.isEmpty(); i++)
                         handled.add(_inboundBuildMessages.remove(0));
                 //}
             }
diff --git a/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java b/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java
index d116431a47..e6f3e599e8 100644
--- a/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java
+++ b/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java
@@ -152,7 +152,7 @@ public class TunnelPool {
             _lastSelectionPeriod = period;
             _lastSelected = null;
 
-            if (_tunnels.size() <= 0) {
+            if (_tunnels.isEmpty()) {
                 if (_log.shouldLog(Log.WARN))
                     _log.warn(toString() + ": No tunnels to select from");
             } else {
@@ -483,7 +483,7 @@ public class TunnelPool {
             if (_log.shouldLog(Log.WARN))
                 _log.warn(toString() + ": Not enough tunnels (" + _tunnels.size() + ", wanted " + wanted + ")");
             // see comment below
-            if (_tunnels.size() <= 0)
+            if (_tunnels.isEmpty())
                 return null;
         }
 
@@ -538,7 +538,7 @@ public class TunnelPool {
         if (leases.size() < wanted) {
             if (_log.shouldLog(Log.WARN))
                 _log.warn(toString() + ": Not enough leases (" + leases.size() + ", wanted " + wanted + ")");
-            if (leases.size() <= 0)
+            if (leases.isEmpty())
                 return null;
         }
 
@@ -858,7 +858,7 @@ public class TunnelPool {
 
         if (!forceZeroHop) {
             peers = _peerSelector.selectPeers(_context, settings);
-            if ( (peers == null) || (peers.size() <= 0) ) {
+            if ( (peers == null) || (peers.isEmpty()) ) {
                 // no inbound or outbound tunnels to send the request through, and 
                 // the pool is refusing 0 hop tunnels
                 if (peers == null) {
-- 
GitLab