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:62) #2765

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

Comments

@iloveeclipse
Copy link
Member

Just got this stack while switching from one debugger frame to another (and so selecting different part of the same editor).
So the fix for #2750 was incomplete :-(

eclipse.buildId=4.35.0.I20250129-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 -data /data/4x_platform_workspace

org.eclipse.ui
Error
Thu Jan 30 08:25:11 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:62)
	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:1271)
	at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.initialize(DefaultJavaFoldingStructureProvider.java:1149)
	at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider.handleProjectionEnabled(DefaultJavaFoldingStructureProvider.java:1119)
	at org.eclipse.jdt.ui.text.folding.DefaultJavaFoldingStructureProvider$ProjectionListener.projectionEnabled(DefaultJavaFoldingStructureProvider.java:979)
	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.ui.internal.WorkbenchPage.reuseEditor(WorkbenchPage.java:3060)
	at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.openEditor(SourceLookupFacility.java:433)
	at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.display(SourceLookupFacility.java:370)
	at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility$SourceDisplayJob.runInUIThread(SourceLookupFacility.java:884)
	at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:148)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5042)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4522)

@iloveeclipse iloveeclipse added bug Something isn't working regression labels Jan 30, 2025
@iloveeclipse iloveeclipse added this to the 4.35 M3 milestone Jan 30, 2025
@iloveeclipse
Copy link
Member Author

@Christopher-Hermann : could you please check? Thanks.

@Christopher-Hermann
Copy link
Contributor

Yes, sure. I guess that it should be a >= here: https://github.com/eclipse-platform/eclipse.platform.ui/blob/55481d318604550e40517f3f6d5c984d331ef3c0/bundles/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/stickyscroll/StickyLine.java#L58C3-L58C54
I will check this one

Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.ui that referenced this issue Jan 31, 2025
…ine number

Handle cases where the sticky line number exceeds the total number of lines to prevent out of bounds errors. Since widgetLineNumber is 0-based, ensure it is not equal to or greater than the line count.

Fixes eclipse-platform#2765
Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.ui that referenced this issue Jan 31, 2025
…ine number

Handle cases where the sticky line number exceeds the total number of lines to prevent out of bounds errors. Since widgetLineNumber is 0-based, ensure it is not equal to or greater than the line count.

Fixes eclipse-platform#2765
Christopher-Hermann added a commit to Christopher-Hermann/eclipse.platform.ui that referenced this issue Jan 31, 2025
…ine number

Handle cases where the sticky line number exceeds the total number of lines to prevent out of bounds errors. Since widgetLineNumber is 0-based, ensure it is not equal to or greater than the line count.

Fixes eclipse-platform#2765
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
2 participants