Don't call newLocks.put when lockId isn't set 40/84140/2
authorArthur Martella <arthur.martella.1@att.com>
Wed, 3 Apr 2019 19:58:17 +0000 (15:58 -0400)
committerArthur Martella <arthur.martella.1@att.com>
Wed, 3 Apr 2019 20:00:04 +0000 (16:00 -0400)
Change-Id: I77f5870265712958979d7832eeb845d51e35cfe3
Issue-ID: MUSIC-374
Signed-off-by: arthur.martella.1@att.com
mdbc-server/src/main/java/org/onap/music/mdbc/ownership/OwnershipAndCheckpoint.java

index b8b26e0..ef98ebd 100644 (file)
@@ -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,