aldobrucale opened a new issue, #4786:
URL: https://github.com/apache/netbeans/issues/4786
### Apache NetBeans version
Apache NetBeans 15
### What happened
I often notice a javax.swing.text.BadLocationException in the IDE log. I'm
not sure if there are other side effects other than that. This is happening
since a few versions of Netbeans, I couldn't tell exactly which was the last
version that didn' thave this problem.
### How to reproduce
It seems to happen randomly, sometimes as NB starts
### Did this work correctly in an earlier version?
Apache NetBeans 12.6
### Operating System
Ubuntu 22.04
### JDK
OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode,
sharing)
### Apache NetBeans packaging
Apache NetBeans Snap Package
### Anything else
This is the full stacktrace:
```
javax.swing.text.BadLocationException: Invalid offset=-1 < 0; docLen=2331
at
org.netbeans.modules.editor.lib2.document.EditorDocumentContent.checkOffsetNonNegative(EditorDocumentContent.java:246)
at
org.netbeans.modules.editor.lib2.document.EditorDocumentContent.checkOffsetInContent(EditorDocumentContent.java:259)
at
org.netbeans.modules.editor.lib2.document.EditorDocumentContent.createPosition(EditorDocumentContent.java:173)
at
java.desktop/javax.swing.text.AbstractDocument.createPosition(AbstractDocument.java:861)
at
org.netbeans.modules.editor.lib2.view.OffsetRegion.createPos(OffsetRegion.java:58)
Caused: java.lang.IllegalArgumentException: Invalid offset=-1 in doc:
org.netbeans.modules.editor.NbEditorDocument@6a2405e, mimeType='text/x-java',
kitClass=null, length=2331, version=1,
file=org.netbeans.modules.java.JavaDataObject@63954885[/home/aldo/develop/teko/omc/omc-all/omc-notification/src/main/java/omc/notification/AlarmReportService.java@d6ed7b05:3adf6790]
at
org.netbeans.modules.editor.lib2.view.OffsetRegion.createPos(OffsetRegion.java:60)
at
org.netbeans.modules.editor.lib2.view.OffsetRegion.create(OffsetRegion.java:36)
at
org.netbeans.modules.editor.lib2.view.OffsetRegion.union(OffsetRegion.java:49)
at
org.netbeans.modules.editor.lib2.view.ViewUpdates.viewFactoryChanged(ViewUpdates.java:356)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:462)
at jdk.proxy20/jdk.proxy20.$Proxy59.viewFactoryChanged(Unknown Source)
at
org.netbeans.modules.editor.lib2.view.EditorViewFactory.fireEvent(EditorViewFactory.java:235)
at
org.netbeans.modules.editor.lib2.view.HighlightsViewFactory$1.run(HighlightsViewFactory.java:373)
at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1402)
at
org.netbeans.modules.editor.lib2.view.HighlightsViewFactory.highlightChanged(HighlightsViewFactory.java:347)
at jdk.internal.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:462)
at jdk.proxy20/jdk.proxy20.$Proxy57.highlightChanged(Unknown Source)
at
org.netbeans.modules.editor.lib2.highlighting.DirectMergeContainer.highlightChanged(DirectMergeContainer.java:120)
at jdk.internal.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at
org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:462)
at jdk.proxy20/jdk.proxy20.$Proxy57.highlightChanged(Unknown Source)
at
org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer.fireHighlightsChange(AbstractHighlightsContainer.java:88)
at
org.netbeans.spi.editor.highlighting.support.OffsetsBag.setHighlights(OffsetsBag.java:282)
at
org.netbeans.modules.java.editor.semantic.SemanticHighlighter$1$1.run(SemanticHighlighter.java:79)
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
### Code of Conduct
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists