Change in ovirt-engine[master]: core: findbugs: Organize equals(Object) overrides

amureini at redhat.com amureini at redhat.com
Sun Jan 12 08:37:46 UTC 2014


Allon Mureinik has submitted this change and it was merged.

Change subject: core: findbugs: Organize equals(Object) overrides
......................................................................


core: findbugs: Organize equals(Object) overrides

exclude-filters-general.xml excludes all warnings about not overriding
equals(Object), which is a dangerous and bug-prone practice. This patch
tries to reconcile this approach, and make sense of the exclusions.

This patch includes:
1. Removed the equals(Object) and hashCode() from
   VdcActionParametersBase, as it is never used and (almost) none of
   the parameter classes override it, meaning that any equality
   check between parameter classes would be bogus.

2. Removed equals(Object) and hashCode() from RemoveNetworkParameters,
   as they are useless (see (1) for details), and depend on the
   VdcActionParametersBase's implementation which was removed anyway.

3. Implement equals(Object) and hashCode() that were missing from
   ExtendedVmDynamic. This mistake of omission goes to prove how this
   suppression was a bad idea.

4. Explicitly exclude the missing equals(Object) implementation for
   PolicyUnitImpl and NetworkPolicyUnit as they are not trivial to
   implement, and the current code base is proven to work without
   them.

5. Remove the all-out exclusion of unimplemented equals(Object) methods
   from exclude-filters-general.xml to avoid bugs like the one described
   in (3).

Change-Id: I3384d0c85f3c8ba91e25b584659e5e5f4617acb4
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M backend/manager/modules/bll/exclude-filters.xml
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RemoveNetworkParameters.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionParametersBase.java
M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/ExtendedVmDynamic.java
M exclude-filters-general.xml
5 files changed, 46 insertions(+), 142 deletions(-)

Approvals:
  Allon Mureinik: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3384d0c85f3c8ba91e25b584659e5e5f4617acb4
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Alissa Bonas <abonas at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim at redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkolesni at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server



More information about the Engine-commits mailing list