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

[StickyScrolling] IllegalArgumentException below StickyLine.getStyleRanges(StickyLine.java:56) #2750

Open
iloveeclipse opened this issue Jan 23, 2025 · 2 comments · May be fixed by #2757
Open
Assignees
Labels
bug Something isn't working regression

Comments

@iloveeclipse
Copy link
Member

Found this in the log. No idea how to reproduce.
The stack points to a regression from f082218.

eclipse.buildId=4.35.0.I20250121-1800
java.version=21.0.2-13
java.vendor=N/A
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

org.eclipse.ui
Error
Thu Jan 23 07:23:30 CET 2025
Unhandled event loop exception

java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:4913)
	at org.eclipse.swt.SWT.error(SWT.java:4847)
	at org.eclipse.swt.SWT.error(SWT.java:4818)
	at org.eclipse.swt.custom.StyledText.getOffsetAtLine(StyledText.java:4062)
	at org.eclipse.ui.internal.texteditor.stickyscroll.StickyLine.getStyleRanges(StickyLine.java:56)
	at org.eclipse.ui.internal.texteditor.stickyscroll.StickyScrollingControl.styleStickyLines(StickyScrollingControl.java:239)
	at org.eclipse.ui.internal.texteditor.stickyscroll.StickyScrollingControl.updateStickyScrollingControls(StickyScrollingControl.java:217)
	at org.eclipse.ui.internal.texteditor.stickyscroll.StickyScrollingControl.limitVisibleStickyLinesToTextWidgetHeight(StickyScrollingControl.java:456)
	at org.eclipse.ui.internal.texteditor.stickyscroll.StickyScrollingControl$1.controlResized(StickyScrollingControl.java:416)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:273)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5857)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1652)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1678)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1657)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:1211)
	at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1658)
	at org.eclipse.swt.widgets.Canvas.setBounds(Canvas.java:457)
	at org.eclipse.swt.widgets.Control.setBounds(Control.java:1019)
	at org.eclipse.jface.text.source.SourceViewer$RulerLayout.layout(SourceViewer.java:168)
	at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1877)
	at org.eclipse.swt.widgets.Composite.layout(Composite.java:1179)
	at org.eclipse.swt.widgets.Composite.layout(Composite.java:1131)
	at org.eclipse.jface.text.source.LineNumberRulerColumn.layout(LineNumberRulerColumn.java:538)
	at org.eclipse.jface.text.source.LineNumberRulerColumn$InternalListener.textChanged(LineNumberRulerColumn.java:78)
	at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2795)
	at org.eclipse.jface.text.TextViewer.invalidateTextPresentation(TextViewer.java:3415)
	at org.eclipse.jface.text.TextViewer.initializeWidgetContents(TextViewer.java:3463)
	at org.eclipse.jface.text.TextViewer.setVisibleDocument(TextViewer.java:3502)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.setVisibleDocument(ProjectionViewer.java:700)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.setVisibleDocument(JavaSourceViewer.java:646)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.executeReplaceVisibleDocument(ProjectionViewer.java:755)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.replaceVisibleDocument(ProjectionViewer.java:743)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.reinitializeProjection(ProjectionViewer.java:1221)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.catchupWithProjectionAnnotationModel(ProjectionViewer.java:937)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.processCatchupRequest(ProjectionViewer.java:857)
	at org.eclipse.jface.text.source.projection.ProjectionViewer$AnnotationModelListener.processModelChanged(ProjectionViewer.java:122)
	at org.eclipse.jface.text.source.projection.ProjectionViewer$AnnotationModelListener.modelChanged(ProjectionViewer.java:114)
	at org.eclipse.jface.text.source.AnnotationModel.fireModelChanged(AnnotationModel.java:592)
	at org.eclipse.jface.text.source.AnnotationModel$InternalModelListener.modelChanged(AnnotationModel.java:256)
	at org.eclipse.jface.text.source.AnnotationModel.fireModelChanged(AnnotationModel.java:592)
	at org.eclipse.jface.text.source.AnnotationModel.fireModelChanged(AnnotationModel.java:558)
	at org.eclipse.jface.text.source.projection.ProjectionAnnotationModel.modifyAnnotations(ProjectionAnnotationModel.java:192)
	at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.update(DefaultJavaFoldingStructureProvider.java:987)
	at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.initialize(DefaultJavaFoldingStructureProvider.java:864)
	at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.handleProjectionEnabled(DefaultJavaFoldingStructureProvider.java:834)
	at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider$ProjectionListener.projectionEnabled(DefaultJavaFoldingStructureProvider.java:712)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.fireProjectionEnabled(ProjectionViewer.java:475)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.enableProjection(ProjectionViewer.java:523)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.setVisibleDocument(JavaSourceViewer.java:639)
	at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2891)
	at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:683)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:368)
	at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:633)
	at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:3990)
	at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4193)
	at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:262)
	at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1526)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.internalDoSetInput(JavaEditor.java:2567)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2554)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1410)
	at org.eclipse.ui.texteditor.AbstractTextEditor.setInputWithNotify(AbstractTextEditor.java:4249)
	at org.eclipse.ui.texteditor.AbstractTextEditor.setInput(AbstractTextEditor.java:4269)
	at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.showInEditor(JavaSearchEditorOpener.java:99)
	at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.showWithReuse(JavaSearchEditorOpener.java:78)
	at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.openElement(JavaSearchEditorOpener.java:43)
	at org.eclipse.jdt.internal.ui.search.JavaSearchEditorOpener.openMatch(JavaSearchEditorOpener.java:55)
	at org.eclipse.jdt.internal.ui.search.JavaSearchResultPage.showMatch(JavaSearchResultPage.java:197)
	at org.eclipse.search.ui.text.AbstractTextSearchViewPage$3.run(AbstractTextSearchViewPage.java:938)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.search.ui.text.AbstractTextSearchViewPage.showMatch(AbstractTextSearchViewPage.java:941)
	at org.eclipse.search.ui.text.AbstractTextSearchViewPage.showCurrentMatch(AbstractTextSearchViewPage.java:1006)
	at org.eclipse.search.ui.text.AbstractTextSearchViewPage.gotoNextMatch(AbstractTextSearchViewPage.java:971)
	at org.eclipse.search.ui.text.AbstractTextSearchViewPage.handleOpen(AbstractTextSearchViewPage.java:1428)
	at org.eclipse.jdt.internal.ui.search.JavaSearchResultPage.handleOpen(JavaSearchResultPage.java:567)
	at org.eclipse.search.ui.text.AbstractTextSearchViewPage$2.open(AbstractTextSearchViewPage.java:765)
	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:799)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:796)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1110)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:295)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:330)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5857)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1652)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5067)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4519)

@Christopher-Hermann : please check.

@iloveeclipse iloveeclipse added bug Something isn't working regression labels Jan 23, 2025
@jukzi
Copy link
Contributor

jukzi commented Jan 23, 2025

Was supposed to be fixed with #2678

@Christopher-Hermann
Copy link
Contributor

I checked the logs in my IDE for the past few days but was unable to see or reproduce the error.
I have created a pull request that addresses potential out-of-bound errors when styling the sticky notes. However, since the root cause of the issue remains unclear, I'm uncertain whether we should proceed with merging this fix.
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression
Projects
None yet
3 participants