diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/MultiSource.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/MultiSource.java index 5c5a08027ecdc257c911ec3ac4ce46957827ba97..0bb6400ec84470a8823193da6504b61b9aec9e9e 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/MultiSource.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/MultiSource.java @@ -1,8 +1,3 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package net.i2p.i2ptunnel.streamr; import java.util.concurrent.CopyOnWriteArrayList; @@ -17,6 +12,7 @@ import net.i2p.i2ptunnel.udp.*; * @author zzz modded for I2PTunnel */ public class MultiSource implements Source, Sink { + public MultiSource() { this.sinks = new CopyOnWriteArrayList<Destination>(); } @@ -45,20 +41,6 @@ public class MultiSource implements Source, Sink { this.sinks.remove(sink); } - - - - - - - - - - - - - - private Sink sink; - private List<Destination> sinks; + private final List<Destination> sinks; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Pinger.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Pinger.java index 695e0e25affcf83977c5ef1366e0b1ea0732fd23..dd7f5642d460e27fa04420d135659a3cb8fdab19 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Pinger.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Pinger.java @@ -7,9 +7,11 @@ import net.i2p.i2ptunnel.udp.*; * @author welterde/zzz */ public class Pinger implements Source, Runnable { + public Pinger() { this.thread = new Thread(this); } + public void setSink(Sink sink) { this.sink = sink; } @@ -53,7 +55,7 @@ public class Pinger implements Source, Runnable { } protected Sink sink; - protected Thread thread; + protected final Thread thread; private final Object waitlock = new Object(); - protected boolean running; + protected volatile boolean running; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/StreamrConsumer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/StreamrConsumer.java index 9c1d584ae04e22c58050d7d723b8ad1b6ec5d861..49b314b3300d52c2cd9f61f831a37a2114ed212b 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/StreamrConsumer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/StreamrConsumer.java @@ -1,8 +1,3 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package net.i2p.i2ptunnel.streamr; import java.net.InetAddress; @@ -52,16 +47,7 @@ public class StreamrConsumer extends I2PTunnelUDPClientBase { this.sink.stop(); return super.close(forced); } - - - - - - - - - - private UDPSink sink; - private Pinger pinger; + private final UDPSink sink; + private final Pinger pinger; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/StreamrProducer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/StreamrProducer.java index 7d6b14491d4ced129e53b983ad8172a49525bba0..cef5bf1d13b3a0c70d4f6951b5001ba165de3b78 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/StreamrProducer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/StreamrProducer.java @@ -1,14 +1,7 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package net.i2p.i2ptunnel.streamr; -// system import java.io.File; -// i2p import net.i2p.i2ptunnel.I2PTunnel; import net.i2p.i2ptunnel.Logging; import net.i2p.i2ptunnel.udp.*; @@ -57,17 +50,8 @@ public class StreamrProducer extends I2PTunnelUDPServerBase { this.multi.stop(); return super.close(forced); } - - - - - - - - - - private MultiSource multi; - private UDPSource server; - private Sink subscriber; + private final MultiSource multi; + private final UDPSource server; + private final Sink subscriber; } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Subscriber.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Subscriber.java index 8dfcbb3cb1dbe88f488014df85d75b01270a230d..300832a2f58afa737e474da52cd8c6e64dbcd83c 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Subscriber.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/streamr/Subscriber.java @@ -1,11 +1,5 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - package net.i2p.i2ptunnel.streamr; -// system import java.util.Set; import net.i2p.data.Destination; @@ -51,15 +45,6 @@ public class Subscriber implements Sink { } } - - - - - - - - - - private Set<Destination> subscriptions; - private MultiSource multi; + private final Set<Destination> subscriptions; + private final MultiSource multi; }