BUG-731: limit protected field visibility 51/6751/1
authorRobert Varga <rovarga@cisco.com>
Tue, 6 May 2014 15:59:48 +0000 (17:59 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 6 May 2014 15:59:48 +0000 (17:59 +0200)
One field can become private, others get @VisibleForTesting

Change-Id: I2d5214620a83953dae080d4a1f67e1e6470944e9
Signed-off-by: Robert Varga <rovarga@cisco.com>
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java

index 41fb5be47b7bdf484ccac8b98ae82f10b04587de..07d49152d0399a353c049cde18a4b7f68c25e289 100644 (file)
@@ -57,6 +57,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
        /**
         * System.nanoTime value about when was sent the last message Protected to be updated also in tests.
         */
+       @VisibleForTesting
        protected volatile long lastMessageSentAt;
 
        /**
@@ -64,11 +65,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
         */
        private long lastMessageReceivedAt;
 
-       /**
-        * Protected for testing.
-        */
-       protected int maxUnknownMessages;
-
+       @VisibleForTesting
        protected final Queue<Long> unknownMessagesTimes = new LinkedList<Long>();
 
        private final PCEPSessionListener listener;
@@ -94,6 +91,8 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
 
        private int receivedMsgCount = 0;
 
+       private int maxUnknownMessages;
+
        // True if the listener should not be notified about events
        private boolean closed = false;