Community
Participate
Working Groups
I20030916. The problem is the first patch from Bug 41962. The modify listener is re-entrant because the text of the widget isn't updated before another event is processed. This problem does not happen on Windows XP. This may be an SWT problem.
Created attachment 6119 [details] Patch to KeySequenceText Fixes the StackOverflow error by removing the modification listener just before making a text change driven by the key sequence, and places the listener back on afterward. The idea is that, in general, the modification listener translates textual changes into corresponding changes to the key sequence. In this particular case, the textual change is driven by a change to the key sequence, so the reverse operation is not needed. The problem occurred because SWT calls a delete (with full event propagation) before inseting the new text. I'll file a separate bug against SWT's GTK implementation so that they have a chance to respond. Minor cosmetic changes were made to remove warnings.
nick: you said you wanted to see some of my patches. here's one -- fixing a stack overflow and making some cosmetic changes.
See Bug 43177 for the separate GTK bug.
Changes applied. They look reasonable, however I did not do any extra testing. Note that the extra get methods to avoid accesses to outer private fields are not strictly necessary. Contrary to the currently posted guidelines, I don't think that the compile-time check for access to outer private members is terribly helpful. I'll be updating the guidelines.
Patch is applied. This should prevent the StackOverflowError on GTK. If SWT makes changes to how ModifyEvents are fired, then this fix may not be needed. However, it is still probably a decent safety precaution.
*** Bug 43381 has been marked as a duplicate of this bug. ***
*** Bug 43567 has been marked as a duplicate of this bug. ***
*** Bug 44176 has been marked as a duplicate of this bug. ***
*** Bug 44522 has been marked as a duplicate of this bug. ***