bug 7220: the parameter type transfer may cause NPE

status 7220: resolved fixed
This commit is contained in:
Anthony Xu 2010-11-19 15:54:43 -08:00
parent a5dfaaf31b
commit fa499dadbc
2 changed files with 5 additions and 5 deletions

View File

@ -90,7 +90,7 @@ public interface SnapshotManager extends Manager {
* @param policyIds The list of policyIds to which this snapshot belongs to
* @param backedUp If true, the snapshot has been successfully created.
*/
void postCreateSnapshot(long volumeId, long snapshotId, long policyId, boolean backedUp);
void postCreateSnapshot(Long volumeId, Long snapshotId, Long policyId, boolean backedUp);
/**
* Destroys the specified snapshot from secondary storage
@ -115,7 +115,7 @@ public interface SnapshotManager extends Manager {
/**
* Deletes snapshot scheduling policy. Delete will fail if this policy is assigned to one or more volumes
*/
boolean deletePolicy(long userId, long policyId);
boolean deletePolicy(long userId, Long policyId);
/**
* Lists all snapshots for the volume which are created using schedule of the specified policy

View File

@ -528,7 +528,7 @@ public class SnapshotManagerImpl implements SnapshotManager {
@Override
@DB
public void postCreateSnapshot(long volumeId, long snapshotId, long policyId, boolean backedUp) {
public void postCreateSnapshot(Long volumeId, Long snapshotId, Long policyId, boolean backedUp) {
Long userId = getSnapshotUserId();
// Update the snapshot_policy_ref table with the created snapshot
// Get the list of policies for this snapshot
@ -918,7 +918,7 @@ public class SnapshotManagerImpl implements SnapshotManager {
}
@Override
public boolean deletePolicy(long userId, long policyId) {
public boolean deletePolicy(long userId, Long policyId) {
SnapshotPolicyVO snapshotPolicy = _snapshotPolicyDao.findById(policyId);
VolumeVO volume = _volsDao.findById(snapshotPolicy.getVolumeId());
_snapSchedMgr.removeSchedule(snapshotPolicy.getVolumeId(), snapshotPolicy.getId());
@ -1122,7 +1122,7 @@ public class SnapshotManagerImpl implements SnapshotManager {
throw new InvalidParameterValueException("Invalid Policy id given: " + Snapshot.MANUAL_POLICY_ID);
}
for (long pId : policyIds) {
for (Long pId : policyIds) {
if (!deletePolicy(userId, pId)) {
success = false;
s_logger.warn("Failed to delete snapshot policy with Id: " + policyId);