I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 53623da2 authored by str4d's avatar str4d
Browse files

addressbook: type arguments, unused imports

parent 24ae66df
No related branches found
No related tags found
No related merge requests found
......@@ -120,11 +120,11 @@ class AddressBook {
subscription.setLastFetched(I2PAppContext.getGlobalContext().clock().now());
subf = tmp;
} else {
a = Collections.EMPTY_MAP;
a = Collections.emptyMap();
tmp.delete();
}
} catch (IOException ioe) {
a = Collections.EMPTY_MAP;
a = Collections.emptyMap();
}
this.addresses = a;
this.subFile = subf;
......@@ -148,7 +148,7 @@ class AddressBook {
try {
a = ConfigParser.parse(file);
} catch (IOException exp) {
a = new HashMap();
a = new HashMap<String, String>();
}
this.addresses = a;
this.subFile = null;
......
......@@ -138,7 +138,8 @@ class ConfigIterator implements Iterator<Map.Entry<String, String>> {
public boolean equals(Object o) {
if (!(o instanceof Map.Entry))
return false;
Map.Entry e = (Map.Entry) o;
@SuppressWarnings("unchecked")
Map.Entry<Object, Object> e = (Map.Entry<Object, Object>) o;
return key.equals(e.getKey()) && value.equals(e.getValue());
}
}
......
......@@ -87,7 +87,7 @@ class ConfigParser {
*
*/
public static Map<String, String> parse(BufferedReader input) throws IOException {
Map<String, String> result = new HashMap();
Map<String, String> result = new HashMap<String, String>();
String inputLine;
inputLine = input.readLine();
while (inputLine != null) {
......@@ -179,7 +179,7 @@ class ConfigParser {
*/
public static List<String> parseSubscriptions(BufferedReader input)
throws IOException {
List<String> result = new LinkedList();
List<String> result = new LinkedList<String>();
String inputLine = input.readLine();
while (inputLine != null) {
inputLine = ConfigParser.stripComments(inputLine).trim();
......
......@@ -251,7 +251,7 @@ public class Daemon {
}
delay *= 60 * 60 * 1000;
List<String> defaultSubs = new LinkedList();
List<String> defaultSubs = new LinkedList<String>();
// defaultSubs.add("http://i2p/NF2RLVUxVulR3IqK0sGJR0dHQcGXAzwa6rEO4WAWYXOHw-DoZhKnlbf1nzHXwMEJoex5nFTyiNMqxJMWlY54cvU~UenZdkyQQeUSBZXyuSweflUXFqKN-y8xIoK2w9Ylq1k8IcrAFDsITyOzjUKoOPfVq34rKNDo7fYyis4kT5bAHy~2N1EVMs34pi2RFabATIOBk38Qhab57Umpa6yEoE~rbyR~suDRvD7gjBvBiIKFqhFueXsR2uSrPB-yzwAGofTXuklofK3DdKspciclTVzqbDjsk5UXfu2nTrC1agkhLyqlOfjhyqC~t1IXm-Vs2o7911k7KKLGjB4lmH508YJ7G9fLAUyjuB-wwwhejoWqvg7oWvqo4oIok8LG6ECR71C3dzCvIjY2QcrhoaazA9G4zcGMm6NKND-H4XY6tUWhpB~5GefB3YczOqMbHq4wi0O9MzBFrOJEOs3X4hwboKWANf7DT5PZKJZ5KorQPsYRSq0E3wSOsFCSsdVCKUGsAAAA/i2p/hosts.txt");
defaultSubs.add("http://www.i2p2.i2p/hosts.txt");
......@@ -331,7 +331,7 @@ public class Daemon {
homeFile = new SecureDirectory(System.getProperty("user.dir"));
}
Map<String, String> defaultSettings = new HashMap();
Map<String, String> defaultSettings = new HashMap<String, String>();
defaultSettings.put("proxy_host", "127.0.0.1");
defaultSettings.put("proxy_port", "4444");
defaultSettings.put("master_addressbook", "../userhosts.txt");
......
......@@ -81,7 +81,7 @@ class SubscriptionIterator implements Iterator<AddressBook> {
// DataHelper.formatDuration(I2PAppContext.getGlobalContext().clock().now() - sub.getLastFetched()) +
// " ago but the minimum delay is " +
// DataHelper.formatDuration(this.delay));
return new AddressBook(Collections.EMPTY_MAP);
return new AddressBook(Collections.<String, String> emptyMap());
}
}
......
......@@ -69,7 +69,7 @@ class SubscriptionList {
public SubscriptionList(File locationsFile, File etagsFile,
File lastModifiedFile, File lastFetchedFile, long delay, List<String> defaultSubs, String proxyHost,
int proxyPort) {
this.subscriptions = new LinkedList();
this.subscriptions = new LinkedList<Subscription>();
this.etagsFile = etagsFile;
this.lastModifiedFile = lastModifiedFile;
this.lastFetchedFile = lastFetchedFile;
......@@ -84,17 +84,17 @@ class SubscriptionList {
try {
etags = ConfigParser.parse(etagsFile);
} catch (IOException exp) {
etags = new HashMap();
etags = new HashMap<String, String>();
}
try {
lastModified = ConfigParser.parse(lastModifiedFile);
} catch (IOException exp) {
lastModified = new HashMap();
lastModified = new HashMap<String, String>();
}
try {
lastFetched = ConfigParser.parse(lastFetchedFile);
} catch (IOException exp) {
lastFetched = new HashMap();
lastFetched = new HashMap<String, String>();
}
for (String location : locations) {
this.subscriptions.add(new Subscription(location, etags.get(location),
......@@ -121,9 +121,9 @@ class SubscriptionList {
* won't be read back correctly; the '=' should be escaped.
*/
public void write() {
Map<String, String> etags = new HashMap();
Map<String, String> lastModified = new HashMap();
Map<String, String> lastFetched = new HashMap();
Map<String, String> etags = new HashMap<String, String>();
Map<String, String> lastModified = new HashMap<String, String>();
Map<String, String> lastFetched = new HashMap<String, String>();
for (Subscription sub : this.subscriptions) {
if (sub.getEtag() != null) {
etags.put(sub.getLocation(), sub.getEtag());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment