Vojtech Szocs has posted comments on this change.

Change subject: userportal, webadmin: Number field reporting wrong error
......................................................................


Patch Set 8:

(2 comments)

https://gerrit.ovirt.org/#/c/37244/8/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/AbstractValidatedWidgetWithLabel.java:

Line 298: 
Line 299:     @Override
Line 300:     public void markAsValid() {
Line 301:         if (editorStateValid) {
Line 302:             super.markAsValid();
> Because mark as valid can be called even if the lowest level check (aka is 
Thanks for clarification, so we're hitting the "validation logic first marks 
the model as valid even if it might not be, then runs validators on given 
model" thing again, and we need to deal with it.
Line 303:         }
Line 304:         labelTooltip.setText(labelConfiguredTooltip);
Line 305:         labelTooltip.reconfigure();
Line 306:         
contentWidgetContainerTooltip.setText(contentWidgetContainerConfiguredTooltip);


https://gerrit.ovirt.org/#/c/37244/8/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/generic/EntityModelTextBox.java
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/generic/EntityModelTextBox.java:

Line 34:      * Return the parsed value, or null if the field is empty or 
parsing fails. If the validity of the box changes
Line 35:      * fire an {@code EditorStateUpdateEvent}, so interested parties 
can handle it.
Line 36:      */
Line 37:     @Override
Line 38:     public T getValue() {
> It looks like the behavior of that is indentical (except that it lets Parse
Agreed, I'm OK with original change.  Just tried to avoid logic inside the 
catch block.

My code snippet is flawed; IDE tells me that return in finally block is not 
recommended (as it might hide thrown exception, but in this situation, 
exception *won't* escape the method as the signature doesn't declare throws 
part anyway, note that ParseException is checked exception).

To fix my own code snippet, I'd move return out of finally block, but then I'd 
have to declare throws part (because ParseException is checked exception) and 
that would interfere with ValueBoxBase#getValue signature, so long story short, 
please scratch my idea :-)
Line 39:         T value = null;
Line 40:         boolean originalValidState = isValid;
Line 41:         try {
Line 42:             value = getValueOrThrow();


-- 
To view, visit https://gerrit.ovirt.org/37244
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3702cb370528a0baf6a176fa89cd736596a10ff2
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Greg Sheremeta <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to