Arik Hadas has posted comments on this change. Change subject: restapi,engine: fix usb mapping on update vm call ......................................................................
Patch Set 2: (1 inline comment) .................................................... File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java Line 689: public static VdcBllMessages forValue(int value) { Line 690: return values()[value]; Line 691: } Line 692: Line 693: @Override yes, it's the default impl of Enum but the toString method of Enum is not final, so anyone can override it here and return something else. by override it that way the code explicitly states that the toString method should return the exact field name. I think this is a safer way in the current situation because: 1. it doesn't require changing many places in the code 2. people are used to call the "toString" method of these errors - if we'll just change all existing calls to "toString" to "name()" and won't override the toString method as I did, people might still call it by mistake and if someone will override the toString method in the future it will create a bug.. Line 694: public final String toString() { Line 695: return this.name(); Line 696: } -- To view, visit http://gerrit.ovirt.org/9792 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If74bf6ede2fc0f932db8dfcd7951b6bcf90b7744 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Michael Pasternak <mpast...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches