Lior Vernia has posted comments on this change. Change subject: webadmin: Add MAC pools in DC dialog ......................................................................
Patch Set 12: (3 comments) http://gerrit.ovirt.org/#/c/27792/12/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterListModel.java: Line 296: model.setTitle(constants.editDataCenterTitle()); Line 297: model.setHelpTag(HelpTag.edit_data_center); Line 298: model.setHashName("edit_data_center"); //$NON-NLS-1$ Line 299: model.getName().setEntity(dataCenter.getName()); Line 300: model.initSelectedMacPool(); > Cause we have just one thread in GWT so even if a response was returned fro Done Line 301: Line 302: if (getSystemTreeSelectedItem() != null Line 303: && getSystemTreeSelectedItem().getType() == SystemTreeItemType.DataCenter) Line 304: { http://gerrit.ovirt.org/#/c/27792/12/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/datacenters/DataCenterModel.java: Line 324: } Line 325: } Line 326: } Line 327: Line 328: public void initSelectedMacPool() { > Where is setSlectedItem() used in this class? You didn't specify which member's setEntity() you were referring to, I thought you were referring to that of macPoolListModel. Note that this change wasn't needed as long as initSelectedMacPool() was also invoked from DataCenterListModel, it's only required now that it's removed. Done. Line 329: Collection<MacPool> allMacPools = getMacPoolListModel().getItems(); Line 330: StoragePool dc = getEntity(); Line 331: if (allMacPools != null && dc != null) { Line 332: Guid macPoolId = dc.getMacPoolId(); Line 328: public void initSelectedMacPool() { Line 329: Collection<MacPool> allMacPools = getMacPoolListModel().getItems(); Line 330: StoragePool dc = getEntity(); Line 331: if (allMacPools != null && dc != null) { Line 332: Guid macPoolId = dc.getMacPoolId(); > Please check if macPoolId is null. If it is, don't enter the loop. macPoolId shouldn't be null. A DC should always refer to some MAC pool, even if it is the default one. Line 333: for (MacPool macPool : allMacPools) { Line 334: if ((macPoolId == null) ? macPool.isDefaultPool() : macPoolId.equals(macPool.getId())) { Line 335: getMacPoolListModel().setSelectedItem(macPool); Line 336: break; -- To view, visit http://gerrit.ovirt.org/27792 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I338a5647ded866c6b7b07542e9a95ea3dc3a2594 Gerrit-PatchSet: 12 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Lior Vernia <[email protected]> Gerrit-Reviewer: Alona Kaplan <[email protected]> Gerrit-Reviewer: Lior Vernia <[email protected]> Gerrit-Reviewer: Martin Mucha <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
