remove dead allocations

Signed-off-by: Dave Brosius <dbrosius@mebigfatguy.com>
Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Dave Brosius 2013-05-22 02:06:00 -04:00 committed by Prasanna Santhanam
parent 85ed216087
commit 93938ca716
5 changed files with 5 additions and 10 deletions

View File

@ -70,13 +70,12 @@ public class FindHostsForMigrationCmd extends BaseListCmd {
public void execute() {
ListResponse<HostForMigrationResponse> response = null;
Pair<List<? extends Host>,Integer> result;
List<? extends Host> hostsWithCapacity = new ArrayList<Host>();
Map<Host, Boolean> hostsRequiringStorageMotion;
Ternary<Pair<List<? extends Host>,Integer>, List<? extends Host>, Map<Host, Boolean>> hostsForMigration =
_mgr.listHostsForMigrationOfVM(getVirtualMachineId(), this.getStartIndex(), this.getPageSizeVal());
result = hostsForMigration.first();
hostsWithCapacity = hostsForMigration.second();
List<? extends Host> hostsWithCapacity = hostsForMigration.second();
hostsRequiringStorageMotion = hostsForMigration.third();
response = new ListResponse<HostForMigrationResponse>();

View File

@ -171,11 +171,10 @@ public class ListHostsCmd extends BaseListCmd {
response = _queryService.searchForServers(this);
} else {
Pair<List<? extends Host>,Integer> result;
List<? extends Host> hostsWithCapacity = new ArrayList<Host>();
Ternary<Pair<List<? extends Host>,Integer>, List<? extends Host>, Map<Host, Boolean>> hostsForMigration =
_mgr.listHostsForMigrationOfVM(getVirtualMachineId(), this.getStartIndex(), this.getPageSizeVal());
result = hostsForMigration.first();
hostsWithCapacity = hostsForMigration.second();
List<? extends Host> hostsWithCapacity = hostsForMigration.second();
response = new ListResponse<HostResponse>();
List<HostResponse> hostResponses = new ArrayList<HostResponse>();

View File

@ -81,9 +81,8 @@ public class ListPortableIpRangesCmd extends BaseListCmd {
public void execute(){
ListResponse<PortableIpRangeResponse> response = new ListResponse<PortableIpRangeResponse>();
List<PortableIpRangeResponse> responses = new ArrayList<PortableIpRangeResponse>();
List<? extends PortableIpRange> portableIpRanges = new ArrayList<PortableIpRange>();
portableIpRanges = _configService.listPortableIpRanges(this);
List<? extends PortableIpRange> portableIpRanges = _configService.listPortableIpRanges(this);
if (portableIpRanges != null && !portableIpRanges.isEmpty()) {
for (PortableIpRange range : portableIpRanges) {
PortableIpRangeResponse rangeResponse = _responseGenerator.createPortableIPRangeResponse(range);

View File

@ -153,8 +153,7 @@ public class ListIsosCmd extends BaseListTaggedResourcesCmd {
List<TemplateResponse> templateResponses = new ArrayList<TemplateResponse>();
for (Pair<Long, Long> iso : isoZonePairSet) {
List<TemplateResponse> responses = new ArrayList<TemplateResponse>();
responses = _responseGenerator.createIsoResponses(iso.first(), iso.second(), listInReadyState());
List<TemplateResponse> responses = _responseGenerator.createIsoResponses(iso.first(), iso.second(), listInReadyState());
templateResponses.addAll(responses);
}
response.setResponses(templateResponses);

View File

@ -125,8 +125,7 @@ public class ListTemplatesCmd extends BaseListTaggedResourcesCmd {
List<TemplateResponse> templateResponses = new ArrayList<TemplateResponse>();
for (Pair<Long, Long> template : templateZonePairSet) {
List<TemplateResponse> responses = new ArrayList<TemplateResponse>();
responses = _responseGenerator.createTemplateResponses(template.first().longValue(), template.second(), listInReadyState());
List<TemplateResponse> responses = _responseGenerator.createTemplateResponses(template.first().longValue(), template.second(), listInReadyState());
templateResponses.addAll(responses);
}