Remove volatile from field as its not needed.

Motivation:

We not need to mark the field as volatile and so this may confuse people.

Modifications:

Remove volatile and add comment to explain why its not needed.

Result:

More correct example.
This commit is contained in:
Norman Maurer 2016-08-08 20:55:51 +02:00
parent be77dfb1ca
commit 979d775f5f

View File

@ -29,7 +29,9 @@ public class HexDumpProxyFrontendHandler extends ChannelInboundHandlerAdapter {
private final String remoteHost;
private final int remotePort;
private volatile Channel outboundChannel;
// As we use inboundChannel.eventLoop() when buildling the Bootstrap this does not need to be volatile as
// the outboundChannel will use the same EventLoop (and therefore Thread) as the inboundChannel.
private Channel outboundChannel;
public HexDumpProxyFrontendHandler(String remoteHost, int remotePort) {
this.remoteHost = remoteHost;