Minor, fixed code style

This commit is contained in:
andsel
2018-11-10 14:37:14 +01:00
parent dd8bad7480
commit 11bb0c6fa1
3 changed files with 5 additions and 6 deletions
@@ -2,13 +2,14 @@ package io.moquette.broker;
import io.moquette.spi.impl.subscriptions.Subscription; import io.moquette.spi.impl.subscriptions.Subscription;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
public class MemorySubscriptionsRepository implements ISubscriptionsRepository { public class MemorySubscriptionsRepository implements ISubscriptionsRepository {
private final List<Subscription> subscriptions = new LinkedList<>(); private final List<Subscription> subscriptions = new ArrayList<>();
@Override @Override
public List<Subscription> listAllSubscriptions() { public List<Subscription> listAllSubscriptions() {
@@ -20,7 +20,7 @@ class Session {
private static final int FLIGHT_BEFORE_RESEND_MS = 5_000; private static final int FLIGHT_BEFORE_RESEND_MS = 5_000;
private static final int INFLIGHT_WINDOW_SIZE = 10; private static final int INFLIGHT_WINDOW_SIZE = 10;
class InFlightPacket implements Delayed { static class InFlightPacket implements Delayed {
final int packetId; final int packetId;
private long startTime; private long startTime;
@@ -49,7 +49,7 @@ public class AutoFlushHandler extends ChannelDuplexHandler {
} }
@Override @Override
public void handlerAdded(ChannelHandlerContext ctx) { public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
if (ctx.channel().isActive() && ctx.channel().isRegistered()) { if (ctx.channel().isActive() && ctx.channel().isRegistered()) {
// channelActive() event has been fired already, which means this.channelActive() will // channelActive() event has been fired already, which means this.channelActive() will
// not be invoked. We have to initialize here instead. // not be invoked. We have to initialize here instead.
@@ -141,10 +141,8 @@ public class AutoFlushHandler extends ChannelDuplexHandler {
* *
* @param ctx * @param ctx
* the channel context. * the channel context.
* @throws Exception
* in case of any IO error.
*/ */
protected void channelIdle(ChannelHandlerContext ctx/* , IdleStateEvent evt */) { private void channelIdle(ChannelHandlerContext ctx) {
// ctx.fireUserEventTriggered(evt); // ctx.fireUserEventTriggered(evt);
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("Flushing idle Netty channel {} Cid: {}", ctx.channel(), NettyUtils.clientID(ctx.channel())); LOG.debug("Flushing idle Netty channel {} Cid: {}", ctx.channel(), NettyUtils.clientID(ctx.channel()));