remove dead allocations Signed-off-by: Dave Brosius <[email protected]> Signed-off-by: Prasanna Santhanam <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/93938ca7 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/93938ca7 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/93938ca7 Branch: refs/heads/disk_io_throttling Commit: 93938ca716f85c24f2d9fb07c5856055f0061415 Parents: 85ed216 Author: Dave Brosius <[email protected]> Authored: Wed May 22 02:06:00 2013 -0400 Committer: Prasanna Santhanam <[email protected]> Committed: Tue Jun 18 11:37:31 2013 +0530 ---------------------------------------------------------------------- .../api/command/admin/host/FindHostsForMigrationCmd.java | 3 +-- .../apache/cloudstack/api/command/admin/host/ListHostsCmd.java | 3 +-- .../api/command/admin/region/ListPortableIpRangesCmd.java | 3 +-- .../org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java | 3 +-- .../cloudstack/api/command/user/template/ListTemplatesCmd.java | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93938ca7/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java index b2d77b8..e902e65 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java @@ -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>(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93938ca7/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java index eaaec30..1e378fa 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java @@ -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>(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93938ca7/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java index 75bcce0..1f77c2c 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/region/ListPortableIpRangesCmd.java @@ -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); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93938ca7/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java index 3219601..9e6abec 100644 --- a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java @@ -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); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/93938ca7/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java ---------------------------------------------------------------------- diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java index aeb76f5..dc94d67 100644 --- a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java @@ -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); }
