Moti Asayag has posted comments on this change.

Change subject: engine: Consider case-sensitivity for mac-address uniqueness
......................................................................


Patch Set 1:

(2 comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/network/MacPoolManager.java
Line 298:             if (allocatedMacs.containsKey(mac) || 
allocatedCustomMacs.containsKey(mac)) {
Line 299:                 return true;
Line 300:             }
Line 301: 
Line 302:             for (String macAddress : allocatedMacs.keySet()) {
this is not the same check cause contains relies on hasCode which clearly will 
be different for AA:AA:AA:AA:AA:AA and aa:aa:aa:aa:aa:aa. and also the equals 
behaves differently.
Line 303:                 if (StringUtils.equalsIgnoreCase(macAddress, mac)) {
Line 304:                     return true;
Line 305:                 }
Line 306:             }


Line 298:             if (allocatedMacs.containsKey(mac) || 
allocatedCustomMacs.containsKey(mac)) {
Line 299:                 return true;
Line 300:             }
Line 301: 
Line 302:             for (String macAddress : allocatedMacs.keySet()) {
my intention is to cause less changes to the MAC pool manager since this code 
is invoked only from add/update vnic - i don't see any concerns of hit in 
performance.

However, I accept your last comment and will modify the class to use the 
non-generic support class you've suggested with an explicit casting...
well, until we'll upgrade the apache-common version to a stable one which 
contains the proposed class supporting generics.
Line 303:                 if (StringUtils.equalsIgnoreCase(macAddress, mac)) {
Line 304:                     return true;
Line 305:                 }
Line 306:             }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I57516cc710648b37a9cebcdfce592c2418a7e192
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
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