From 2f1e5504fb23332ba53ae22a084161ec6b5ed3d8 Mon Sep 17 00:00:00 2001 From: anthony Date: Mon, 31 Oct 2011 14:30:09 -0700 Subject: [PATCH] Revert "handle empty snapshot correctly" This reverts commit 99f985783e960d1ef8712c8ff724862f688b461e. --- .../src/com/cloud/storage/snapshot/SnapshotManagerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index 15f30b200b1..50adc650b07 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -750,7 +750,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma SnapshotVO snapshot = _snapshotDao.findById(snapshotId); if (snapshot.getBackupSnapshotId() != null) { List snaps = _snapshotDao.listByBackupUuid(snapshot.getVolumeId(), snapshot.getBackupSnapshotId()); - if ( snaps != null && snaps.size() > 1 ) { + if (!snaps.isEmpty()) { snapshot.setBackupSnapshotId(null); _snapshotDao.update(snapshot.getId(), snapshot); } @@ -787,7 +787,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma String BackupSnapshotId = lastSnapshot.getBackupSnapshotId(); if (BackupSnapshotId != null) { List snaps = _snapshotDao.listByBackupUuid(lastSnapshot.getVolumeId(), BackupSnapshotId); - if ( snaps != null && snaps.size() > 1) { + if (snaps != null && !snaps.isEmpty()) { lastSnapshot.setBackupSnapshotId(null); _snapshotDao.update(lastSnapshot.getId(), lastSnapshot); } else {