Arik Hadas has uploaded a new change for review. Change subject: webadmin: fix migrate dialog ......................................................................
webadmin: fix migrate dialog The migrate dialog did not work because the returned value of the query for all hosts in cluster changed from ArrayList to LinkedList. The solution is to handle the returned value as List. Change-Id: I5e004186025a63703e9a02a193c4d72791a9c303 Signed-off-by: Arik Hadas <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MigrateModel.java 2 files changed, 5 insertions(+), 10 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/47/36547/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java index 01bd2dd..a817ab3 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java @@ -2363,13 +2363,7 @@ @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { - if (source != null) - { - ArrayList<VDS> list = Linq.<VDS> cast((ArrayList<IVdcQueryable>) source); - return list; - } - - return new ArrayList<VDS>(); + return source != null ? source : Collections.emptyList(); } }; getUpHostListByCluster(aQuery, clusterName, null); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MigrateModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MigrateModel.java index 179b7eb..9d56315 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MigrateModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/MigrateModel.java @@ -228,14 +228,15 @@ AsyncDataProvider.getInstance().getUpHostListByCluster(new AsyncQuery(this, new INewAsyncCallback() { + @SuppressWarnings("unchecked") @Override public void onSuccess(Object target, Object returnValue) { - postMigrateGetUpHosts(privateVmList, (ArrayList<VDS>) returnValue); + postMigrateGetUpHosts(privateVmList, (List<VDS>) returnValue); } }), selectedCluster.getName()); } - private void postMigrateGetUpHosts(List<VM> selectedVms, ArrayList<VDS> hosts) { + private void postMigrateGetUpHosts(List<VM> selectedVms, List<VDS> hosts) { setVmsOnSameCluster(true); setIsSameVdsMessageVisible(false); setNoSelAvailable(false); @@ -287,7 +288,7 @@ } } - private void removeUnselectableHosts(ArrayList<VDS> hosts, Guid run_on_vds, boolean allRunOnSameVds) { + private void removeUnselectableHosts(List<VDS> hosts, Guid run_on_vds, boolean allRunOnSameVds) { if (getVmsOnSameCluster() && allRunOnSameVds) { VDS runOnSameVDS = null; for (VDS host : hosts) { -- To view, visit http://gerrit.ovirt.org/36547 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e004186025a63703e9a02a193c4d72791a9c303 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
