aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Martella <arthur.martella.1@att.com>2019-04-03 15:58:17 -0400
committerArthur Martella <arthur.martella.1@att.com>2019-04-03 16:00:04 -0400
commita1c1b4ba47e9c8ef1fa4e7b8a3ea8ab272050bae (patch)
tree02890f5cc10174b7439fe9f239c20974df3882c1
parent8703beababa99e3cf7c66995f28cf254de54616d (diff)
Don't call newLocks.put when lockId isn't set
Change-Id: I77f5870265712958979d7832eeb845d51e35cfe3 Issue-ID: MUSIC-374 Signed-off-by: arthur.martella.1@att.com
-rw-r--r--mdbc-server/src/main/java/org/onap/music/mdbc/ownership/OwnershipAndCheckpoint.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/mdbc-server/src/main/java/org/onap/music/mdbc/ownership/OwnershipAndCheckpoint.java b/mdbc-server/src/main/java/org/onap/music/mdbc/ownership/OwnershipAndCheckpoint.java
index b8b26e0..ef98ebd 100644
--- a/mdbc-server/src/main/java/org/onap/music/mdbc/ownership/OwnershipAndCheckpoint.java
+++ b/mdbc-server/src/main/java/org/onap/music/mdbc/ownership/OwnershipAndCheckpoint.java
@@ -334,12 +334,11 @@ public class OwnershipAndCheckpoint{
DagNode node = toOwn.nextToOwn();
MusicRangeInformationRow row = node.getRow();
UUID uuid = row.getPartitionIndex();
- if (partition.isLocked() && partition.getMRIIndex().equals(uuid) ||
- !row.getIsLatest()) {
+ if (partition.isLocked() && partition.getMRIIndex().equals(uuid) ) {
toOwn.setOwn(node);
newLocks.put(uuid, new LockResult(true, uuid, partition.getLockId(),
false, partition.getSnapshot()));
- } else if (newLocks.containsKey(uuid)) {
+ } else if ( newLocks.containsKey(uuid) || !row.getIsLatest() ) {
toOwn.setOwn(node);
} else {
LockRequest request = new LockRequest(MusicMixin.musicRangeInformationTableName,uuid,