Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Improved Comparable implementation of NetworkItemModel
......................................................................

webadmin: Improved Comparable implementation of NetworkItemModel

The comparison is now performed using LexoNumericComparator, thus
handling strings with numeric subsequences better.

Change-Id: I61e70d34f5dcd30ed85e898cd3bb0c47a6f4f7a9
Signed-off-by: Lior Vernia <[email protected]>
---
M 
frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkItemModel.java
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/01/12001/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
index 7312d7c..eddb016 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
@@ -183,6 +183,7 @@
                <include name="common/AuditLogSeverity.java" />
                <include name="common/users/VdcUser.java" />
                <include name="common/utils/EnumUtils.java" />
+               <include name="common/utils/LexoNumericComparator.java" />
                <include name="common/utils/ListUtils.java" />
                <include name="common/utils/StringUtil.java"/>
                <include name="common/utils/ObjectUtils.java" />
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkItemModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkItemModel.java
index d16a0ee..99459a6 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkItemModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/network/NetworkItemModel.java
@@ -1,5 +1,6 @@
 package org.ovirt.engine.ui.uicommonweb.models.hosts.network;
 
+import org.ovirt.engine.core.common.utils.LexoNumericComparator;
 import org.ovirt.engine.ui.uicommonweb.models.ListModel;
 import org.ovirt.engine.ui.uicommonweb.models.hosts.HostSetupNetworksModel;
 
@@ -26,7 +27,7 @@
 
     @Override
     public int compareTo(NetworkItemModel<T> o) {
-        return getName().compareTo(o.getName());
+        return LexoNumericComparator.comp(getName(), o.getName());
     }
 
     public String getError() {


--
To view, visit http://gerrit.ovirt.org/12001
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61e70d34f5dcd30ed85e898cd3bb0c47a6f4f7a9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to