[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [ernie/master 2/3] Fix a few Eclipse warnings.
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Thu, 11 Mar 2010 14:14:19 +0100
Subject: Fix a few Eclipse warnings.
Commit: f2e40738afd5e17492c58c8712d2658a34791d8b
---
src/BridgeSnapshotReader.java | 3 +--
src/BridgeStatsFileHandler.java | 2 +-
src/CachedRelayDescriptorReader.java | 5 +++--
src/DirreqStatsFileHandler.java | 2 +-
src/RelayDescriptorDownloader.java | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/BridgeSnapshotReader.java b/src/BridgeSnapshotReader.java
index fe9e4ed..50a9978 100644
--- a/src/BridgeSnapshotReader.java
+++ b/src/BridgeSnapshotReader.java
@@ -55,12 +55,11 @@ public class BridgeSnapshotReader {
TarArchiveInputStream tais = new TarArchiveInputStream(gcis);
InputStreamReader isr = new InputStreamReader(tais);
BufferedReader br = new BufferedReader(isr);
- TarArchiveEntry en = null;
String fn = pop.getName();
String dateTime = fn.substring(11, 21) + " "
+ fn.substring(22, 24) + ":" + fn.substring(24, 26)
+ ":" + fn.substring(26, 28);
- while ((en = tais.getNextTarEntry()) != null) {
+ while ((tais.getNextTarEntry()) != null) {
bdp.parse(br, dateTime, false);
}
}
diff --git a/src/BridgeStatsFileHandler.java b/src/BridgeStatsFileHandler.java
index 8bc8fac..577a3cb 100644
--- a/src/BridgeStatsFileHandler.java
+++ b/src/BridgeStatsFileHandler.java
@@ -338,7 +338,7 @@ public class BridgeStatsFileHandler {
> lastDateMillis) {
lastDateMillis += 24L * 60L * 60L * 1000L;
bw.append(dateFormat.format(new Date(lastDateMillis)));
- for (String c : this.countries) {
+ for (int i = 0; i < this.countries.size(); i++) {
bw.append(",NA");
}
bw.append("\n");
diff --git a/src/CachedRelayDescriptorReader.java b/src/CachedRelayDescriptorReader.java
index 4288abf..28a979c 100644
--- a/src/CachedRelayDescriptorReader.java
+++ b/src/CachedRelayDescriptorReader.java
@@ -1,7 +1,7 @@
import java.io.*;
import java.text.*;
import java.util.logging.*;
-import org.apache.commons.codec.digest.*;
+//import org.apache.commons.codec.digest.*; TODO currently unused
/**
* Parses all descriptors in local directory cacheddesc/ and sorts them
@@ -62,10 +62,11 @@ public class CachedRelayDescriptorReader {
break;
}
end += endToken.length();
- String desc = ascii.substring(start, end);
+ /* String desc = ascii.substring(start, end);
byte[] forDigest = new byte[sig - start];
System.arraycopy(allData, start, forDigest, 0, sig - start);
String digest = DigestUtils.shaHex(forDigest);
+ TODO this stuff is unused? */
byte[] descBytes = new byte[end - start];
System.arraycopy(allData, start, descBytes, 0, end - start);
if (aw != null) {
diff --git a/src/DirreqStatsFileHandler.java b/src/DirreqStatsFileHandler.java
index 347d189..17bdc19 100644
--- a/src/DirreqStatsFileHandler.java
+++ b/src/DirreqStatsFileHandler.java
@@ -185,7 +185,7 @@ public class DirreqStatsFileHandler {
lastDateMillis += 24L * 60L * 60L * 1000L;
bw.append(currentDirectory + ","
+ dateFormat.format(new Date(lastDateMillis)));
- for (String country : this.countries) {
+ for (int i = 0; i < this.countries.size(); i++) {
bw.append(",NA");
}
bw.append(",NA\n");
diff --git a/src/RelayDescriptorDownloader.java b/src/RelayDescriptorDownloader.java
index 68f8d3d..a3bc7d3 100644
--- a/src/RelayDescriptorDownloader.java
+++ b/src/RelayDescriptorDownloader.java
@@ -65,7 +65,7 @@ public class RelayDescriptorDownloader {
digest = DigestUtils.shaHex(noSig);
// TODO UTF-8 may be wrong, but we don't care about the fields
// containing non-ASCII
- String result = new String(allData, "UTF-8");
+ // String result = new String(allData, "UTF-8"); TODO
boolean verified = false;
if (url.contains("/tor/server/d/") ||
url.contains("/tor/extra/d/")) {
--
1.6.5