[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-db/master] Fix Eclipse warnings and update license to 2012.
commit 107d40e9c46b29a3d674ac99bf0715a296062cac
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Fri May 11 15:34:38 2012 +0200
Fix Eclipse warnings and update license to 2012.
Eclipse warnings include import * and unused code.
---
LICENSE | 2 +-
src/org/torproject/ernie/db/ArchiveReader.java | 24 +++++++++--
src/org/torproject/ernie/db/ArchiveWriter.java | 24 +++++++++---
.../ernie/db/BridgeDescriptorParser.java | 19 +++------
.../ernie/db/BridgePoolAssignmentsProcessor.java | 32 +++++++++++----
.../torproject/ernie/db/BridgeSnapshotReader.java | 31 ++++++++++----
.../ernie/db/CachedRelayDescriptorReader.java | 28 ++++++++++---
src/org/torproject/ernie/db/Configuration.java | 21 +++++++---
.../torproject/ernie/db/ExitListDownloader.java | 22 ++++++++---
src/org/torproject/ernie/db/GetTorDownloader.java | 20 +++++++--
src/org/torproject/ernie/db/LockFile.java | 11 ++++-
.../torproject/ernie/db/LoggingConfiguration.java | 16 ++++++--
src/org/torproject/ernie/db/Main.java | 8 ++--
.../ernie/db/RelayDescriptorDownloader.java | 41 ++++++++++++++------
.../torproject/ernie/db/RelayDescriptorParser.java | 32 ++++++++-------
src/org/torproject/ernie/db/RsyncDataProvider.java | 13 +++++-
.../ernie/db/SanitizedBridgesWriter.java | 5 +--
src/org/torproject/ernie/db/TorperfDownloader.java | 18 +++++++--
.../org/torproject/ernie/db/ArchiveReaderTest.java | 11 ++---
.../org/torproject/ernie/db/ArchiveWriterTest.java | 17 +-------
.../ernie/db/BridgeSnapshotReaderTest.java | 11 ++---
.../ernie/db/CachedRelayDescriptorReaderTest.java | 13 +++---
.../ernie/db/SanitizedBridgesWriterTest.java | 11 ++---
23 files changed, 275 insertions(+), 155 deletions(-)
diff --git a/LICENSE b/LICENSE
index 9d632a3..55fcf4a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2010 The Tor Project
+Copyright 2010--2012 The Tor Project
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/src/org/torproject/ernie/db/ArchiveReader.java b/src/org/torproject/ernie/db/ArchiveReader.java
index edf04c3..06abf6c 100644
--- a/src/org/torproject/ernie/db/ArchiveReader.java
+++ b/src/org/torproject/ernie/db/ArchiveReader.java
@@ -1,11 +1,25 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.util.*;
-import java.util.logging.*;
-import org.apache.commons.compress.compressors.bzip2.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.Stack;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
/**
* Read in all files in a given directory and pass buffered readers of
diff --git a/src/org/torproject/ernie/db/ArchiveWriter.java b/src/org/torproject/ernie/db/ArchiveWriter.java
index 0cc983a..1d37edc 100644
--- a/src/org/torproject/ernie/db/ArchiveWriter.java
+++ b/src/org/torproject/ernie/db/ArchiveWriter.java
@@ -1,13 +1,25 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
-import org.apache.commons.codec.binary.*;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.SortedSet;
+import java.util.Stack;
+import java.util.TimeZone;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.codec.binary.Hex;
import org.torproject.descriptor.DescriptorParser;
import org.torproject.descriptor.DescriptorSourceFactory;
import org.torproject.descriptor.impl.DescriptorParseException;
diff --git a/src/org/torproject/ernie/db/BridgeDescriptorParser.java b/src/org/torproject/ernie/db/BridgeDescriptorParser.java
index 95071a3..0be62f7 100644
--- a/src/org/torproject/ernie/db/BridgeDescriptorParser.java
+++ b/src/org/torproject/ernie/db/BridgeDescriptorParser.java
@@ -1,12 +1,12 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
-import org.apache.commons.codec.digest.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.logging.Level;
+import java.util.logging.Logger;
public class BridgeDescriptorParser {
private SanitizedBridgesWriter sbw;
@@ -20,7 +20,6 @@ public class BridgeDescriptorParser {
try {
BufferedReader br = new BufferedReader(new StringReader(
new String(allData, "US-ASCII")));
- boolean skip = false;
String line = br.readLine();
if (line == null) {
return;
@@ -32,12 +31,6 @@ public class BridgeDescriptorParser {
this.sbw.sanitizeAndStoreNetworkStatus(allData, dateTime);
}
}
- int runningBridges = 0;
- while ((line = br.readLine()) != null) {
- if (line.startsWith("s ") && line.contains(" Running")) {
- runningBridges++;
- }
- }
} else if (line.startsWith("router ")) {
if (this.sbw != null) {
if (sanitized) {
diff --git a/src/org/torproject/ernie/db/BridgePoolAssignmentsProcessor.java b/src/org/torproject/ernie/db/BridgePoolAssignmentsProcessor.java
index d2e64ec..c07b786 100644
--- a/src/org/torproject/ernie/db/BridgePoolAssignmentsProcessor.java
+++ b/src/org/torproject/ernie/db/BridgePoolAssignmentsProcessor.java
@@ -1,14 +1,30 @@
-/* Copyright 2011 The Tor Project
+/* Copyright 2011--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
-import org.apache.commons.codec.*;
-import org.apache.commons.codec.binary.*;
-import org.apache.commons.codec.digest.*;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.SortedSet;
+import java.util.Stack;
+import java.util.TimeZone;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
public class BridgePoolAssignmentsProcessor {
diff --git a/src/org/torproject/ernie/db/BridgeSnapshotReader.java b/src/org/torproject/ernie/db/BridgeSnapshotReader.java
index 310029a..1683b58 100644
--- a/src/org/torproject/ernie/db/BridgeSnapshotReader.java
+++ b/src/org/torproject/ernie/db/BridgeSnapshotReader.java
@@ -1,16 +1,29 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.util.*;
-import java.util.logging.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.Stack;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
-import org.apache.commons.codec.binary.*;
-import org.apache.commons.codec.digest.*;
-
-import org.apache.commons.compress.compressors.gzip.*;
-import org.apache.commons.compress.archivers.tar.*;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
+import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
/**
* Reads the half-hourly snapshots of bridge descriptors from Tonga.
diff --git a/src/org/torproject/ernie/db/CachedRelayDescriptorReader.java b/src/org/torproject/ernie/db/CachedRelayDescriptorReader.java
index 29390b7..4da3e44 100644
--- a/src/org/torproject/ernie/db/CachedRelayDescriptorReader.java
+++ b/src/org/torproject/ernie/db/CachedRelayDescriptorReader.java
@@ -1,14 +1,28 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringReader;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.TimeZone;
+import java.util.logging.Level;
+import java.util.logging.Logger;
-import org.apache.commons.codec.binary.*;
-import org.apache.commons.codec.digest.*;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.codec.digest.DigestUtils;
/**
* Parses all descriptors in local directory cacheddesc/ and sorts them
diff --git a/src/org/torproject/ernie/db/Configuration.java b/src/org/torproject/ernie/db/Configuration.java
index 71c9cad..6ab9f44 100644
--- a/src/org/torproject/ernie/db/Configuration.java
+++ b/src/org/torproject/ernie/db/Configuration.java
@@ -1,11 +1,20 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.logging.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
/**
* Initialize configuration with hard-coded defaults, overwrite with
@@ -21,8 +30,6 @@ public class Configuration {
private boolean importDirectoryArchives = false;
private String directoryArchivesDirectory = "archives/";
private boolean keepDirectoryArchiveImportHistory = false;
- private String relayDescriptorDatabaseJdbc =
- "jdbc:postgresql://localhost/tordir?user=ernie&password=password";
private boolean writeSanitizedBridges = false;
private boolean replaceIPAddressesWithHashes = false;
private long limitBridgeDescriptorMappings = -1L;
diff --git a/src/org/torproject/ernie/db/ExitListDownloader.java b/src/org/torproject/ernie/db/ExitListDownloader.java
index 888aa65..82bde11 100644
--- a/src/org/torproject/ernie/db/ExitListDownloader.java
+++ b/src/org/torproject/ernie/db/ExitListDownloader.java
@@ -1,12 +1,22 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.net.*;
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.SortedSet;
+import java.util.Stack;
+import java.util.TimeZone;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
public class ExitListDownloader {
public ExitListDownloader() {
diff --git a/src/org/torproject/ernie/db/GetTorDownloader.java b/src/org/torproject/ernie/db/GetTorDownloader.java
index 91e9f5f..dfcdc16 100644
--- a/src/org/torproject/ernie/db/GetTorDownloader.java
+++ b/src/org/torproject/ernie/db/GetTorDownloader.java
@@ -1,11 +1,21 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.logging.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.SortedMap;
+import java.util.TreeMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
public class GetTorDownloader {
diff --git a/src/org/torproject/ernie/db/LockFile.java b/src/org/torproject/ernie/db/LockFile.java
index c5e75b0..3255620 100644
--- a/src/org/torproject/ernie/db/LockFile.java
+++ b/src/org/torproject/ernie/db/LockFile.java
@@ -1,9 +1,14 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.util.logging.*;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.logging.Logger;
public class LockFile {
diff --git a/src/org/torproject/ernie/db/LoggingConfiguration.java b/src/org/torproject/ernie/db/LoggingConfiguration.java
index 1112748..644a462 100644
--- a/src/org/torproject/ernie/db/LoggingConfiguration.java
+++ b/src/org/torproject/ernie/db/LoggingConfiguration.java
@@ -1,12 +1,20 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.text.*;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
-import java.util.logging.*;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.FileHandler;
+import java.util.logging.Formatter;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
/**
* Initialize logging configuration.
*
diff --git a/src/org/torproject/ernie/db/Main.java b/src/org/torproject/ernie/db/Main.java
index a5b5080..e44eac0 100644
--- a/src/org/torproject/ernie/db/Main.java
+++ b/src/org/torproject/ernie/db/Main.java
@@ -1,10 +1,10 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.util.*;
-import java.util.logging.*;
+import java.io.File;
+import java.util.List;
+import java.util.logging.Logger;
/**
* Coordinate downloading and parsing of descriptors and extraction of
diff --git a/src/org/torproject/ernie/db/RelayDescriptorDownloader.java b/src/org/torproject/ernie/db/RelayDescriptorDownloader.java
index 4b5d729..f7e9468 100644
--- a/src/org/torproject/ernie/db/RelayDescriptorDownloader.java
+++ b/src/org/torproject/ernie/db/RelayDescriptorDownloader.java
@@ -1,16 +1,35 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.net.*;
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
-import java.util.zip.*;
-
-import org.apache.commons.codec.digest.*;
-import org.apache.commons.codec.binary.*;
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.SortedSet;
+import java.util.TimeZone;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.zip.InflaterInputStream;
/**
* Downloads relay descriptors from the directory authorities via HTTP.
@@ -677,8 +696,6 @@ public class RelayDescriptorDownloader {
end += endToken.length();
byte[] descBytes = new byte[end - start];
System.arraycopy(allData, start, descBytes, 0, end - start);
- String digest = Hex.encodeHexString(DigestUtils.sha(
- descBytes));
this.rdp.parse(descBytes);
receivedDescriptors++;
}
diff --git a/src/org/torproject/ernie/db/RelayDescriptorParser.java b/src/org/torproject/ernie/db/RelayDescriptorParser.java
index 3fdd3d8..f3e90f2 100644
--- a/src/org/torproject/ernie/db/RelayDescriptorParser.java
+++ b/src/org/torproject/ernie/db/RelayDescriptorParser.java
@@ -1,13 +1,21 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
-import org.apache.commons.codec.digest.*;
-import org.apache.commons.codec.binary.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.SortedSet;
+import java.util.TimeZone;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.commons.codec.binary.Base64;
+import org.apache.commons.codec.binary.Hex;
+import org.apache.commons.codec.digest.DigestUtils;
/**
* Parses relay descriptors including network status consensuses and
@@ -168,13 +176,8 @@ public class RelayDescriptorParser {
}
}
} else if (line.startsWith("router ")) {
- String publishedLine = null, publishedTime = null,
- extraInfoDigest = null, relayIdentifier = null;
- String[] parts = line.split(" ");
- String nickname = parts[1];
- String address = parts[2];
- int orPort = Integer.parseInt(parts[3]);
- int dirPort = Integer.parseInt(parts[4]);
+ String publishedTime = null, extraInfoDigest = null,
+ relayIdentifier = null;
long published = -1L;
while ((line = br.readLine()) != null) {
if (line.startsWith("published ")) {
@@ -213,7 +216,6 @@ public class RelayDescriptorParser {
} else if (line.startsWith("extra-info ")) {
String publishedTime = null, relayIdentifier = line.split(" ")[2];
long published = -1L;
- boolean skip = false;
while ((line = br.readLine()) != null) {
if (line.startsWith("published ")) {
publishedTime = line.substring("published ".length());
diff --git a/src/org/torproject/ernie/db/RsyncDataProvider.java b/src/org/torproject/ernie/db/RsyncDataProvider.java
index 6c0feae..19cf9a4 100644
--- a/src/org/torproject/ernie/db/RsyncDataProvider.java
+++ b/src/org/torproject/ernie/db/RsyncDataProvider.java
@@ -2,9 +2,16 @@
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.util.*;
-import java.util.logging.*;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.Stack;
+import java.util.logging.Logger;
/**
* Copy files published in the last 3 days to a local directory that can
diff --git a/src/org/torproject/ernie/db/SanitizedBridgesWriter.java b/src/org/torproject/ernie/db/SanitizedBridgesWriter.java
index 7710b82..ff53cf0 100644
--- a/src/org/torproject/ernie/db/SanitizedBridgesWriter.java
+++ b/src/org/torproject/ernie/db/SanitizedBridgesWriter.java
@@ -1,4 +1,4 @@
-/* Copyright 2010 The Tor Project
+/* Copyright 2010--2012 The Tor Project
* See LICENSE for licensing information */
package org.torproject.ernie.db;
@@ -164,8 +164,6 @@ public class SanitizedBridgesWriter {
*/
private File sanitizedBridgesDirectory;
- private File statsDirectory;
-
private boolean replaceIPAddressesWithHashes;
private boolean persistenceProblemWithSecrets;
@@ -194,7 +192,6 @@ public class SanitizedBridgesWriter {
/* Memorize argument values. */
this.sanitizedBridgesDirectory = sanitizedBridgesDirectory;
- this.statsDirectory = statsDirectory;
this.replaceIPAddressesWithHashes = replaceIPAddressesWithHashes;
/* Initialize logger. */
diff --git a/src/org/torproject/ernie/db/TorperfDownloader.java b/src/org/torproject/ernie/db/TorperfDownloader.java
index 48a6ef8..8ee0fe9 100644
--- a/src/org/torproject/ernie/db/TorperfDownloader.java
+++ b/src/org/torproject/ernie/db/TorperfDownloader.java
@@ -2,10 +2,20 @@
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.logging.*;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
/* Download possibly truncated Torperf .data and .extradata files from
* configured sources and append them to the files we already have. */
diff --git a/test/org/torproject/ernie/db/ArchiveReaderTest.java b/test/org/torproject/ernie/db/ArchiveReaderTest.java
index 5779865..cb3dea7 100644
--- a/test/org/torproject/ernie/db/ArchiveReaderTest.java
+++ b/test/org/torproject/ernie/db/ArchiveReaderTest.java
@@ -2,13 +2,12 @@
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import org.torproject.ernie.db.*;
+import java.io.File;
-import java.io.*;
-
-import org.junit.*;
-import org.junit.rules.*;
-import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
public class ArchiveReaderTest {
diff --git a/test/org/torproject/ernie/db/ArchiveWriterTest.java b/test/org/torproject/ernie/db/ArchiveWriterTest.java
index 3ae9abc..2a18e74 100644
--- a/test/org/torproject/ernie/db/ArchiveWriterTest.java
+++ b/test/org/torproject/ernie/db/ArchiveWriterTest.java
@@ -2,26 +2,15 @@
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import org.torproject.ernie.db.*;
-
-import java.io.*;
-
-import org.junit.*;
-import org.junit.rules.*;
-import static org.junit.Assert.*;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
public class ArchiveWriterTest {
- private File tempArchivesDirectory;
-
@Rule
public TemporaryFolder folder = new TemporaryFolder();
- @Before
- public void createTempDirectories() {
- this.tempArchivesDirectory = folder.newFolder("archives");
- }
-
@Test(expected = IllegalArgumentException.class)
public void testArchivesDirectoryNull() {
new ArchiveWriter(null);
diff --git a/test/org/torproject/ernie/db/BridgeSnapshotReaderTest.java b/test/org/torproject/ernie/db/BridgeSnapshotReaderTest.java
index 622462c..f1ad03b 100644
--- a/test/org/torproject/ernie/db/BridgeSnapshotReaderTest.java
+++ b/test/org/torproject/ernie/db/BridgeSnapshotReaderTest.java
@@ -2,13 +2,12 @@
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import org.torproject.ernie.db.*;
+import java.io.File;
-import java.io.*;
-
-import org.junit.*;
-import org.junit.rules.*;
-import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
public class BridgeSnapshotReaderTest {
diff --git a/test/org/torproject/ernie/db/CachedRelayDescriptorReaderTest.java b/test/org/torproject/ernie/db/CachedRelayDescriptorReaderTest.java
index b856fb0..f101249 100644
--- a/test/org/torproject/ernie/db/CachedRelayDescriptorReaderTest.java
+++ b/test/org/torproject/ernie/db/CachedRelayDescriptorReaderTest.java
@@ -2,14 +2,13 @@
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import org.torproject.ernie.db.*;
+import java.io.File;
+import java.util.ArrayList;
-import java.io.*;
-import java.util.*;
-
-import org.junit.*;
-import org.junit.rules.*;
-import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
public class CachedRelayDescriptorReaderTest {
diff --git a/test/org/torproject/ernie/db/SanitizedBridgesWriterTest.java b/test/org/torproject/ernie/db/SanitizedBridgesWriterTest.java
index dd05870..f8b4cdd 100644
--- a/test/org/torproject/ernie/db/SanitizedBridgesWriterTest.java
+++ b/test/org/torproject/ernie/db/SanitizedBridgesWriterTest.java
@@ -2,13 +2,12 @@
* See LICENSE for licensing information */
package org.torproject.ernie.db;
-import org.torproject.ernie.db.*;
+import java.io.File;
-import java.io.*;
-
-import org.junit.*;
-import org.junit.rules.*;
-import static org.junit.Assert.*;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
public class SanitizedBridgesWriterTest {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits