Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

StackOverflowError #1

Closed
DennisdeW opened this issue Jan 15, 2015 · 2 comments
Closed

StackOverflowError #1

DennisdeW opened this issue Jan 15, 2015 · 2 comments

Comments

@DennisdeW
Copy link

I am using RichTextFX in my project, but I am having an issue which seems to be contained to Flowless:

I use the following code to append a certain message in bold font:

private InlineCssTextArea text;

//....
    //In constructor
    text = new InlineCssTextArea();
    text.setWrapText(true);
//....

public void appendBold(String msg) {
    Platform.runLater(() -> {
        int curPos = text.getText().length(); //The index of the first new character
        int endPos = msg.length() + curPos - 1; //The index of the last new character
        text.appendText(msg);
        text.setStyle(curPos, endPos, "-fx-font-weight: bold;");            
   });
}

(I have two other, similar methods for italic and normal fonts)
This usually works, but sometimes it fails with a StackOverflowError, where the following section of stacktrace repeats continuously:

at org.fxmisc.flowless.VirtualFlow$$Lambda$238/562912964.invalidated(Unknown Source)
    at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
    at javafx.beans.binding.DoubleBinding.invalidate(DoubleBinding.java:222)
    at com.sun.javafx.binding.BindingHelperObserver.invalidated(BindingHelperObserver.java:51)
    at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
    at javafx.beans.binding.DoubleBinding.invalidate(DoubleBinding.java:222)
    at org.fxmisc.flowless.VirtualFlowContent.setLengthOffset(VirtualFlow.java:1426)
    at org.fxmisc.flowless.VirtualFlowContent.setLengthPosition(VirtualFlow.java:608)
    at org.fxmisc.flowless.VerticalFlowMetrics.setVerticalPosition(VirtualFlow.java:1848)
    at org.fxmisc.flowless.VirtualFlow.lambda$new$3(VirtualFlow.java:217)
    at org.fxmisc.flowless.VirtualFlow$$Lambda$240/1469374270.changed(Unknown Source)
    at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:361)
    at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
    at javafx.beans.property.DoublePropertyBase.fireValueChangedEvent(DoublePropertyBase.java:106)
    at javafx.beans.property.DoublePropertyBase.markInvalid(DoublePropertyBase.java:113)
    at javafx.beans.property.DoublePropertyBase.set(DoublePropertyBase.java:146)
    at javafx.scene.control.ScrollBar.setValue(ScrollBar.java:151)
    at org.fxmisc.flowless.VirtualFlow.lambda$new$1(VirtualFlow.java:211)

I can not find any common factor between the instances where this error occurs, so I'm not sure if you can help me with this, but I would very much appreciate it if you could have a look.

@TomasMikula
Copy link
Member

Are you able to provide a self-contained example, or test with the current version (0.6) of RichTextFX?

@TomasMikula
Copy link
Member

Closing as I cannot reproduce this in the current version.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants