Leave a failed conversion in the control and keep the previous Attribute.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-30 18:45:12 +01:00
co-authored by Cursor
parent eaebe66b0d
commit 398883d20a
3 changed files with 4 additions and 14 deletions
@@ -252,7 +252,6 @@ final class DirectBindingApplier {
link.applying = true;
try {
control.setValue(shown);
link.committedControl = shown;
} finally {
link.applying = false;
}
@@ -269,18 +268,11 @@ final class DirectBindingApplier {
link.applying = true;
try {
attribute.setValue(converted);
link.committedControl = control.getValue();
} finally {
link.applying = false;
}
owner.clearBindingFailure(source);
} catch (RuntimeException failure) {
link.applying = true;
try {
control.setValue(link.committedControl);
} finally {
link.applying = false;
}
owner.reportBindingFailure(source, failureText(failure));
}
}
@@ -294,12 +286,10 @@ final class DirectBindingApplier {
}
/**
* Guards one converted binding against hearing its own writes, and remembers the last
* control value that was successfully shown.
* Guards one converted binding against hearing its own writes.
*/
private static final class Link {
private boolean applying;
private Object committedControl;
}
private static Property<?> controlProperty(Object control, String propertyName) {