remove unused local variables (eclipse)

This commit is contained in:
zzz
2012-03-25 22:16:03 +00:00
parent f13956d380
commit 1db58dee89
55 changed files with 23 additions and 127 deletions

View File

@@ -400,7 +400,7 @@ public class DoCMDS implements Runnable {
*/
private boolean is64ok(String data) {
try {
Destination x = new Destination(data);
new Destination(data);
return true;
} catch (Exception e) {
return false;

View File

@@ -59,9 +59,7 @@ class PeerCheckerTask implements Runnable
long worstdownload = Long.MAX_VALUE;
Peer worstDownloader = null;
int peers = 0;
int uploaders = 0;
int downloaders = 0;
int removedCount = 0;
long uploaded = 0;
@@ -84,12 +82,8 @@ class PeerCheckerTask implements Runnable
continue;
}
peers++;
if (!peer.isChoking())
uploaders++;
if (!peer.isChoked() && peer.isInteresting())
downloaders++;
long upload = peer.getUploaded();
uploaded += upload;

View File

@@ -315,8 +315,6 @@ public class Snark
id = generateID();
debug("My peer id: " + PeerID.idencode(id), Snark.INFO);
int port;
IOException lastException = null;
/*
* Don't start a tunnel if the torrent isn't going to be started.
* If we are starting,

View File

@@ -198,8 +198,6 @@ public class TrackerClient extends I2PAppThread
long left = coordinator.getLeft();
boolean completed = (left == 0);
int sleptTime = 0;
try
{
if (!verifyConnected()) return;
@@ -258,8 +256,6 @@ public class TrackerClient extends I2PAppThread
event = NO_EVENT;
// *** loop once for each tracker
// Only do a request when necessary.
sleptTime = 0;
int maxSeenPeers = 0;
for (Iterator iter = trackers.iterator(); iter.hasNext(); ) {
Tracker tr = (Tracker)iter.next();
@@ -308,7 +304,6 @@ public class TrackerClient extends I2PAppThread
// only delay if we actually make an attempt to add peer
if(coordinator.addPeer(cur) && it.hasNext()) {
int delay = (DELAY_MUL * r.nextInt(10)) + DELAY_MIN;
sleptTime += delay;
try { Thread.sleep(delay); } catch (InterruptedException ie) {}
}
}

View File

@@ -495,7 +495,6 @@ public class I2PSnarkServlet extends DefaultServlet {
// return;
//}
if ("Add".equals(action)) {
String newFile = req.getParameter("newFile");
String newURL = req.getParameter("newURL");
/******
// NOTE - newFile currently disabled in HTML form - see below

View File

@@ -176,7 +176,6 @@ public class I2PTunnelConnectClient extends I2PTunnelHTTPClientBase implements R
in = s.getInputStream();
String line, method = null, host = null, destination = null, restofline = null;
StringBuilder newRequest = new StringBuilder();
int ahelper = 0;
String authorization = null;
while (true) {
// Use this rather than BufferedReader because we can't have readahead,

View File

@@ -320,7 +320,6 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
public static final String PROP_DISABLE_HELPER = "i2ptunnel.httpclient.disableAddressHelper";
protected void clientConnectionRun(Socket s) {
InputStream in = null;
OutputStream out = null;
/**
@@ -941,7 +940,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
I2PSocket i2ps = createI2PSocket(clientDest, getDefaultOptions(opts));
byte[] data = newRequest.toString().getBytes("ISO-8859-1");
Runnable onTimeout = new OnTimeout(s, s.getOutputStream(), targetRequest, usingWWWProxy, currentProxy, requestId);
I2PTunnelRunner runner = new I2PTunnelHTTPClientRunner(s, i2ps, sockLock, data, mySockets, onTimeout);
new I2PTunnelHTTPClientRunner(s, i2ps, sockLock, data, mySockets, onTimeout);
} catch (SocketException ex) {
if (_log.shouldLog(Log.INFO))
_log.info(getPrefix(requestId) + "Error trying to connect", ex);

View File

@@ -131,7 +131,6 @@ public class SOCKS4aServer extends SOCKSServer {
}
protected void confirmConnection() throws SOCKSException {
DataInputStream in;
DataOutputStream out;
try {
out = new DataOutputStream(clientSock.getOutputStream());

View File

@@ -97,7 +97,6 @@ public class SOCKS5Server extends SOCKSServer {
*/
private void init(DataInputStream in, DataOutputStream out) throws IOException, SOCKSException {
int nMethods = in.readUnsignedByte();
boolean methodOk = false;
int method = Method.NO_ACCEPTABLE_METHODS;
for (int i = 0; i < nMethods; ++i) {
@@ -247,7 +246,6 @@ public class SOCKS5Server extends SOCKSServer {
}
protected void confirmConnection() throws SOCKSException {
DataInputStream in;
DataOutputStream out;
try {
out = new DataOutputStream(clientSock.getOutputStream());

View File

@@ -91,11 +91,10 @@ import net.i2p.util.EventDispatcher;
// create i2pclient and destination
I2PClient client = I2PClientFactory.createClient();
Destination destN;
byte[] key;
try {
ByteArrayOutputStream out = new ByteArrayOutputStream(512);
destN = client.createDestination(out);
client.createDestination(out);
key = out.toByteArray();
} catch(Exception exc) {
throw new RuntimeException("failed to create i2p-destination", exc);

View File

@@ -262,7 +262,6 @@ public class ConfigClientsHandler extends FormHandler {
private void saveWebAppChanges() {
Properties props = RouterConsoleRunner.webAppProperties();
Set keys = props.keySet();
int cur = 0;
for (Iterator iter = keys.iterator(); iter.hasNext(); ) {
String name = (String)iter.next();
if (! (name.startsWith(RouterConsoleRunner.PREFIX) && name.endsWith(RouterConsoleRunner.ENABLED)))
@@ -279,7 +278,6 @@ public class ConfigClientsHandler extends FormHandler {
private void savePluginChanges() {
Properties props = PluginStarter.pluginProperties();
Set keys = props.keySet();
int cur = 0;
for (Iterator iter = keys.iterator(); iter.hasNext(); ) {
String name = (String)iter.next();
if (! (name.startsWith(PluginStarter.PREFIX) && name.endsWith(PluginStarter.ENABLED)))

View File

@@ -67,7 +67,6 @@ class ProfileOrganizerRenderer {
int fast = 0;
int reliable = 0;
int integrated = 0;
int failing = 0;
StringBuilder buf = new StringBuilder(16*1024);
buf.append("<h2>").append(_("Peer Profiles")).append("</h2>\n<p>");
buf.append(ngettext("Showing 1 recent profile.", "Showing {0} recent profiles.", order.size())).append('\n');
@@ -101,7 +100,6 @@ class ProfileOrganizerRenderer {
tier = 2;
reliable++;
} else if (_organizer.isFailing(peer)) {
failing++;
} else {
tier = 3;
}

View File

@@ -207,7 +207,6 @@ public class StatsGenerator {
long numPeriods = curRate.getLifetimePeriods();
if (numPeriods > 0) {
double avgFrequency = curRate.getLifetimeEventCount() / (double)numPeriods;
double peakFrequency = curRate.getExtremeEventCount();
buf.append(" (").append(_("Average event count")).append(": ");
buf.append(num(avgFrequency));
buf.append("; ").append(_("Events in peak period")).append(": ");

View File

@@ -141,7 +141,6 @@ class SummaryListener implements RateSummaryListener {
long heartbeat = period*10/1000;
def.addDatasource(_name, "GAUGE", heartbeat, Double.NaN, Double.NaN);
def.addDatasource(_eventName, "GAUGE", heartbeat, 0, Double.NaN);
int steps = 1;
if (_isPersistent) {
_rows = (int) Math.max(MIN_ROWS, Math.min(MAX_ROWS, THREE_MONTHS / period));
} else {

View File

@@ -151,7 +151,7 @@ public class SAMUtils {
* @return Properties with the parsed SAM params
*/
public static Properties parseParams(StringTokenizer tok) throws SAMException {
int pos, nprops = 0, ntoks = tok.countTokens();
int pos, ntoks = tok.countTokens();
String token, param;
Properties props = new Properties();
@@ -175,7 +175,6 @@ public class SAMUtils {
props.setProperty(param, value.toString());
value.setLength(0);
nprops += 1;
}
if (_log.shouldLog(Log.DEBUG)) {

View File

@@ -307,10 +307,7 @@ class Connection {
packet.setFlag(Packet.FLAG_SIGNATURE_REQUESTED);
}
boolean ackOnly = false;
if ( (packet.getSequenceNum() == 0) && (!packet.isFlagSet(Packet.FLAG_SYNCHRONIZE)) ) {
ackOnly = true;
//if (_log.shouldLog(Log.DEBUG))
// _log.debug("No resend for " + packet);
} else {

View File

@@ -335,11 +335,9 @@ class MessageInputStream extends InputStream {
ByteArray cur = _readyDataBlocks.get(0);
byte rv = cur.getData()[cur.getOffset()+_readyDataBlockIndex];
_readyDataBlockIndex++;
boolean removed = false;
if (cur.getValid() <= _readyDataBlockIndex) {
_readyDataBlockIndex = 0;
_readyDataBlocks.remove(0);
removed = true;
}
_readTotal++;
target[offset + i] = rv; // rv < 0 ? rv + 256 : rv

View File

@@ -270,7 +270,6 @@ class Packet {
//_payload = null;
}
public ByteArray acquirePayload() {
ByteArray old = _payload;
_payload = new ByteArray(new byte[Packet.MAX_PAYLOAD_SIZE]);
return _payload;
}

View File

@@ -152,7 +152,6 @@ public class Base64 implements Encoding {
}
private static byte decodeByte( byte b ) throws DecodingException {
byte a = b;
if( b >= 'A' && b <= 'Z' )
b -= 'A';
else if( b >= 'a' && b <= 'z' )

View File

@@ -70,7 +70,6 @@ public class QuotedPrintable implements Encoding {
private static int BUFSIZE = 2;
private String encode( InputStream in ) throws EncodingException, IOException {
StringBuilder out = new StringBuilder();
int l = 0;
int read = 0, buffered = 0, tmp[] = new int[BUFSIZE];
while( true ) {
read = in.available();
@@ -88,7 +87,6 @@ public class QuotedPrintable implements Encoding {
if( c > 32 && c < 127 && c != 61 ) {
out.append( (char)c );
l++;
}
else if( ( c == 32 || c == 9 ) ) {
if( buffered > 0 && ( tmp[0] == 10 || tmp[0] == 13 ) ) {
@@ -96,11 +94,9 @@ public class QuotedPrintable implements Encoding {
* whitespace at end of line
*/
out.append( c == 32 ? "=20" : "=09" );
l += 3;
}
else {
out.append( (char)c );
l++;
}
}
else if( c == 13 && buffered > 0 && tmp[0] == 10 ) {
@@ -108,14 +104,12 @@ public class QuotedPrintable implements Encoding {
buffered--;
for( int j = 1; j < BUFSIZE; j++ )
tmp[j-1] = tmp[j];
l = 0;
}
else {
if( c < 0 || c > 255 ) {
throw new EncodingException( "Encoding supports only values of 0..255." );
}
out.append( HexTable.table[ c ] );
l += 3;
}
}
return out.toString();