Alexander Wels has uploaded a new change for review.

Change subject: engine: findbugs warning
......................................................................

engine: findbugs warning

- Fixed 'unusual equals' findbug warning
- Fixed 'comparing string with '='' warning.

Change-Id: I25f0be9e319aec078fadabfa426d1e4b7c170493
Signed-off-by: Alexander Wels <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ServerCpu.java
M frontend/webadmin/modules/uicommonweb/exclude-filters.xml
2 files changed, 14 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/26986/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ServerCpu.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ServerCpu.java
index 049a595..f92158e 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ServerCpu.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ServerCpu.java
@@ -3,6 +3,8 @@
 import java.io.Serializable;
 import java.util.HashSet;
 
+import org.ovirt.engine.core.common.utils.ObjectUtils;
+
 public class ServerCpu implements Serializable {
     private static final long serialVersionUID = -267863982363067020L;
 
@@ -87,14 +89,11 @@
             return false;
         }
         ServerCpu other = (ServerCpu) obj;
-        return (privateArchitecture.equals(other.privateArchitecture)
-                && ((privateCpuName != null && 
privateCpuName.equals(other.privateCpuName))
-                        || privateCpuName == other.privateCpuName) // The null 
== null case.
-                && ((privateFlags != null && 
privateFlags.equals(other.privateFlags))
-                        || privateFlags == other.privateFlags) // The null == 
null case.
+        return ObjectUtils.objectsEqual(privateArchitecture, 
other.privateArchitecture)
+                && ObjectUtils.objectsEqual(privateCpuName, 
other.privateCpuName)
+                && ObjectUtils.objectsEqual(privateFlags, other.privateFlags)
                 && privateLevel == other.privateLevel
-                && ((privateVdsVerbData != null && 
privateVdsVerbData.equals(other.privateVdsVerbData))
-                        || privateVdsVerbData == other.privateVdsVerbData)); 
// The null == null case.
+                && ObjectUtils.objectsEqual(privateVdsVerbData, 
other.privateVdsVerbData);
     }
 
 }
diff --git a/frontend/webadmin/modules/uicommonweb/exclude-filters.xml 
b/frontend/webadmin/modules/uicommonweb/exclude-filters.xml
index cecf1a1..6431f9c 100644
--- a/frontend/webadmin/modules/uicommonweb/exclude-filters.xml
+++ b/frontend/webadmin/modules/uicommonweb/exclude-filters.xml
@@ -43,4 +43,12 @@
         <Bug pattern="BC_BAD_CAST_TO_ABSTRACT_COLLECTION"/>
     </Match>
 
+    <!--
+      findbugs complains about an unusual equals, which is correct, I have a 
special equals that can take
+      a flag to make it behave differently. So the normal equal calls the 
special one with the default flag.
+    -->
+    <Match>
+        <Class 
name="org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel" />
+        <Bug pattern="EQ_UNUSUAL"/>
+    </Match>
 </FindBugsFilter>


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

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

Reply via email to