assertj / assertj/assertj-swing

CellWriter can block main thread when celleditor.stopEditing() is called

Offen
#83 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
import from fest-swing Improvement Major
Vorherrschende Sprache
Java
Sterne
121
Forks
52
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

_Issue by **[Shawn Clowater](http://jira.codehaus.org/secure/ViewProfile.jspa?name=sclowater)** from Fri, 10 Dec 2010 18:34:19 -0600_
_Originally opened as http://jira.codehaus.org/browse/FEST-409_

---

We have a text editor that can pop a dialog from an inputVerifier() call. (it executes a lookup and will display an advanced search dialog if either no match or multiple matches were found)

In the case of setting a value and fest ultimately calling the stopEditing() which causes this dialog to display it causes a deadlock in the main execution thread so we can't do anything to process the dialog and our tests hang.

It's all fine until it gets down into the JTableStopCellEditingTask.doStopCellEditing(TableCellEditor cellEditor) method and then it will essentially wait forever. (until the test timeout kicks in)

I've managed to work around it by essentially cloning the BasicJTableCellWriter and then swapping out the textComponentWriter reference with an editor that issues a F2 keyevent in place of the stopEditing call.

It all works but to actually get at the pieces I needed to clone the BasicJTableCellWriter since the code I needed to override was either private or final. i.e. the handling of the cellWriterFor() method.

Looking back in the changelog history I see that F2 was wired up to start the editing at some point, it might be worthwhile to do the same thing for the stop Editing.

---

votes (original issue): 0
watches (original issue): 0

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie bei JTableStopCellEditingTask.doStopCellEditing(TableCellEditor cellEditor) und untersuchen Sie, wie BasicJTableCellWriter stopEditing aufruft, wenn ein inputVerifier einen Dialog öffnet. Reproduzieren Sie das Szenario des hängenden Tests und überprüfen Sie anschließend, dass die Zellbearbeitung beendet werden kann, ohne den Hauptthread zu blockieren, und dass der Dialog weiterhin verwendbar ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
desktop, testing
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.