Author: toad
Date: 2007-06-30 12:00:46 +0000 (Sat, 30 Jun 2007)
New Revision: 13842

Modified:
   trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
   trunk/freenet/src/freenet/node/NodeIPDetector.java
Log:
Fix NPEs

Modified: trunk/freenet/src/freenet/node/IPDetectorPluginManager.java
===================================================================
--- trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2007-06-30 
01:21:28 UTC (rev 13841)
+++ trunk/freenet/src/freenet/node/IPDetectorPluginManager.java 2007-06-30 
12:00:46 UTC (rev 13842)
@@ -91,7 +91,6 @@

        static boolean logMINOR;
        private final NodeIPDetector detector;
-       private final Ticker ticker;
        private final Node node;
        FredPluginIPDetector[] plugins;
        private final MyUserAlert noConnectionAlert;
@@ -106,7 +105,6 @@
                logMINOR = Logger.shouldLog(Logger.MINOR, getClass());
                plugins = new FredPluginIPDetector[0];
                this.node = node;
-               this.ticker = node.ps;
                this.detector = detector;
                noConnectionAlert = new MyUserAlert( 
l10n("noConnectivityTitle"), l10n("noConnectivity"), 
                                true, UserAlert.ERROR);
@@ -152,7 +150,7 @@
                } catch (Throwable t) {
                        Logger.error(this, "Caught "+t, t);
                }
-               ticker.queueTimedJob(new Runnable() {
+               node.getTicker().queueTimedJob(new Runnable() {
                        public void run() {
                                tryMaybeRun();
                        }

Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java  2007-06-30 01:21:28 UTC 
(rev 13841)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java  2007-06-30 12:00:46 UTC 
(rev 13842)
@@ -32,7 +32,6 @@
        /** Parent node */
        final Node node;
        /** Ticker */
-       final Ticker ticker;
        /** Explicit forced IP address */
        FreenetInetAddress overrideIPAddress;
        /** IP address from last time */
@@ -64,7 +63,6 @@

        public NodeIPDetector(Node node) {
                this.node = node;
-               this.ticker = node.ps;
                ipDetectorManager = new IPDetectorPluginManager(node, this);
                ipDetector = new IPAddressDetector(10*1000, this);
                primaryIPUndetectedAlert = new IPUndetectedUserAlert(node);
@@ -398,7 +396,7 @@
                t.start();
                redetectAddress();
                // 60 second delay for inserting ARK to avoid reinserting more 
than necessary if we don't detect IP on startup.
-               ticker.queueTimedJob(new FastRunnable() {
+               node.getTicker().queueTimedJob(new FastRunnable() {
                        public void run() {
                                NodeIPPortDetector[] detectors;
                                synchronized(this) {


Reply via email to