diff --git a/broker/src/main/java/io/moquette/broker/MemorySubscriptionsRepository.java b/broker/src/main/java/io/moquette/broker/MemorySubscriptionsRepository.java index 94bd7212..ced9d784 100644 --- a/broker/src/main/java/io/moquette/broker/MemorySubscriptionsRepository.java +++ b/broker/src/main/java/io/moquette/broker/MemorySubscriptionsRepository.java @@ -2,13 +2,14 @@ package io.moquette.broker; import io.moquette.spi.impl.subscriptions.Subscription; +import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; public class MemorySubscriptionsRepository implements ISubscriptionsRepository { - private final List subscriptions = new LinkedList<>(); + private final List subscriptions = new ArrayList<>(); @Override public List listAllSubscriptions() { diff --git a/broker/src/main/java/io/moquette/broker/Session.java b/broker/src/main/java/io/moquette/broker/Session.java index 29a62ea2..5a13ff8e 100644 --- a/broker/src/main/java/io/moquette/broker/Session.java +++ b/broker/src/main/java/io/moquette/broker/Session.java @@ -20,7 +20,7 @@ class Session { private static final int FLIGHT_BEFORE_RESEND_MS = 5_000; private static final int INFLIGHT_WINDOW_SIZE = 10; - class InFlightPacket implements Delayed { + static class InFlightPacket implements Delayed { final int packetId; private long startTime; diff --git a/broker/src/main/java/io/moquette/server/netty/AutoFlushHandler.java b/broker/src/main/java/io/moquette/server/netty/AutoFlushHandler.java index e2ef93c8..75af863c 100644 --- a/broker/src/main/java/io/moquette/server/netty/AutoFlushHandler.java +++ b/broker/src/main/java/io/moquette/server/netty/AutoFlushHandler.java @@ -49,7 +49,7 @@ public class AutoFlushHandler extends ChannelDuplexHandler { } @Override - public void handlerAdded(ChannelHandlerContext ctx) { + public void handlerAdded(ChannelHandlerContext ctx) throws Exception { if (ctx.channel().isActive() && ctx.channel().isRegistered()) { // channelActive() event has been fired already, which means this.channelActive() will // not be invoked. We have to initialize here instead. @@ -141,10 +141,8 @@ public class AutoFlushHandler extends ChannelDuplexHandler { * * @param ctx * 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); if (LOG.isDebugEnabled()) { LOG.debug("Flushing idle Netty channel {} Cid: {}", ctx.channel(), NettyUtils.clientID(ctx.channel()));