| Summary: | DeferredUpdateManager performValidation does not support reentry | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Stefan Holzknecht <s.holzknecht> |
| Component: | GEF-Legacy Draw2d | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | aboyko, hudsonr |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
I have seen this problem recently too. In my case, when I was placing a cell editor, I was forcing the figure below to layout before placing the celleditor on top of it. But, a layout was already in progress, so you get the NPE. But, what is the correct fix? You can't request a layout if one is ongoing, so should the method just return without laying out? That doesn't make much sense either. A third approach would be for the code invoking performValidation to instead call runWithUpdate(Runnable). Can you provide more details about your use case? Please look at your stack trace, and post the amount that includes the first call to performValidation(), and a brief description. This should be fixed by the fix to bug 146894 |
When creating an edge or relationship my editor sometimes hangs. This happens if the relations gets revalidated and the mouse is over a figure that is a child of the connection layer. Debbuging my editor I noted that the List of invalidFigures grows indefinite. It seams that in performUpdate the addInvalidFigure() gets called. But sadly the list does not contain the actually validated figure anymore and the deadlock occures. In my update manager the figure gets unset after the validation and everything seams to be ok. /** * @see UpdateManager#performValidation() */ public void performValidation() { if (invalidFigures.isEmpty()) return; try { IFigure fig; fireValidating(); for (int i = 0; i < invalidFigures.size(); i++) { fig = (IFigure) invalidFigures.get(i); fig.validate(); // changed invalidFigures.set(i, null); // changed } } finally { invalidFigures.clear(); } }