netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

java.lang.ArrayIndexOutOfBoundsException.

Open JQL opened this issue 1 year ago • 6 comments

Apache NetBeans version

Apache NetBeans 20

What happened

While editing a Markdown File and saving it the error occurred (java.lang.ArrayIndexOutOfBoundsException).

Language / Project Type / NetBeans Component

Markdown

How to reproduce

Create and edit a Markdown file then save it.

Did this work correctly in an earlier version?

Apache NetBeans 19

Operating System

Linux version 5.4.0-150-generic running on amd64; UTF-8; en_GB (nb)

JDK

17.0.7; OpenJDK 64-Bit Server VM 17.0.7+7-Ubuntu-0ubuntu118.04

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else


java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.desktop/javax.swing.text.BoxView.getOffset(BoxView.java:1102)
	at java.desktop/javax.swing.text.BoxView.childAllocation(BoxView.java:696)
	at java.desktop/javax.swing.text.CompositeView.getChildAllocation(CompositeView.java:234)
	at java.desktop/javax.swing.text.BoxView.getChildAllocation(BoxView.java:454)
	at java.desktop/javax.swing.plaf.basic.BasicTextUI$UpdateHandler.calculateViewPosition(BasicTextUI.java:2111)
	at java.desktop/javax.swing.plaf.basic.BasicTextUI$UpdateHandler.layoutContainer(BasicTextUI.java:2087)
	at java.desktop/java.awt.Container.layout(Container.java:1541)
	at java.desktop/java.awt.Container.doLayout(Container.java:1530)
	at java.desktop/java.awt.Container.validateTree(Container.java:1725)
	at java.desktop/java.awt.Container.validateTree(Container.java:1734)
	at java.desktop/java.awt.Container.validateTree(Container.java:1734)
	at java.desktop/java.awt.Container.validate(Container.java:1660)
	at java.desktop/javax.swing.RepaintManager$3.run(RepaintManager.java:757)
	at java.desktop/javax.swing.RepaintManager$3.run(RepaintManager.java:755)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:754)
	at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1897)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
[catch] at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Are you willing to submit a pull request?

No

JQL avatar Jan 17 '24 10:01 JQL

Is this reproducible? What text was entered. What are steps to reproduce? The current provided steps are neither helpful nor correct. Tested on Ubuntu with bundled JDK and NB20, works for me.

matthiasblaesing avatar Jan 17 '24 16:01 matthiasblaesing

Matthias,

Now it happens whenever I save any Markdown file in the project.

Best regards, John @.***

On Wed, Jan 17, 2024 at 5:50 PM Matthias Bläsing @.***> wrote:

Is this reproducible? What text was entered. What are steps to reproduce? The current provided steps are neither helpful nor correct. Tested on Ubuntu with bundled JDK and NB20, works for me.

— Reply to this email directly, view it on GitHub https://github.com/apache/netbeans/issues/6965#issuecomment-1896207100, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHTSVLGRM4XDVEFMDU7TLYO76ONAVCNFSM6AAAAABB6I46U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJWGIYDOMJQGA . You are receiving this because you authored the thread.Message ID: @.***>

JQL avatar Jan 17 '24 17:01 JQL

Please update your JDK 17.0.7 is not current anymore. Please also check against an upstream build (Amazon Corretto for example).

matthiasblaesing avatar Jan 17 '24 17:01 matthiasblaesing

I tried deleting ~/.cache/netbeans/20/index and this fixed the problem.

It seems that these indexes are being corrupted on a regular basis as this is the second time in about a month I've had to do this.

JQL avatar Jan 26 '24 17:01 JQL

You are seeing a correlation, but I doubt, that there is a cause-chain we are seeing here. Indexing is its own problematic field, but there is no connection between markdown rendering and the indexing system.

matthiasblaesing avatar Jan 26 '24 17:01 matthiasblaesing

It's not the rendering but the saving of the file which caused the error message. In over 40 years of chasing bugs in code I've found that coincidences merit checking.

JQL avatar Jan 26 '24 17:01 JQL

closing, feel free to reopen if there is a reproducer

mbien avatar May 23 '24 06:05 mbien