Community
Participate
Working Groups
3.0RC2 Build id: 200406111814 Getting from time to time the following sequence of errors while editing. I cannot correlate the errors with any specific action since the edit session seems to be not affected by them and i see the errors only if i look into the log. Yesterday it happend five times, this morning one. !ENTRY org.eclipse.ui 4 4 Jun 16, 2004 11:51:36.850 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 Jun 16, 2004 11:51:36.850 !MESSAGE Failed to execute runnable (java.lang.ArrayIndexOutOfBoundsException: -1) !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.ArrayIndexOutOfBoundsException: -1) at org.eclipse.swt.SWT.error(SWT.java:2691) at org.eclipse.swt.SWT.error(SWT.java:2616) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:109) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2709) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2401) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1362) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1333) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:252) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:334) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:272) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:638) at org.eclipse.core.launcher.Main.main(Main.java:622) !ENTRY org.eclipse.ui 4 4 Jun 16, 2004 11:51:36.850 !MESSAGE *** SWT nested exception !ENTRY org.eclipse.ui 4 0 Jun 16, 2004 11:51:36.866 !MESSAGE -1 !STACK 0 java.lang.ArrayIndexOutOfBoundsException: -1 at org.eclipse.jface.text.rules.BufferedRuleBasedScanner.read(BufferedRuleBasedScanner.java:118) at org.eclipse.jdt.internal.ui.text.CombinedWordRule.evaluate(CombinedWordRule.java:334) at org.eclipse.jface.text.rules.RuleBasedScanner.nextToken(RuleBasedScanner.java:155) at org.eclipse.jdt.internal.ui.text.AbstractJavaScanner.nextToken(AbstractJavaScanner.java:115) at org.eclipse.jface.text.rules.DefaultDamagerRepairer.createPresentation(DefaultDamagerRepairer.java:166) at org.eclipse.jface.text.presentation.PresentationReconciler.createPresentation(PresentationReconciler.java:446) at org.eclipse.jface.text.presentation.PresentationReconciler.processDamage(PresentationReconciler.java:555) at org.eclipse.jface.text.presentation.PresentationReconciler.access$3(PresentationReconciler.java:553) at org.eclipse.jface.text.presentation.PresentationReconciler$InternalListener.textChanged(PresentationReconciler.java:222) at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2235) at org.eclipse.jface.text.TextViewer.fireRedrawChanged(TextViewer.java:4268) at org.eclipse.jface.text.TextViewer.enabledRedrawing(TextViewer.java:4338) at org.eclipse.jface.text.TextViewer.setRedraw(TextViewer.java:4415) at org.eclipse.jface.text.source.projection.ProjectionViewer.catchupWithProjectionAnnotationModel(ProjectionViewer.java:868) at org.eclipse.jface.text.source.projection.ProjectionViewer.access$5(ProjectionViewer.java:821) at org.eclipse.jface.text.source.projection.ProjectionViewer$1.run(ProjectionViewer.java:792) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:106) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2709) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2401) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1362) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1333) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:252) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:334) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:272) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:128) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:638) at org.eclipse.core.launcher.Main.main(Main.java:622)
We cannot fix this without a test case. Reasons why we get the IOOBE: - RuleBasedScanner.setRange directly sets the offset. This method is called from the damager with the damaged region. if getDamagedRegion(...) returns a negative offset then it will also in the scanner (region is not protected against negative values) - some code has more calls to scanner.unread() than to scanner.read()
*** Bug 63836 has been marked as a duplicate of this bug. ***
Daniel, i understand your point, but i cannot reproduce it at will. I keep the error log view opened while editing and when i see popping out the error i try to reply the last actions i did before the error, but up to now i had no luck, it just happens when... it decides to happen.
Do you have advanced highlighting enabled?
Yes i do.
Could you check whether the problem disappears if you disable advanced highlighting?
should fix for RC3
I'll try, but last days i did extensive changes in many classes and it was frequent, now i'm working on the build/deploy part of the project and since yesterday it didn't happen any longer. I'll let you know if it recurs again.
Reviewed by DM. Fixed in HEAD. Will be released in I200406181600. The semantic highlighting uses its own PresentationReconciler in the background thread. Without the fix, the same scanners as in the main thread were used, which can result in more calls to unread() than read(). This would explain the exception. However, a call to setRange(..) with a negative offset could also trigger this. I will open a new PR for adding an assertion to setRange(..) post 3.0.