Skip to content
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

LineNumberFactory causes ArrayIndexOutOfBoundsException in JavaFX Application Thread. #76

Closed
O5ten opened this issue Aug 13, 2014 · 2 comments

Comments

@O5ten
Copy link

O5ten commented Aug 13, 2014

Hello Tomas,

I'm writing a tiny little live-updating SwingBuilder/MigLayout-editor for Groovy.

The primary use of RichTextFX is to make the editor easier to edit and read with the syntax-highlighting as well as LineNumbering in CodeArea.

The issue:
I'm running the app using Java 8 u11 in both Windows 7 x64 and Linux Mint 17 and i get an following ArrayIndexOutOfBoundsException when trying to use the LineNumberFactory as shown below.

        codeArea.setParagraphGraphicFactory(LineNumberFactory.get(codeArea));

The exception does not seem to originate from the LineNumberFactory but does not occur when i remove the line-numbering from the app.

The exception looks as follows. In Linux it occurs whenever i start the app, in Windows it occurs whenever i start fiddling around with the example-code the app gives.

Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(ArrayList.java:403)
    at java.util.ArrayList.get(ArrayList.java:416)
    at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:87)
    at com.sun.javafx.collections.VetoableListDecorator.get(VetoableListDecorator.java:265)
    at javafx.scene.Parent.updateCachedBounds(Parent.java:1593)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1537)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1388)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3028)
    at javafx.scene.Node.updateGeomBounds(Node.java:3526)
    at javafx.scene.Node.getGeomBounds(Node.java:3479)
    at javafx.scene.Node.getLocalBounds(Node.java:3427)
    at javafx.scene.Node.updateTxBounds(Node.java:3590)
    at javafx.scene.Node.getTransformedBounds(Node.java:3373)
    at javafx.scene.Node.updateBounds(Node.java:519)
    at javafx.scene.Parent.updateBounds(Parent.java:1722)
    at javafx.scene.Parent.updateBounds(Parent.java:1720)
    at javafx.scene.Parent.updateBounds(Parent.java:1720)
    at javafx.scene.Parent.updateBounds(Parent.java:1720)
    at javafx.scene.Parent.updateBounds(Parent.java:1720)
    at javafx.scene.Parent.updateBounds(Parent.java:1720)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2391)
    at com.sun.javafx.tk.Toolkit$3.run(Toolkit.java:321)
    at com.sun.javafx.tk.Toolkit$3.run(Toolkit.java:319)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:319)
    at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:348)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:479)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
    at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
    at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
    at java.lang.Thread.run(Thread.java:745)

Any suggestions?

Best regards,
Mikael

@TomasMikula
Copy link
Member

Hi Mikael,

what version of RichTextFX are you using? I fixed a similar problem last night, in version 0.4.2.

Tomas

@O5ten
Copy link
Author

O5ten commented Aug 13, 2014

0.4.1, just tested with 0.4.2 and it works fine. Thanks for the quick response!

@O5ten O5ten closed this as completed Aug 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants