Stack overflow in GlyphIcon running on java 11 in 9.1.2

Issue #66 new
Keith Campbell created an issue

Thank you for developing fontawsesomefx :-)

The method:

public final void setGlyphStyle(String style)

Is causing a stack overflow error in some circumstances when running on Java 11. In particular, when trying to add a style, it just concatenates the style to the existing style, which then causes a refresh, which then causes a style changed event, when then appends again, and so forth. I get both stack overflow and out of memory exceptions from this issue.

I made the following change to this method, which seems to resolve the issue. Perhaps you can integrate and release a 9.1.3?

public final void setGlyphStyle(String style) {
    if (!getGlyphStyle().isEmpty() && getGlyphStyle().contains(style)) {
        return;
    }
    if (!getGlyphStyle().isEmpty() && !getGlyphStyle().endsWith(";")) {
        style = ";".concat(style);
    }
    glyphStyleProperty().setValue(getGlyphStyle().concat(style));
}

fa-overflow.png

Comments (4)

  1. Fabian Kasper

    I seemed to miss that there was an update to version 11.0. But the bug still persists in 11.0. Here is the full stack trace (if anybody cares).

  2. Log in to comment