multi-threaded use of GlyphIcon throws NullPointer during CSS parsing

Issue #42 open
Klein-Robbenhaar created an issue

GlyphIcon use the CSS-Parser in a static way. Multithreaded use of GlyphIcon throws an NullPointer-Exception in the method "convert". The FXMLLoader calls the method "convert" multiple times / sometimes at the same time that shows e.g. such a warning:

Sep 13, 2016 10:17:33 AM com.sun.javafx.css.parser.CSSParser term WARNUNG: CSS Error parsing ': 2em;: Unexpected token 'EOF' at [-1,-1] Sep 13, 2016 10:17:33 AM com.sun.javafx.css.parser.CSSParser parseExpr WARNUNG: ": 2em;" Expected value for property '': 2em;

and then throws an exception at:

Caused by: java.lang.NullPointerException: null at de.jensd.fx.glyphs.GlyphIcon.convert(GlyphIcon.java:223)

public Number convert(String sizeString) { ParsedValueImpl parsedValueImpl = CSS_PARSER.parseExpr("", sizeString); (223) return (Number) parsedValueImpl.convert(getFont()); }

Comments (2)

  1. Fabian Kasper

    I'm having the same issue when accessing the GlyphsBuilder from multiple threads. When restricting access to the builder to the JavaFX application thread it seems to work.

    I'm using fontawesomefx 8.9 on Java 1.8.0_112-b15

  2. Log in to comment