I have a little application that has a Swing form and text area. I open a file and I press a button that does a search on the text by doing a string search on the text in a List. The work of searching is done in a SingleThreadExecutor and puts the start and end indexes of each word found in a List. Then I do an InvokeAndWait and send the index List into the EDT and it uses it to paint highlighting on the words.
If I open a big text file, click the button to highlight the words, then clear and click the button again, as soon as the words are highlighted and I click the red X on the Form to close the application I get:
This is repeatable and only happens on the 2nd time I perform the highlight routine. It never happens the 1st time or the 3rd time and so forth.
I went about trying to consolidate the only code that is needed, but it is a huge task to do. In the process I did minimize the code and managed to get the exception on JDK1.7.0_25 too, so I think this is a normal exception (normal for JDK 7 anyway) from trying to shutdown the program to quickly without adding extra code to make sure it doesn't happen. It's just a matter of timing.