assertj / assertj/assertj-swing

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

Open
#83 0 comments 0 reactions 0 assignees View on GitHub
import from fest-swing Improvement Major
Dominant language
Java
Stars
121
Forks
52
PR merge metrics
No merged PRs in 30d

Description

_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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.