Martin Mucha has posted comments on this change.

Change subject: core: macPool per DC, db changes
......................................................................


Patch Set 33:

(1 comment)

http://gerrit.ovirt.org/#/c/26795/33/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/MacPool.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/MacPool.java:

Line 83:         this.description = description;
Line 84:     }
Line 85: 
Line 86:     @Override
Line 87:     public boolean equals(Object o) {
> I uploaded patchset #37 with eclipse auto generated methods.
Ok, great time to compare what ide generates and how.
So I've checked it, using IDE diffs, making changes solely by ide refactorings.

hashcode differences:

- eclipse uses 1231 for true instead of intellij 0
- eclipse uses 1237 for true instead of intellij 1
- eclipse starting constant for hashcode is 31 instead of intellij 0 (initial 
number before another fields and stuff are considered)
- eclipse uses negated conditions in ternaries (code smell)
- eclipse supplies unneccessary braces(code smell).
no other differences.

equals differences: 

- eclipse uses different name for parameter --> 'obj' instead 'o'
- eclipse uses different name for parameter --> 'other' instead 'macPool'
- eclipse don't uses ternaries in favor of longer code.
- eclipse violates coding standards (missing parentheses) — that both violates 
general and ovirt code conventions. (code smell)
- eclipse uses extra null check using if (which is covered by latter instanceof 
check anyway)

no other differences.


---
and that's it. So NO wrong usage, no pitfalls, no missed nullvalues, no 
improper prime numbers. Only longer, worse code containing numerous code smell 
and fruitless code.


---
Absolute waste of time for both of us, expect for getting to know, that Eclipse 
generates equals and hashcode in worse way.
I didn't do neither statistical analysis, nor formal correctness analysis, so 
I'm accepting your improvements. Just note, that there's no real difference at 
all.
Line 88:         if (this == o) {
Line 89:             return true;
Line 90:         }
Line 91:         if (!(o instanceof MacPool)) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id30f3c384ecf933daaacdbdd6542e88afb98f7ca
Gerrit-PatchSet: 33
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to