CPD Results
The following document contains the results of PMD's CPD 5.3.5.
Duplications
File |
Line |
net/anyflow/lannister/message/InboundMessageStatuses.java |
109 |
net/anyflow/lannister/message/OutboundMessageStatuses.java |
115 |
InboundMessageStatus removed = this.data.remove(key);
if (removed == null) { return null; }
SerializableStringSet clientIds = messageidIndex.get(removed.messageId());
clientIds.remove(removed.clientId());
if (clientIds.size() <= 0) {
messageidIndex.remove(removed.messageId());
}
else {
messageidIndex.put(removed.messageId(), clientIds);
}
SerializableIntegerSet messageIds = clientidIndex.get(removed.clientId());
messageIds.remove(removed.messageId());
if (messageIds.size() <= 0) {
clientidIndex.remove(removed.clientId());
}
else {
clientidIndex.put(removed.clientId(), messageIds);
}
MessageReferenceCounts.INSTANCE.release(removed.messageKey());
if (logger.isDebugEnabled()) {
logger.debug("InboundMessageStatus removed [messageId={}, clientId={}, status=]", removed.messageId(), |
File |
Line |
net/anyflow/lannister/packetreceiver/SubscribeReceiver.java |
53 |
net/anyflow/lannister/packetreceiver/UnsubscribeReceiver.java |
42 |
protected void channelRead0(ChannelHandlerContext ctx, MqttSubscribeMessage msg) throws Exception {
logger.debug("packet incoming [message={}]", msg.toString());
Session session = Session.NEXUS.get(ctx.channel().id());
if (session == null) {
logger.error("None exist session message [message={}]", msg.toString());
ctx.channel().disconnect().addListener(ChannelFutureListener.CLOSE).addListener(fs -> // [MQTT-4.8.0-1]
Plugins.INSTANCE.get(DisconnectEventListener.class).disconnected(new AbnormalDisconnectEventArgs()));
return;
}
session.setLastIncomingTime(new Date());
List<MqttTopicSubscription> topicSubs = msg.payload().topicSubscriptions(); |
File |
Line |
net/anyflow/lannister/packetreceiver/PubAckReceiver.java |
40 |
net/anyflow/lannister/packetreceiver/SubscribeReceiver.java |
53 |
net/anyflow/lannister/packetreceiver/UnsubscribeReceiver.java |
42 |
protected void channelRead0(ChannelHandlerContext ctx, MqttPubAckMessage msg) throws Exception {
logger.debug("packet incoming [message={}]", msg.toString());
Session session = Session.NEXUS.get(ctx.channel().id());
if (session == null) {
logger.error("None exist session message [message={}]", msg.toString());
ctx.channel().disconnect().addListener(ChannelFutureListener.CLOSE).addListener(fs -> // [MQTT-4.8.0-1]
Plugins.INSTANCE.get(DisconnectEventListener.class).disconnected(new AbnormalDisconnectEventArgs()));
return;
}
session.setLastIncomingTime(new Date()); |
File |
Line |
net/anyflow/lannister/client/MqttClient.java |
82 |
net/anyflow/lannister/http/HttpClient.java |
154 |
Class<? extends SocketChannel> socketChannelClass;
if (Literals.NETTY_EPOLL.equals(Settings.INSTANCE.nettyTransportMode())) {
group = new EpollEventLoopGroup(1, new DefaultThreadFactory("client"));
socketChannelClass = EpollSocketChannel.class;
}
else {
group = new NioEventLoopGroup(1, new DefaultThreadFactory("client"));
socketChannelClass = NioSocketChannel.class;
}
bootstrap.group(group).channel(socketChannelClass).handler(new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
if ("mqtts".equalsIgnoreCase(uri.getScheme())) { |