Add missing synchronisation 02/70902/1
authorStephen Kitt <skitt@redhat.com>
Fri, 13 Apr 2018 09:01:31 +0000 (11:01 +0200)
committerStephen Kitt <skitt@redhat.com>
Fri, 13 Apr 2018 09:01:31 +0000 (11:01 +0200)
AbstractNetconfSessionNegotiator synchronises access to state in
changeState(); this also needs to be done in ifNegotiatedAlready.
(FindBugs now flags this and fails the build.)

Change-Id: Id2209e1987429f3b754a2c7afc1a7e47dc4135ab
Signed-off-by: Stephen Kitt <skitt@redhat.com>
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java

index f8f486b2a0f63770b984e66a532ec332c7c9e7d0..30b81146040c8818bc8bf567a18007f642c48f1a 100644 (file)
@@ -99,7 +99,7 @@ public abstract class AbstractNetconfSessionNegotiator<P extends NetconfSessionP
         }
     }
 
         }
     }
 
-    protected final boolean ifNegotiatedAlready() {
+    protected final synchronized boolean ifNegotiatedAlready() {
         // Indicates whether negotiation already started
         return this.state != State.IDLE;
     }
         // Indicates whether negotiation already started
         return this.state != State.IDLE;
     }