-
-
Notifications
You must be signed in to change notification settings - Fork 265
-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack overflow bug in v1.6.4 #432
Comments
Tried to reproduce this without success... Is the "end" of the stack trace also available? Do you have more information? E.g.
|
Sorry, didn't receive the "end" (actually start, right) of the stack trace. Isn't it possible to figure out what could cause this stack overflow? I mean, it seems to involve only a few lines of code. |
Can you please ask the user whether he can send it to you?
This one? Do you change the border of the renderer? Or override
Sure, can add a |
Or is there a thread involved to loads list of fonts in background? |
Hi. Yes, It's that component. No, I'm not doing anything with the border. Yes, I'm populating the model via a background thread. I've attached the source code for this component her |
Assuming (by your question) that I'm not allowed to fire a change update from a non-AWT thread, I now ensure that I call fireIntervalAdded on the AWT. I hope that will address the stack overflow issue (which I can't reproduce either) |
Unfortunately, one user still reports this stack overflow problem even though I rewrote the code to call fireIntervalAdded on the AWT. You have the java file in my previous post. I received the updated stack trace, but it doesn't either go all way back to the start: java.lang.StackOverflowError |
Finally was able to reproduce (with some tricks) the stack overflow error. Please try latest Tested jAlbum 26b2 with a modified FlatLaf library.
|
Thanks for investigating. I'll have a user that can reproduce this problem try this update. So you're saying that this update doesn't at least break when you try? It's true that we actually break a "swing rule" and set up the UI on a background thread, but we shouldn't be calling setSelectedIndex on that thread. I'll have our skin developer adjust this. The reason why we make the basic UI setup on a separate thread is to give a better end user experience. It takes several seconds to load the UI and we don't want to hang the whole UI while setting up parts of it (like when loading the skin's UI). Is it against Swing rules to modify the model on other threads too? |
Yes.
That's ok, as long as the created UI hierarchy is modified only on that thread (and is not yet made visible/displayable). This could be a problem in
Actually yes. In the worst case Swing accesses the model to paint the UI while the model is modified on a background thread. This could throw execptions. E.g. IndexOutOfBounds Ideally collect data on the background thread (e.g. in array), pass that data using |
Ok. I'm adjusting JFontComboBox so the model change takes place on the AWT thread too now:
|
Thanks again for your efforts! |
FlatLaf 1.6.5 released |
A user reported the following stack overflow error when installing flatlaf 1.6.4 in our jAlbum product (upgrading from v.0.37 which hade a NPE):
java.lang.StackOverflowError
at com.formdev.flatlaf.ui.FlatComboBoxUI$CellPaddingBorder.getBorderInsets(FlatComboBoxUI.java:852)
at java.desktop/javax.swing.border.AbstractBorder.getBorderInsets(Unknown Source)
at com.formdev.flatlaf.ui.FlatComboBoxUI$CellPaddingBorder.getBorderInsets(FlatComboBoxUI.java:854)
at java.desktop/javax.swing.border.AbstractBorder.getBorderInsets(Unknown Source)
at com.formdev.flatlaf.ui.FlatComboBoxUI$CellPaddingBorder.getBorderInsets(FlatComboBoxUI.java:854)
at java.desktop/javax.swing.border.AbstractBorder.getBorderInsets(Unknown Source)
at com.formdev.flatlaf.ui.FlatComboBoxUI$CellPaddingBorder.getBorderInsets(FlatComboBoxUI.java:854)
at java.desktop/javax.swing.border.AbstractBorder.getBorderInsets(Unknown Source)
at com.formdev.flatlaf.ui.FlatComboBoxUI$CellPaddingBorder.getBorderInsets(FlatComboBoxUI.java:854)
at java.desktop/javax.swing.border.AbstractBorder.getBorderInsets(Unknown Source)
... [hundreds of times]
The text was updated successfully, but these errors were encountered: