Community
Participate
Working Groups
I20051214-0800 1. create a CU like this: /** * Toy */ public class Toy { // copy line (Ctrl+Alt+Arrow_Down } 2. copy the single line comment several times (let's say 10x) 3. select from the last single line comment to just after Toy in the Javadoc 4. now quickly press Backspace and Ctrl+Space ==> AIOOBE (see below) This happens because the model is not yet reconciled but access the already changed buffer with invalid offset/length. !ENTRY org.eclipse.ui 4 0 2005-12-14 17:42:01.434 !MESSAGE Failed to execute runnable (java.lang.ArrayIndexOutOfBoundsException) !STACK 0 org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.ArrayIndexOutOfBoundsException) at org.eclipse.swt.SWT.error(SWT.java:3283) at org.eclipse.swt.SWT.error(SWT.java:3206) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3218) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2864) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1762) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1726) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:397) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:109) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: java.lang.ArrayIndexOutOfBoundsException at org.eclipse.jdt.internal.ui.javaeditor.DocumentAdapter.getText(DocumentAdapter.java:317) at org.eclipse.jdt.internal.core.Member.getJavadocRange(Member.java:261) at org.eclipse.jdt.ui.JavadocContentAccess.getContentReader(JavadocContentAccess.java:59) at org.eclipse.jdt.ui.JavadocContentAccess.getHTMLContentReader(JavadocContentAccess.java:117) at org.eclipse.jdt.internal.ui.text.java.MemberProposalInfo.extractJavadoc(MemberProposalInfo.java:102) at org.eclipse.jdt.internal.ui.text.java.MemberProposalInfo.computeInfo(MemberProposalInfo.java:81) at org.eclipse.jdt.internal.ui.text.java.MemberProposalInfo.getInfo(MemberProposalInfo.java:68) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.getAdditionalProposalInfo(LazyJavaCompletionProposal.java:180) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation(AdditionalInfoController.java:221) at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(AbstractInformationControlManager.java:820) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation(AbstractInformationControlManager.java:810) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run(AdditionalInfoController.java:173) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) ... 20 more
I never succeeded to get this AIOOBE strictly following your scenario... I tried with a small example as suggested and also with our biggest CU (Parser.java) to have long time for reconciling. I even launched a full build of my workspace to slow my box but never got it... Are you able to reproduce easily? How fast should I need to be between step 3 and 4?
I guess this is with 3.2...
The member needs to check if the compilation is consistent before returning the javadoc range. I am working on a fix. Would null be acceptable in this case?
Created attachment 31757 [details] Proposed fix Dani, could you please give it a try?
Created attachment 31758 [details] Regression test
Fixed and released in HEAD. Regression test added in org.eclipse.jdt.core.tests.model.CompilationUnitTests.test120902
Applied patch on HEAD of JDT Core and it works for me. Thanks.
Verified with I20051214-1600 for 3.2M4