Moti Asayag has posted comments on this change. Change subject: engine: Support replacements in ValidationResult ......................................................................
Patch Set 3: (2 comments) http://gerrit.ovirt.org/#/c/34855/3/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ValidationResult.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ValidationResult.java: Line 51: throw new IllegalArgumentException("message must not be null"); Line 52: } Line 53: Line 54: this.message = message; Line 55: if (variableReplacements.length > 0) { > IMHO the condition is redundant Why ? that preserves the exact functionality as was before. Line 56: this.variableReplacements = Collections.unmodifiableList(Arrays.asList(variableReplacements)); Line 57: } Line 58: } Line 59: Line 52: } Line 53: Line 54: this.message = message; Line 55: if (variableReplacements.length > 0) { Line 56: this.variableReplacements = Collections.unmodifiableList(Arrays.asList(variableReplacements)); > Yous should fix equals method because UnmodifiableCollection does not imple well...couldn't prove it by running the following tests, which later own I debugged and noticed the implementation exists in AbstractList which has a proper implementation: @Test public void testEquals() { ValidationResult o1 = new ValidationResult(ERROR); ValidationResult o2 = new ValidationResult(ERROR); assertEquals(o1, o2); } @Test public void testEqualsWithReplacements() { ValidationResult o1 = new ValidationResult(ERROR, REPLACEMENT); ValidationResult o2 = new ValidationResult(ERROR, REPLACEMENT); assertEquals(o1, o2); } Line 57: } Line 58: } Line 59: Line 60: /** -- To view, visit http://gerrit.ovirt.org/34855 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f2bd85af2d129e0647b100b90908a1314419da2 Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Moti Asayag <[email protected]> Gerrit-Reviewer: Alona Kaplan <[email protected]> Gerrit-Reviewer: Mike Kolesnik <[email protected]> Gerrit-Reviewer: Moti Asayag <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
