ofri masad has uploaded a new change for review.

Change subject: webadmin: Cleanup in QuotaModel (#848289)
......................................................................

webadmin: Cleanup in QuotaModel (#848289)

https://bugzilla.redhat.com/848289

Cleanup of literals.

Change-Id: I30466414921d859cc6cffbcef2d80eb717ddcdde
Signed-off-by: Ofri Masad <oma...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaModel.java
1 file changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/23/7823/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaModel.java
index 61751f3..03ad0d8 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaModel.java
@@ -250,8 +250,8 @@
 
         ArrayList<QuotaVdsGroup> quotaClusterList = new 
ArrayList<QuotaVdsGroup>();
         QuotaVdsGroup quotaVdsGroup = new QuotaVdsGroup();
-        quotaVdsGroup.setMemSizeMB((long) -1);
-        quotaVdsGroup.setVirtualCpu(-1);
+        quotaVdsGroup.setMemSizeMB(QuotaVdsGroup.UNLIMITED_MEM);
+        quotaVdsGroup.setVirtualCpu(QuotaVdsGroup.UNLIMITED_VCPU);
         quotaVdsGroup.setMemSizeMBUsage((long) 0);
         quotaVdsGroup.setVirtualCpuUsage(0);
         quotaClusterList.add(quotaVdsGroup);
@@ -259,7 +259,7 @@
 
         ArrayList<QuotaStorage> quotaStorgaeList = new 
ArrayList<QuotaStorage>();
         QuotaStorage quotaStorage = new QuotaStorage();
-        quotaStorage.setStorageSizeGB((long) -1);
+        quotaStorage.setStorageSizeGB(QuotaStorage.UNLIMITED);
         quotaStorage.setStorageSizeGBUsage(0.0);
         quotaStorgaeList.add(quotaStorage);
         getQuotaStorages().setItems(quotaStorgaeList);
@@ -275,13 +275,13 @@
         EditQuotaClusterModel model = new EditQuotaClusterModel();
         
model.setTitle(ConstantsManager.getInstance().getConstants().defineClusterQuotaOnDataCenterTitle());
         model.setEntity(object);
-        if (object.getMemSizeMB() == null || object.getMemSizeMB() == -1) {
+        if (object.getMemSizeMB() == null || 
object.getMemSizeMB().equals(QuotaVdsGroup.UNLIMITED_MEM)) {
             model.getUnlimitedMem().setEntity(true);
         } else {
             model.getSpecificMem().setEntity(true);
             
model.getSpecificMemValue().setEntity(object.getMemSizeMB().toString());
         }
-        if (object.getVirtualCpu() == null || object.getVirtualCpu() == -1) {
+        if (object.getVirtualCpu() == null || 
object.getVirtualCpu().equals(QuotaVdsGroup.UNLIMITED_VCPU)) {
             model.getUnlimitedCpu().setEntity(true);
         } else {
             model.getSpecificCpu().setEntity(true);
@@ -305,7 +305,7 @@
         EditQuotaStorageModel model = new EditQuotaStorageModel();
         
model.setTitle(ConstantsManager.getInstance().getConstants().defineStorageQuotaOnDataCenterTitle());
         model.setEntity(object);
-        if (object.getStorageSizeGB() == null || object.getStorageSizeGB() == 
-1) {
+        if (object.getStorageSizeGB() == null || 
object.getStorageSizeGB().equals(QuotaStorage.UNLIMITED)) {
             model.getUnlimitedStorage().setEntity(true);
         } else {
             model.getSpecificStorage().setEntity(true);
@@ -329,13 +329,13 @@
             return;
         }
         if ((Boolean) model.getUnlimitedMem().getEntity()) {
-            quotaCluster.setMemSizeMB((long) -1);
+            quotaCluster.setMemSizeMB(QuotaVdsGroup.UNLIMITED_MEM);
         } else {
             quotaCluster.setMemSizeMB(new Long((String) 
model.getSpecificMemValue().getEntity()));
         }
 
         if ((Boolean) model.getUnlimitedCpu().getEntity()) {
-            quotaCluster.setVirtualCpu(-1);
+            quotaCluster.setVirtualCpu(QuotaVdsGroup.UNLIMITED_VCPU);
         } else {
             quotaCluster.setVirtualCpu(new Integer((String) 
model.getSpecificCpuValue().getEntity()));
         }
@@ -349,7 +349,7 @@
             return;
         }
         if ((Boolean) model.getUnlimitedStorage().getEntity()) {
-            quotaStorage.setStorageSizeGB((long) -1);
+            quotaStorage.setStorageSizeGB(QuotaStorage.UNLIMITED);
         } else {
             quotaStorage.setStorageSizeGB(new Long((String) 
model.getSpecificStorageValue().getEntity()));
         }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I30466414921d859cc6cffbcef2d80eb717ddcdde
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to