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

Skip to content
Snippets Groups Projects
Commit 4c2c198c authored by zzz's avatar zzz
Browse files

cleanup

parent 51899e9e
No related branches found
No related tags found
No related merge requests found
......@@ -9,19 +9,19 @@ class ContextHelper {
/** @throws IllegalStateException if no context available */
public static RouterContext getContext(String contextId) {
List contexts = RouterContext.listContexts();
List<RouterContext> contexts = RouterContext.listContexts();
if ( (contexts == null) || (contexts.isEmpty()) )
throw new IllegalStateException("No contexts. This is usually because the router is either starting up or shutting down.");
if ( (contextId == null) || (contextId.trim().length() <= 0) )
return (RouterContext)contexts.get(0);
return contexts.get(0);
for (int i = 0; i < contexts.size(); i++) {
RouterContext context = (RouterContext)contexts.get(i);
RouterContext context = contexts.get(i);
Hash hash = context.routerHash();
if (hash == null) continue;
if (hash.toBase64().startsWith(contextId))
return context;
}
// not found, so just give them the first we can find
return (RouterContext)contexts.get(0);
return contexts.get(0);
}
}
......@@ -52,7 +52,7 @@ public class StatSummarizer implements Runnable {
private Thread _thread;
public StatSummarizer() {
_context = (RouterContext)RouterContext.listContexts().get(0); // fuck it, only summarize one per jvm
_context = RouterContext.listContexts().get(0); // fuck it, only summarize one per jvm
_log = _context.logManager().getLog(getClass());
_listeners = new CopyOnWriteArrayList();
_instance = this;
......
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