commit f556a2c42c6a50307beb3510b681bd4637d6b30d Author: Karsten Loesing karsten.loesing@gmx.net Date: Wed Jan 18 14:40:09 2012 +0100
Let Eclipse organize the imports. --- .../descriptor/DescriptorSourceFactory.java | 2 +- .../torproject/descriptor/TorperfDataReader.java | 1 - .../descriptor/impl/BandwidthHistoryImpl.java | 1 + .../descriptor/impl/BlockingIteratorImpl.java | 2 +- .../descriptor/impl/BridgeNetworkStatusImpl.java | 1 + .../descriptor/impl/BridgePoolAssignmentImpl.java | 1 + .../descriptor/impl/DescriptorFileImpl.java | 1 + .../torproject/descriptor/impl/DescriptorImpl.java | 1 + .../descriptor/impl/DescriptorRequestImpl.java | 1 + .../descriptor/impl/DirSourceEntryImpl.java | 1 + .../descriptor/impl/DownloadCoordinator.java | 1 + .../descriptor/impl/ExtraInfoDescriptorImpl.java | 3 ++- .../descriptor/impl/NetworkStatusEntryImpl.java | 1 + .../descriptor/impl/NetworkStatusImpl.java | 1 + .../torproject/descriptor/impl/ParseHelper.java | 1 + .../impl/RelayDescriptorDownloaderImpl.java | 1 + .../impl/RelayNetworkStatusConsensusImpl.java | 1 + .../impl/RelayNetworkStatusVoteImpl.java | 1 + .../impl/RelayOrBridgeDescriptorReaderImpl.java | 7 ++++--- .../descriptor/impl/ServerDescriptorImpl.java | 3 ++- .../impl/RelayNetworkStatusConsensusImplTest.java | 15 +++++++++------ .../impl/RelayNetworkStatusVoteImplTest.java | 13 +++++++------ .../descriptor/impl/ServerDescriptorImplTest.java | 16 ++++++++++------ 23 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/src/org/torproject/descriptor/DescriptorSourceFactory.java b/src/org/torproject/descriptor/DescriptorSourceFactory.java index 031eeab..ed2790a 100644 --- a/src/org/torproject/descriptor/DescriptorSourceFactory.java +++ b/src/org/torproject/descriptor/DescriptorSourceFactory.java @@ -2,8 +2,8 @@ * See LICENSE for licensing information */ package org.torproject.descriptor;
-import org.torproject.descriptor.impl.RelayOrBridgeDescriptorReaderImpl; import org.torproject.descriptor.impl.RelayDescriptorDownloaderImpl; +import org.torproject.descriptor.impl.RelayOrBridgeDescriptorReaderImpl;
/* Create descriptor source instances. */ public class DescriptorSourceFactory { diff --git a/src/org/torproject/descriptor/TorperfDataReader.java b/src/org/torproject/descriptor/TorperfDataReader.java index 1257449..c6e6c8d 100644 --- a/src/org/torproject/descriptor/TorperfDataReader.java +++ b/src/org/torproject/descriptor/TorperfDataReader.java @@ -4,7 +4,6 @@ package org.torproject.descriptor;
import java.io.File; import java.util.Iterator; -import org.torproject.descriptor.DescriptorFile;
/* Read Torperf data files from one or more local directories. */ public interface TorperfDataReader { diff --git a/src/org/torproject/descriptor/impl/BandwidthHistoryImpl.java b/src/org/torproject/descriptor/impl/BandwidthHistoryImpl.java index db309b7..3e094ad 100644 --- a/src/org/torproject/descriptor/impl/BandwidthHistoryImpl.java +++ b/src/org/torproject/descriptor/impl/BandwidthHistoryImpl.java @@ -4,6 +4,7 @@ package org.torproject.descriptor.impl;
import java.util.SortedMap; import java.util.TreeMap; + import org.torproject.descriptor.BandwidthHistory;
public class BandwidthHistoryImpl implements BandwidthHistory { diff --git a/src/org/torproject/descriptor/impl/BlockingIteratorImpl.java b/src/org/torproject/descriptor/impl/BlockingIteratorImpl.java index a26c4fb..c023aec 100644 --- a/src/org/torproject/descriptor/impl/BlockingIteratorImpl.java +++ b/src/org/torproject/descriptor/impl/BlockingIteratorImpl.java @@ -2,8 +2,8 @@ * See LICENSE for licensing information */ package org.torproject.descriptor.impl;
-import java.util.LinkedList; import java.util.Iterator; +import java.util.LinkedList; import java.util.NoSuchElementException; import java.util.Queue;
diff --git a/src/org/torproject/descriptor/impl/BridgeNetworkStatusImpl.java b/src/org/torproject/descriptor/impl/BridgeNetworkStatusImpl.java index 714f6ae..a240e1c 100644 --- a/src/org/torproject/descriptor/impl/BridgeNetworkStatusImpl.java +++ b/src/org/torproject/descriptor/impl/BridgeNetworkStatusImpl.java @@ -5,6 +5,7 @@ package org.torproject.descriptor.impl; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.TimeZone; + import org.torproject.descriptor.BridgeNetworkStatus;
/* Contains a bridge network status. */ diff --git a/src/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java b/src/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java index b539dde..946d897 100644 --- a/src/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java +++ b/src/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java @@ -12,6 +12,7 @@ import java.util.List; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; + import org.torproject.descriptor.BridgePoolAssignment;
/* TODO Write a test class. */ diff --git a/src/org/torproject/descriptor/impl/DescriptorFileImpl.java b/src/org/torproject/descriptor/impl/DescriptorFileImpl.java index 6794e3e..29002a5 100644 --- a/src/org/torproject/descriptor/impl/DescriptorFileImpl.java +++ b/src/org/torproject/descriptor/impl/DescriptorFileImpl.java @@ -4,6 +4,7 @@ package org.torproject.descriptor.impl;
import java.io.File; import java.util.List; + import org.torproject.descriptor.Descriptor; import org.torproject.descriptor.DescriptorFile;
diff --git a/src/org/torproject/descriptor/impl/DescriptorImpl.java b/src/org/torproject/descriptor/impl/DescriptorImpl.java index cc0cd6e..7e7abee 100644 --- a/src/org/torproject/descriptor/impl/DescriptorImpl.java +++ b/src/org/torproject/descriptor/impl/DescriptorImpl.java @@ -10,6 +10,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; + import org.torproject.descriptor.Descriptor;
public abstract class DescriptorImpl implements Descriptor { diff --git a/src/org/torproject/descriptor/impl/DescriptorRequestImpl.java b/src/org/torproject/descriptor/impl/DescriptorRequestImpl.java index 6c4d387..6926e59 100644 --- a/src/org/torproject/descriptor/impl/DescriptorRequestImpl.java +++ b/src/org/torproject/descriptor/impl/DescriptorRequestImpl.java @@ -3,6 +3,7 @@ package org.torproject.descriptor.impl;
import java.util.List; + import org.torproject.descriptor.Descriptor; import org.torproject.descriptor.DescriptorRequest;
diff --git a/src/org/torproject/descriptor/impl/DirSourceEntryImpl.java b/src/org/torproject/descriptor/impl/DirSourceEntryImpl.java index 16e0c87..2ee4556 100644 --- a/src/org/torproject/descriptor/impl/DirSourceEntryImpl.java +++ b/src/org/torproject/descriptor/impl/DirSourceEntryImpl.java @@ -7,6 +7,7 @@ import java.io.IOException; import java.io.StringReader; import java.util.SortedSet; import java.util.TreeSet; + import org.torproject.descriptor.DirSourceEntry;
public class DirSourceEntryImpl implements DirSourceEntry { diff --git a/src/org/torproject/descriptor/impl/DownloadCoordinator.java b/src/org/torproject/descriptor/impl/DownloadCoordinator.java index 49654d1..362006d 100644 --- a/src/org/torproject/descriptor/impl/DownloadCoordinator.java +++ b/src/org/torproject/descriptor/impl/DownloadCoordinator.java @@ -10,6 +10,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.SortedMap; + import org.torproject.descriptor.Descriptor; import org.torproject.descriptor.DescriptorRequest; import org.torproject.descriptor.DirSourceEntry; diff --git a/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java b/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java index dc9f521..60ef498 100644 --- a/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java +++ b/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java @@ -11,8 +11,9 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.SortedMap; -import org.torproject.descriptor.ExtraInfoDescriptor; + import org.torproject.descriptor.BandwidthHistory; +import org.torproject.descriptor.ExtraInfoDescriptor;
/* TODO Implement methods to parse the various statistics (other than * bandwidth histories. */ diff --git a/src/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java b/src/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java index 2136810..ef122fe 100644 --- a/src/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java +++ b/src/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java @@ -8,6 +8,7 @@ import java.io.StringReader; import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeSet; + import org.torproject.descriptor.NetworkStatusEntry;
public class NetworkStatusEntryImpl implements NetworkStatusEntry { diff --git a/src/org/torproject/descriptor/impl/NetworkStatusImpl.java b/src/org/torproject/descriptor/impl/NetworkStatusImpl.java index 0a22a0e..d5b73e3 100644 --- a/src/org/torproject/descriptor/impl/NetworkStatusImpl.java +++ b/src/org/torproject/descriptor/impl/NetworkStatusImpl.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.List; import java.util.SortedMap; import java.util.TreeMap; + import org.torproject.descriptor.DirSourceEntry; import org.torproject.descriptor.NetworkStatusEntry;
diff --git a/src/org/torproject/descriptor/impl/ParseHelper.java b/src/org/torproject/descriptor/impl/ParseHelper.java index 6984f6a..8314e23 100644 --- a/src/org/torproject/descriptor/impl/ParseHelper.java +++ b/src/org/torproject/descriptor/impl/ParseHelper.java @@ -8,6 +8,7 @@ import java.util.SortedMap; import java.util.TimeZone; import java.util.TreeMap; import java.util.regex.Pattern; + import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Hex;
diff --git a/src/org/torproject/descriptor/impl/RelayDescriptorDownloaderImpl.java b/src/org/torproject/descriptor/impl/RelayDescriptorDownloaderImpl.java index 168ffd9..6ea81e1 100644 --- a/src/org/torproject/descriptor/impl/RelayDescriptorDownloaderImpl.java +++ b/src/org/torproject/descriptor/impl/RelayDescriptorDownloaderImpl.java @@ -7,6 +7,7 @@ import java.util.Iterator; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; + import org.torproject.descriptor.DescriptorRequest; import org.torproject.descriptor.RelayDescriptorDownloader;
diff --git a/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java b/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java index 09b9df5..bdf6b86 100644 --- a/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java +++ b/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java @@ -14,6 +14,7 @@ import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; + import org.torproject.descriptor.RelayNetworkStatusConsensus;
/* Contains a network status consensus. */ diff --git a/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java b/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java index e10e1f4..1e6f300 100644 --- a/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java +++ b/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java @@ -14,6 +14,7 @@ import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; + import org.torproject.descriptor.RelayNetworkStatusVote;
/* Contains a network status vote. */ diff --git a/src/org/torproject/descriptor/impl/RelayOrBridgeDescriptorReaderImpl.java b/src/org/torproject/descriptor/impl/RelayOrBridgeDescriptorReaderImpl.java index 63d7507..1a686f4 100644 --- a/src/org/torproject/descriptor/impl/RelayOrBridgeDescriptorReaderImpl.java +++ b/src/org/torproject/descriptor/impl/RelayOrBridgeDescriptorReaderImpl.java @@ -7,8 +7,8 @@ import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileReader; import java.io.FileInputStream; +import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; @@ -19,11 +19,12 @@ import java.util.Map; import java.util.SortedMap; import java.util.Stack; import java.util.TreeMap; + +import org.torproject.descriptor.BridgeDescriptorReader; +import org.torproject.descriptor.BridgePoolAssignmentReader; import org.torproject.descriptor.Descriptor; import org.torproject.descriptor.DescriptorFile; import org.torproject.descriptor.RelayDescriptorReader; -import org.torproject.descriptor.BridgeDescriptorReader; -import org.torproject.descriptor.BridgePoolAssignmentReader;
public class RelayOrBridgeDescriptorReaderImpl implements RelayDescriptorReader, BridgeDescriptorReader, diff --git a/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java b/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java index b17782f..47e6166 100644 --- a/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java +++ b/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java @@ -10,8 +10,9 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; -import org.torproject.descriptor.ServerDescriptor; + import org.torproject.descriptor.BandwidthHistory; +import org.torproject.descriptor.ServerDescriptor;
/* Contains a relay server descriptor. */ public class ServerDescriptorImpl extends DescriptorImpl diff --git a/test/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java b/test/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java index d5bfd3a..5296512 100644 --- a/test/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java +++ b/test/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java @@ -2,14 +2,17 @@ * See LICENSE for licensing information */ package org.torproject.descriptor.impl;
-import org.torproject.descriptor.RelayNetworkStatusConsensus; -import org.torproject.descriptor.impl.RelayNetworkStatusConsensusImpl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue;
-import java.util.*; +import java.util.ArrayList; +import java.util.List;
-import org.junit.*; -import org.junit.rules.*; -import static org.junit.Assert.*; +import org.junit.Test; +import org.torproject.descriptor.RelayNetworkStatusConsensus;
/* TODO Add test cases for all lines starting with "opt ". */
diff --git a/test/org/torproject/descriptor/impl/RelayNetworkStatusVoteImplTest.java b/test/org/torproject/descriptor/impl/RelayNetworkStatusVoteImplTest.java index ffacc9f..20aa2da 100644 --- a/test/org/torproject/descriptor/impl/RelayNetworkStatusVoteImplTest.java +++ b/test/org/torproject/descriptor/impl/RelayNetworkStatusVoteImplTest.java @@ -2,14 +2,15 @@ * See LICENSE for licensing information */ package org.torproject.descriptor.impl;
-import org.torproject.descriptor.RelayNetworkStatusVote; -import org.torproject.descriptor.impl.RelayNetworkStatusVoteImpl; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue;
-import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List;
-import org.junit.*; -import org.junit.rules.*; -import static org.junit.Assert.*; +import org.junit.Test; +import org.torproject.descriptor.RelayNetworkStatusVote;
/* TODO Add test cases for all lines starting with "opt ". */
diff --git a/test/org/torproject/descriptor/impl/ServerDescriptorImplTest.java b/test/org/torproject/descriptor/impl/ServerDescriptorImplTest.java index 6a3ba3a..aac01a8 100644 --- a/test/org/torproject/descriptor/impl/ServerDescriptorImplTest.java +++ b/test/org/torproject/descriptor/impl/ServerDescriptorImplTest.java @@ -2,14 +2,18 @@ * See LICENSE for licensing information */ package org.torproject.descriptor.impl;
-import org.torproject.descriptor.BandwidthHistory; -import org.torproject.descriptor.ServerDescriptor; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue;
-import java.util.*; +import java.util.Arrays; +import java.util.SortedMap;
-import org.junit.*; -import org.junit.rules.*; -import static org.junit.Assert.*; +import org.junit.Test; +import org.torproject.descriptor.BandwidthHistory; +import org.torproject.descriptor.ServerDescriptor;
/* Test parsing of relay server descriptors. */ public class ServerDescriptorImplTest {
tor-commits@lists.torproject.org