Fixed netty & checkstyle failures
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / connection / AbstractOutboundQueueManager.java
index fdcc1f3e1826a5502529bccef5a3e9942c349ca8..34df0170b4f34692f9225f757585d0ffbf846613 100644 (file)
@@ -279,12 +279,12 @@ abstract class AbstractOutboundQueueManager<T extends OutboundQueueHandler, O ex
     /* NPE are coming from {@link OFEncoder#encode} from catch block and we don't wish to lost it */
     private static final GenericFutureListener<Future<Void>> LOG_ENCODER_LISTENER = new GenericFutureListener<Future<Void>>() {
 
-        private final Logger LOGGER = LoggerFactory.getLogger("LogEncoderListener");
+        private final Logger LOG = LoggerFactory.getLogger(GenericFutureListener.class);
 
         @Override
         public void operationComplete(final Future<Void> future) throws Exception {
             if (future.cause() != null) {
-                LOGGER.warn("Message encoding fail !", future.cause());
+                LOG.warn("Message encoding fail !", future.cause());
             }
         }
     };
@@ -299,12 +299,14 @@ abstract class AbstractOutboundQueueManager<T extends OutboundQueueHandler, O ex
             LOG.trace("Dequeuing messages to channel {}", parent.getChannel());
             writeAndFlush();
             rescheduleFlush();
-        } else if (currentQueue.finishShutdown()) {
-            close();
-            LOG.debug("Channel {} shutdown complete", parent.getChannel());
         } else {
-            LOG.trace("Channel {} current queue not completely flushed yet", parent.getChannel());
-            rescheduleFlush();
+            close();
+            if (currentQueue.finishShutdown()) {
+               LOG.debug("Channel {} shutdown complete", parent.getChannel());
+            } else {
+               LOG.trace("Channel {} current queue not completely flushed yet", parent.getChannel());
+               rescheduleFlush();
+            }
         }
     }