Cleanup: avoid immediate Optional.get() 96/53496/2
authorStephen Kitt <skitt@redhat.com>
Fri, 17 Mar 2017 17:17:42 +0000 (18:17 +0100)
committerFaseela K <faseela.k@ericsson.com>
Fri, 17 Mar 2017 17:54:02 +0000 (17:54 +0000)
commitb38278d57bcf86be76813161b0f5355e37898693
tree714cd9e07d23796ead9775444096618773e16843
parent7af6700dc4966ebe70262eaad8c90a056225a6d9
Cleanup: avoid immediate Optional.get()

This reworks allocateId() to store the id directly, and wrap it in an
Optional when needed, instead of wrapping it and unwrapping it
immediately. The performance gain isn't significant, but this helps
static analysers which check for get()-without-isPresent().

Change-Id: I5155660e6240a8c9d01de0bce78528b80d755e10
Signed-off-by: Stephen Kitt <skitt@redhat.com>
idmanager/idmanager-impl/src/main/java/org/opendaylight/genius/idmanager/AvailableIdHolder.java