From 691e274ca747129a0d67ff590b2fd4402af6a7cd Mon Sep 17 00:00:00 2001
From: z3r0fox <z3r0fox@mail.i2p>
Date: Sat, 6 Feb 2016 22:38:10 +0000
Subject: [PATCH] Linting dep-ann: Added @Deprecated annotations in i2psnark,
 i2ptunnel, ministreaming, routerconsole, streaming

---
 apps/i2psnark/java/src/org/klomp/snark/Peer.java            | 3 +++
 apps/i2psnark/java/src/org/klomp/snark/PeerID.java          | 1 +
 apps/i2psnark/java/src/org/klomp/snark/PeerMonitorTask.java | 1 +
 apps/i2psnark/java/src/org/klomp/snark/PeerState.java       | 1 +
 apps/i2psnark/java/src/org/klomp/snark/SnarkShutdown.java   | 1 +
 .../java/src/org/klomp/snark/web/RunStandalone.java         | 1 +
 apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java    | 1 +
 .../java/src/net/i2p/i2ptunnel/I2PTunnelClient.java         | 1 +
 .../java/src/net/i2p/i2ptunnel/I2PTunnelOutproxyRunner.java | 2 ++
 .../java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java         | 6 ++++++
 .../java/src/net/i2p/i2ptunnel/TunnelController.java        | 2 ++
 .../java/src/net/i2p/client/streaming/I2PServerSocket.java  | 1 +
 .../java/src/net/i2p/client/streaming/I2PSocket.java        | 1 +
 .../net/i2p/client/streaming/I2PSocketManagerFactory.java   | 1 +
 .../src/net/i2p/client/streaming/I2PSocketManagerFull.java  | 1 +
 .../java/src/net/i2p/router/web/ConfigNetHelper.java        | 1 +
 .../java/src/net/i2p/router/web/SummaryRenderer.java        | 3 ++-
 .../net/i2p/client/streaming/impl/ConnectionOptions.java    | 1 +
 .../net/i2p/client/streaming/impl/I2PServerSocketFull.java  | 1 +
 .../src/net/i2p/client/streaming/impl/I2PSocketFull.java    | 1 +
 .../net/i2p/client/streaming/impl/I2PSocketManagerFull.java | 2 ++
 .../java/src/net/i2p/client/streaming/impl/PacketLocal.java | 4 ++++
 .../net/i2p/client/streaming/impl/RetransmissionTimer.java  | 1 +
 23 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/apps/i2psnark/java/src/org/klomp/snark/Peer.java b/apps/i2psnark/java/src/org/klomp/snark/Peer.java
index 68258022e2..88ce20a1bc 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/Peer.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/Peer.java
@@ -194,6 +194,7 @@ public class Peer implements Comparable<Peer>
    * Compares the PeerIDs.
    * @deprecated unused?
    */
+  @Deprecated
   public int compareTo(Peer p)
   {
     int rv = peerID.compareTo(p.peerID);
@@ -531,6 +532,7 @@ public class Peer implements Comparable<Peer>
    * @deprecated deadlocks
    * @since 0.8.1
    */
+  @Deprecated
   boolean isRequesting(int p) {
     PeerState s = state;
     return s != null && s.isRequesting(p);
@@ -563,6 +565,7 @@ public class Peer implements Comparable<Peer>
    * us then we start downloading from it. Has no effect when not connected.
    * @deprecated unused
    */
+  @Deprecated
   public void setInteresting(boolean interest)
   {
     PeerState s = state;
diff --git a/apps/i2psnark/java/src/org/klomp/snark/PeerID.java b/apps/i2psnark/java/src/org/klomp/snark/PeerID.java
index 405d9e508a..ba866873bc 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/PeerID.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/PeerID.java
@@ -196,6 +196,7 @@ public class PeerID implements Comparable<PeerID>
    * Compares port, address and id.
    * @deprecated unused? and will NPE now that address can be null?
    */
+  @Deprecated
   public int compareTo(PeerID pid)
   {
     int result = port - pid.port;
diff --git a/apps/i2psnark/java/src/org/klomp/snark/PeerMonitorTask.java b/apps/i2psnark/java/src/org/klomp/snark/PeerMonitorTask.java
index b7db1dad46..9fc875c1a4 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/PeerMonitorTask.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/PeerMonitorTask.java
@@ -30,6 +30,7 @@ import net.i2p.data.DataHelper;
  *
  * @deprecated unused, for command line client only, commented out in Snark.java
  */
+@Deprecated
 class PeerMonitorTask implements Runnable
 {
   final static long MONITOR_PERIOD = 10 * 1000; // Ten seconds.
diff --git a/apps/i2psnark/java/src/org/klomp/snark/PeerState.java b/apps/i2psnark/java/src/org/klomp/snark/PeerState.java
index 23cbe56907..05e205ed46 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/PeerState.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/PeerState.java
@@ -744,6 +744,7 @@ class PeerState implements DataLoader
    * @deprecated deadlocks
    * @since 0.8.1
    */
+  @Deprecated
   synchronized boolean isRequesting(int piece) {
       if (pendingRequest != null && pendingRequest.getPiece() == piece)
           return true;
diff --git a/apps/i2psnark/java/src/org/klomp/snark/SnarkShutdown.java b/apps/i2psnark/java/src/org/klomp/snark/SnarkShutdown.java
index 7859220caf..118b126d11 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/SnarkShutdown.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/SnarkShutdown.java
@@ -28,6 +28,7 @@ import net.i2p.util.I2PAppThread;
  * Makes sure everything ends correctly when shutting down.
  * @deprecated unused
  */
+@Deprecated
 public class SnarkShutdown extends I2PAppThread
 {
   private final Storage storage;
diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/RunStandalone.java b/apps/i2psnark/java/src/org/klomp/snark/web/RunStandalone.java
index d89c011e2c..0104d7dcbe 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/web/RunStandalone.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/web/RunStandalone.java
@@ -10,6 +10,7 @@ import net.i2p.util.FileUtil;
 /**
  *  @deprecated does not work
  */
+@Deprecated
 public class RunStandalone {
 /****
     static {
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java
index e8680e3d31..99d225a348 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java
@@ -1831,6 +1831,7 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
      * just call context.namingService.lookup() directly.
      * @deprecated Don't use i2ptunnel for lookup! Use I2PAppContext.getGlobalContext().namingService().lookup(name) from i2p.jar
      */
+    @Deprecated
     public static Destination destFromName(String name) throws DataFormatException {
         return destFromName(name, null, null, false, null, null);
     }
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
index 4b1284cfec..1add404565 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClient.java
@@ -24,6 +24,7 @@ public class I2PTunnelClient extends I2PTunnelClientBase {
      * list of Destination objects that we point at
      * @deprecated why protected? Is anybody using out-of-tree? Protected from the beginning (2004)
      */
+    @Deprecated
     protected List<Destination> dests;
 
     /**
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelOutproxyRunner.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelOutproxyRunner.java
index d8d9369a0a..a23a96c8e0 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelOutproxyRunner.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelOutproxyRunner.java
@@ -93,6 +93,7 @@ public class I2PTunnelOutproxyRunner extends I2PAppThread {
      *
      * @deprecated unused
      */
+    @Deprecated
     public boolean isFinished() {
         return finished;
     }
@@ -104,6 +105,7 @@ public class I2PTunnelOutproxyRunner extends I2PAppThread {
      * @return date (ms since the epoch), or -1 if no data has been transferred yet
      * @deprecated unused
      */
+    @Deprecated
     public long getLastActivityOn() {
         return lastActivityOn;
     }
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java
index b8bfdaebfe..a7f60819aa 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelRunner.java
@@ -82,6 +82,7 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
      *                               Will synchronize on slock when removing.
      *  @deprecated use FailCallback constructor
      */
+    @Deprecated
     public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData,
                            List<I2PSocket> sockList) {
         this(s, i2ps, slock, initialI2PData, null, sockList, null, null, true);
@@ -97,6 +98,7 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
      *                               Will synchronize on slock when removing.
      *  @deprecated use FailCallback constructor
      */
+    @Deprecated
     public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData,
                            byte[] initialSocketData, List<I2PSocket> sockList) {
         this(s, i2ps, slock, initialI2PData, initialSocketData, sockList, null, null, true);
@@ -113,6 +115,7 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
      *                   it will be run before closing s.
      *  @deprecated use FailCallback constructor
      */
+    @Deprecated
     public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData,
                            List<I2PSocket> sockList, Runnable onTimeout) {
         this(s, i2ps, slock, initialI2PData, null, sockList, onTimeout, null, true);
@@ -130,6 +133,7 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
      *                   it will be run before closing s.
      *  @deprecated use FailCallback constructor
      */
+    @Deprecated
     public I2PTunnelRunner(Socket s, I2PSocket i2ps, Object slock, byte[] initialI2PData,
                            byte[] initialSocketData, List<I2PSocket> sockList, Runnable onTimeout) {
         this(s, i2ps, slock, initialI2PData, initialSocketData, sockList, onTimeout, null, true);
@@ -192,6 +196,7 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
      *
      * @deprecated unused
      */
+    @Deprecated
     public boolean isFinished() {
         return finished;
     }
@@ -203,6 +208,7 @@ public class I2PTunnelRunner extends I2PAppThread implements I2PSocket.SocketErr
      * @return date (ms since the epoch), or -1 if no data has been transferred yet
      * @deprecated unused
      */
+    @Deprecated
     public long getLastActivityOn() {
         return lastActivityOn;
     }
diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java
index 229a4b7d17..2997a18b2d 100644
--- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java
+++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelController.java
@@ -752,6 +752,7 @@ public class TunnelController implements Logging {
      *  @return one big string of "key=val key=val ..."
      *  @deprecated why would you want this? Use getClientOptionProps() instead
      */
+    @Deprecated
     public String getClientOptions() {
         StringBuilder opts = new StringBuilder(64);
         for (Map.Entry<Object, Object> e : _config.entrySet()) {
@@ -869,6 +870,7 @@ public class TunnelController implements Logging {
      *  A text description of the tunnel.
      *  @deprecated unused
      */
+    @Deprecated
     public void getSummary(StringBuilder buf) {
         String type = getType();
         buf.append(type);
diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocket.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocket.java
index 16c3776ed6..a421cf0965 100644
--- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocket.java
+++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PServerSocket.java
@@ -42,6 +42,7 @@ public interface I2PServerSocket {
      *  @return null always
      *  @since 0.8.11
      */
+    @Deprecated
     public AcceptingChannel getChannel();
 
     /**
diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java
index c2c3d83704..7c7c0b19cd 100644
--- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java
+++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocket.java
@@ -62,6 +62,7 @@ public interface I2PSocket extends Closeable {
      *  @return null always
      *  @since 0.8.9
      */
+    @Deprecated
     public SelectableChannel getChannel() throws IOException;
 
     /** 
diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java
index 4e6d3b51fa..466c8c88af 100644
--- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java
+++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java
@@ -37,6 +37,7 @@ public class I2PSocketManagerFactory {
      *  Ignored since 0.9.12, cannot be changed via properties.
      *  @deprecated
      */
+    @Deprecated
     public static final String PROP_MANAGER = "i2p.streaming.manager";
 
     /**
diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java
index 81add73881..c862d78603 100644
--- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java
+++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java
@@ -10,4 +10,5 @@ package net.i2p.client.streaming;
  *  @since 0.9.12
  *  @deprecated
  */
+@Deprecated
 public class I2PSocketManagerFull {}
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java
index 36f6ee4dd6..3eb542f5a6 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigNetHelper.java
@@ -149,6 +149,7 @@ public class ConfigNetHelper extends HelperBase {
      *  This isn't updated for the new statuses, but it's commented out in the jsp.
      *  @deprecated unused, to be fixed if needed
      */
+    @Deprecated
     public String getRequireIntroductionsChecked() {
         Status status = _context.commSystem().getStatus();
         switch (status) {
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java
index d97d185a85..904ce26339 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java
@@ -48,9 +48,10 @@ class SummaryRenderer {
      * DOM level 3 load and store support.  Perhaps we can bundle that, or
      * specify who can get it from where, etc.
      *
-     * @deprecated unsed
+     * @deprecated unused
      * @throws UnsupportedOperationException always
      */
+    @Deprecated
     public static synchronized void render(I2PAppContext ctx, OutputStream out, String filename) throws IOException {
         throw new UnsupportedOperationException();
 /*****
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java
index 153b30c7e5..f4fe164e07 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/ConnectionOptions.java
@@ -538,6 +538,7 @@ class ConnectionOptions extends I2PSocketOptionsImpl {
      * @deprecated This doesn't appear to be used.
      * @return receive window size.
      */
+    @Deprecated
     public int getReceiveWindow() { return _receiveWindow; } 
     public void setReceiveWindow(int numMsgs) { _receiveWindow = numMsgs; }
     
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PServerSocketFull.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PServerSocketFull.java
index f00e9039e0..72146038e6 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PServerSocketFull.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PServerSocketFull.java
@@ -45,6 +45,7 @@ class I2PServerSocketFull implements I2PServerSocket {
      *  @return null always
      *  @since 0.8.11
      */
+    @Deprecated
     public synchronized AcceptingChannel getChannel() {
         return null;
     }
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketFull.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketFull.java
index 173190e8c0..6800e8a6ef 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketFull.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketFull.java
@@ -96,6 +96,7 @@ class I2PSocketFull implements I2PSocket {
      *  @return null always
      *  @since 0.8.9
      */
+    @Deprecated
     public synchronized SelectableChannel getChannel() {
         return null;
     }
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketManagerFull.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketManagerFull.java
index 7473bb79c6..3d6c915a13 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketManagerFull.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/I2PSocketManagerFull.java
@@ -168,6 +168,7 @@ public class I2PSocketManagerFull implements I2PSocketManager {
      * @deprecated use 4-arg constructor
      * @throws UnsupportedOperationException always
      */
+    @Deprecated
     public I2PSocketManagerFull() {
         throw new UnsupportedOperationException();
     }
@@ -176,6 +177,7 @@ public class I2PSocketManagerFull implements I2PSocketManager {
      * @deprecated use 4-arg constructor
      * @throws UnsupportedOperationException always
      */
+    @Deprecated
     public void init(I2PAppContext context, I2PSession session, Properties opts, String name) {
         throw new UnsupportedOperationException();
     }
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java
index b6a55d351f..2b26b0aada 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/PacketLocal.java
@@ -66,11 +66,13 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
     /**
      * @deprecated should always return null
      */
+    @Deprecated
     public SessionKey getKeyUsed() { return _keyUsed; }
 
     /**
      * @deprecated I2PSession throws out the tags
      */
+    @Deprecated
     public void setKeyUsed(SessionKey key) {
         if (key != null)
             _log.error("Who is sending tags thru the streaming lib?");
@@ -80,11 +82,13 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
     /**
      * @deprecated should always return null or an empty set
      */
+    @Deprecated
     public Set<SessionTag> getTagsSent() { return Collections.emptySet(); }
 
     /**
      * @deprecated I2PSession throws out the tags
      */
+    @Deprecated
     public void setTagsSent(Set<SessionTag> tags) { 
         if (tags != null && !tags.isEmpty())
             _log.error("Who is sending tags thru the streaming lib? " + tags.size());
diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/RetransmissionTimer.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/RetransmissionTimer.java
index 5ffac1016b..01f04c0836 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/impl/RetransmissionTimer.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/RetransmissionTimer.java
@@ -12,6 +12,7 @@ public class RetransmissionTimer extends SimpleTimer2 {
      *  @deprecated Don't use this to prestart threads, this is no longer a static instance
      *  @return a new instance as of 0.9
      */
+    @Deprecated
     public static final RetransmissionTimer getInstance() {
         return new RetransmissionTimer(I2PAppContext.getGlobalContext(), "RetransmissionTimer");
     }
-- 
GitLab