From 7206d41640f98943c64da8f8486e5205b279c943 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 21 May 2014 15:21:14 +0200 Subject: [PATCH] BUG-509: move snapshotCache get out of try block This just moves the get which cannot throw out of the 'catch Exception' block. Change-Id: I936e987fa6b9e8b3eecb35656c586e3afb070046 Signed-off-by: Robert Varga --- .../impl/tree/data/InMemoryDataTreeModification.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/InMemoryDataTreeModification.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/InMemoryDataTreeModification.java index 1540feca66..7d0c81e39d 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/InMemoryDataTreeModification.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/data/InMemoryDataTreeModification.java @@ -108,11 +108,12 @@ final class InMemoryDataTreeModification implements DataTreeModification { private Optional resolveSnapshot(final InstanceIdentifier path, final NodeModification modification) { + final Optional> potentialSnapshot = modification.getSnapshotCache(); + if(potentialSnapshot.isPresent()) { + return potentialSnapshot.get(); + } + try { - Optional> potentialSnapshot = modification.getSnapshotCache(); - if(potentialSnapshot.isPresent()) { - return potentialSnapshot.get(); - } return resolveModificationStrategy(path).apply(modification, modification.getOriginal(), StoreUtils.increase(snapshot.getRootNode().getSubtreeVersion())); } catch (Exception e) { -- 2.36.6