Revert "handle empty snapshot correctly"

This reverts commit 99f985783e960d1ef8712c8ff724862f688b461e.
This commit is contained in:
anthony 2011-10-31 14:30:09 -07:00
parent 9225e8d2d4
commit 2f1e5504fb

View File

@ -750,7 +750,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
if (snapshot.getBackupSnapshotId() != null) {
List<SnapshotVO> 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<SnapshotVO> 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 {