SwitchManager: getSwitchState() should not return null 28/15628/2
authorIsaku Yamahata <isaku.yamahata@intel.com>
Mon, 23 Feb 2015 19:27:49 +0000 (11:27 -0800)
committerThomas Bachman <tbachman@yahoo.com>
Mon, 23 Feb 2015 22:46:17 +0000 (22:46 +0000)
commit7d230b425deece27eb0f0f5b2d7941012d7fab3d
treeeaaa3c3bc018b6fd8b8347478576c2d0faf184be
parentfa233c807e53a3775017d7ce6691032bf0d8175c
SwitchManager: getSwitchState() should not return null

getSwitchState method populates switch state to switches in thread-safe
way. When race occurred, it should return already populated one.
The callers of it, updateSwitch and updateSwitchConfig, access the result
without null check. This is found by code review.
This semantics is same to other similar helper methods, getEPNGSet(),
getConfdGroupOrdinal(), getContextOrdinal().

Change-Id: I88d03a8f0b0109921377bc1fd4628a072c6b0552
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
groupbasedpolicy/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ofoverlay/SwitchManager.java