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

Skip to content
Snippets Groups Projects
Commit 817f5316 authored by str4d's avatar str4d
Browse files

merge of '743aa294fa15c3243bb6ad56d4de64f5eff15051'

     and '85fa37bf6c3090c0d4c10f4b7b2d679549090c37'
parents 4910266d 53623da2
No related branches found
No related tags found
No related merge requests found
...@@ -120,11 +120,11 @@ class AddressBook { ...@@ -120,11 +120,11 @@ class AddressBook {
subscription.setLastFetched(I2PAppContext.getGlobalContext().clock().now()); subscription.setLastFetched(I2PAppContext.getGlobalContext().clock().now());
subf = tmp; subf = tmp;
} else { } else {
a = Collections.EMPTY_MAP; a = Collections.emptyMap();
tmp.delete(); tmp.delete();
} }
} catch (IOException ioe) { } catch (IOException ioe) {
a = Collections.EMPTY_MAP; a = Collections.emptyMap();
} }
this.addresses = a; this.addresses = a;
this.subFile = subf; this.subFile = subf;
...@@ -148,7 +148,7 @@ class AddressBook { ...@@ -148,7 +148,7 @@ class AddressBook {
try { try {
a = ConfigParser.parse(file); a = ConfigParser.parse(file);
} catch (IOException exp) { } catch (IOException exp) {
a = new HashMap(); a = new HashMap<String, String>();
} }
this.addresses = a; this.addresses = a;
this.subFile = null; this.subFile = null;
......
...@@ -138,7 +138,8 @@ class ConfigIterator implements Iterator<Map.Entry<String, String>> { ...@@ -138,7 +138,8 @@ class ConfigIterator implements Iterator<Map.Entry<String, String>> {
public boolean equals(Object o) { public boolean equals(Object o) {
if (!(o instanceof Map.Entry)) if (!(o instanceof Map.Entry))
return false; 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()); return key.equals(e.getKey()) && value.equals(e.getValue());
} }
} }
......
...@@ -87,7 +87,7 @@ class ConfigParser { ...@@ -87,7 +87,7 @@ class ConfigParser {
* *
*/ */
public static Map<String, String> parse(BufferedReader input) throws IOException { 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; String inputLine;
inputLine = input.readLine(); inputLine = input.readLine();
while (inputLine != null) { while (inputLine != null) {
...@@ -179,7 +179,7 @@ class ConfigParser { ...@@ -179,7 +179,7 @@ class ConfigParser {
*/ */
public static List<String> parseSubscriptions(BufferedReader input) public static List<String> parseSubscriptions(BufferedReader input)
throws IOException { throws IOException {
List<String> result = new LinkedList(); List<String> result = new LinkedList<String>();
String inputLine = input.readLine(); String inputLine = input.readLine();
while (inputLine != null) { while (inputLine != null) {
inputLine = ConfigParser.stripComments(inputLine).trim(); inputLine = ConfigParser.stripComments(inputLine).trim();
......
...@@ -251,7 +251,7 @@ public class Daemon { ...@@ -251,7 +251,7 @@ public class Daemon {
} }
delay *= 60 * 60 * 1000; 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://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"); defaultSubs.add("http://www.i2p2.i2p/hosts.txt");
...@@ -331,7 +331,7 @@ public class Daemon { ...@@ -331,7 +331,7 @@ public class Daemon {
homeFile = new SecureDirectory(System.getProperty("user.dir")); 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_host", "127.0.0.1");
defaultSettings.put("proxy_port", "4444"); defaultSettings.put("proxy_port", "4444");
defaultSettings.put("master_addressbook", "../userhosts.txt"); defaultSettings.put("master_addressbook", "../userhosts.txt");
......
...@@ -81,7 +81,7 @@ class SubscriptionIterator implements Iterator<AddressBook> { ...@@ -81,7 +81,7 @@ class SubscriptionIterator implements Iterator<AddressBook> {
// DataHelper.formatDuration(I2PAppContext.getGlobalContext().clock().now() - sub.getLastFetched()) + // DataHelper.formatDuration(I2PAppContext.getGlobalContext().clock().now() - sub.getLastFetched()) +
// " ago but the minimum delay is " + // " ago but the minimum delay is " +
// DataHelper.formatDuration(this.delay)); // DataHelper.formatDuration(this.delay));
return new AddressBook(Collections.EMPTY_MAP); return new AddressBook(Collections.<String, String> emptyMap());
} }
} }
......
...@@ -69,7 +69,7 @@ class SubscriptionList { ...@@ -69,7 +69,7 @@ class SubscriptionList {
public SubscriptionList(File locationsFile, File etagsFile, public SubscriptionList(File locationsFile, File etagsFile,
File lastModifiedFile, File lastFetchedFile, long delay, List<String> defaultSubs, String proxyHost, File lastModifiedFile, File lastFetchedFile, long delay, List<String> defaultSubs, String proxyHost,
int proxyPort) { int proxyPort) {
this.subscriptions = new LinkedList(); this.subscriptions = new LinkedList<Subscription>();
this.etagsFile = etagsFile; this.etagsFile = etagsFile;
this.lastModifiedFile = lastModifiedFile; this.lastModifiedFile = lastModifiedFile;
this.lastFetchedFile = lastFetchedFile; this.lastFetchedFile = lastFetchedFile;
...@@ -84,17 +84,17 @@ class SubscriptionList { ...@@ -84,17 +84,17 @@ class SubscriptionList {
try { try {
etags = ConfigParser.parse(etagsFile); etags = ConfigParser.parse(etagsFile);
} catch (IOException exp) { } catch (IOException exp) {
etags = new HashMap(); etags = new HashMap<String, String>();
} }
try { try {
lastModified = ConfigParser.parse(lastModifiedFile); lastModified = ConfigParser.parse(lastModifiedFile);
} catch (IOException exp) { } catch (IOException exp) {
lastModified = new HashMap(); lastModified = new HashMap<String, String>();
} }
try { try {
lastFetched = ConfigParser.parse(lastFetchedFile); lastFetched = ConfigParser.parse(lastFetchedFile);
} catch (IOException exp) { } catch (IOException exp) {
lastFetched = new HashMap(); lastFetched = new HashMap<String, String>();
} }
for (String location : locations) { for (String location : locations) {
this.subscriptions.add(new Subscription(location, etags.get(location), this.subscriptions.add(new Subscription(location, etags.get(location),
...@@ -121,9 +121,9 @@ class SubscriptionList { ...@@ -121,9 +121,9 @@ class SubscriptionList {
* won't be read back correctly; the '=' should be escaped. * won't be read back correctly; the '=' should be escaped.
*/ */
public void write() { public void write() {
Map<String, String> etags = new HashMap(); Map<String, String> etags = new HashMap<String, String>();
Map<String, String> lastModified = new HashMap(); Map<String, String> lastModified = new HashMap<String, String>();
Map<String, String> lastFetched = new HashMap(); Map<String, String> lastFetched = new HashMap<String, String>();
for (Subscription sub : this.subscriptions) { for (Subscription sub : this.subscriptions) {
if (sub.getEtag() != null) { if (sub.getEtag() != null) {
etags.put(sub.getLocation(), sub.getEtag()); 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