| Summary: | Code completion gives java.lang.ArrayIndexOutOfBoundsException | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Lars Vogel <Lars.Vogel> |
| Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | amj87.iitr, apanwar, daniel_megert, guismo600, jfibinger, Lars.Vogel, Olivier_Thomann |
| Version: | 3.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Lars Vogel
Code Snippet:
package de.vogella.rcp.plugin.filereader.handler;
import java.util.Enumeration;
import java.util.Iterator;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
public class ReadRessource extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Bundle bundle = Platform.getBundle("org.eclipse.e4.demo.contacts"); //$NON-NLS-1$
Enumeration resources = bundle.getResources("file.txt");
for //HERE I use Ctrl+Space
return null;
}
}
I'll take a look. Potential candidate for 3.6.1 Lars, I couldn't reproduce using your example. Also, I can see from the stack trace that this wouldve happened not when you press CTLR-SPACE, but when you chose some proposal after doing so. And this proposal seems to belong to some method in some external plugin/jar, which has some kind of javadoc which we're unable to process here. Can you please give any other dependencies that your code had, or just the method which you're trying to select before getting this exception, along with the complete set of actions u performed after pressing CTRL-SPACE that lead to this error? Thanks! I'm happy to report that I cannot also not reproduce this anymore in the Eclipse Helios release. Congratulations! :-) (In reply to comment #4) > Lars, I couldn't reproduce using your example. Also, I can see from the stack > trace that this wouldve happened not when you press CTLR-SPACE, but when you > chose some proposal after doing so. And this proposal seems to belong to some > method in some external plugin/jar, which has some kind of javadoc which we're > unable to process here. Can you please give any other dependencies that your > code had, or just the method which you're trying to select before getting this > exception, along with the complete set of actions u performed after pressing > CTRL-SPACE that lead to this error? > > Thanks! I'm very sorry but I have this error in almost brand new Eclipse EE Helios (for x64 Java, Windows 7). I have installed only m2eclipse and nothing more. Imported two little maven projects. This error happens at almost every ctrl+space use. Content assist doesn't work. (In reply to comment #6) > I'm very sorry but I have this error in almost brand new Eclipse EE Helios (for > x64 Java, Windows 7). I have installed only m2eclipse and nothing more. > Imported two little maven projects. This error happens at almost every > ctrl+space use. Content assist doesn't work. Jakub, can you please provide a testcase which can help us reproduce this? Without that I dont think there's much we can do. (In reply to comment #7) > (In reply to comment #6) > > I'm very sorry but I have this error in almost brand new Eclipse EE Helios (for > > x64 Java, Windows 7). I have installed only m2eclipse and nothing more. > > Imported two little maven projects. This error happens at almost every > > ctrl+space use. Content assist doesn't work. > > Jakub, can you please provide a testcase which can help us reproduce this? > Without that I dont think there's much we can do. Yes, of course, I am trying - but this error just stopped appearing. I will try again later. (In reply to comment #8) > Yes, of course, I am trying - but this error just stopped appearing. I will try > again later. Ok. Feel free to reopen this bug and submit a testcase if you are able to reproduce. I am also getting the same error and in every Java file when I am hitting Ctrl+Space (In reply to comment #10) > I am also getting the same error and in every Java file when I am hitting > Ctrl+Space Can you provide steps starting with a new workspace or share your workspace? (In reply to comment #10) > I am also getting the same error and in every Java file when I am hitting > Ctrl+Space I don't see how an AIOOBE can be caused at CharOperation.java:2126. Everything looks ok there. A reproducible test case will help a lot. (In reply to comment #12) > (In reply to comment #10) > > I am also getting the same error and in every Java file when I am hitting > > Ctrl+Space > > I don't see how an AIOOBE can be caused at CharOperation.java:2126. Everything > looks ok there. A reproducible test case will help a lot. Unfortunately the bug is very unpredictable, after I had been experiencing this problem for a few days it just disappeared for no reason and never came back. Hello all (Sorry for my bad english I'm french... :) ) I up this bug because I've it.. Win7 64bits In fact ,at start , completion appear and when i try to change line whith arrows this warning appears: java.lang.ArrayIndexOutOfBoundsException: -1 at org.eclipse.jdt.core.compiler.CharOperation.indexOf(CharOperation.java:2126) at org.eclipse.jdt.core.compiler.CharOperation.indexOf(CharOperation.java:2063) at org.eclipse.jdt.internal.core.JavadocContents.computeChildrenSections(JavadocContents.java:213) at org.eclipse.jdt.internal.core.JavadocContents.computeMethodRange(JavadocContents.java:300) at org.eclipse.jdt.internal.core.JavadocContents.getMethodDoc(JavadocContents.java:126) at org.eclipse.jdt.internal.core.BinaryMethod.getAttachedJavadoc(BinaryMethod.java:560) at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:470) at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:450) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.extractJavadoc(ProposalInfo.java:96) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.computeInfo(ProposalInfo.java:76) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.getInfo(ProposalInfo.java:59) at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.getAdditionalProposalInfo(AbstractJavaCompletionProposal.java:555) at org.eclipse.jface.text.contentassist.AdditionalInfoController$3.run(AdditionalInfoController.java:106) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) ================================================================================ When I try to have press enter... I post the bug log: java.lang.ArrayIndexOutOfBoundsException: -1 at org.eclipse.jdt.core.compiler.CharOperation.indexOf(CharOperation.java:2126) at org.eclipse.jdt.core.compiler.CharOperation.indexOf(CharOperation.java:2063) at org.eclipse.jdt.internal.core.JavadocContents.computeChildrenSections(JavadocContents.java:213) at org.eclipse.jdt.internal.core.JavadocContents.computeMethodRange(JavadocContents.java:300) at org.eclipse.jdt.internal.core.JavadocContents.getMethodDoc(JavadocContents.java:126) at org.eclipse.jdt.internal.core.BinaryMethod.getParameterNames(BinaryMethod.java:254) at org.eclipse.jdt.internal.codeassist.InternalCompletionProposal.findMethodParameterNames(InternalCompletionProposal.java:317) at org.eclipse.jdt.internal.codeassist.InternalCompletionProposal.findParameterNames(InternalCompletionProposal.java:1416) at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.appendUnboundedParameterList(CompletionProposalLabelProvider.java:112) at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.createMethodProposalLabel(CompletionProposalLabelProvider.java:271) at org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.createStyledLabel(CompletionProposalLabelProvider.java:561) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.computeDisplayString(LazyJavaCompletionProposal.java:247) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.getStyledDisplayString(LazyJavaCompletionProposal.java:226) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.handleSetData(CompletionProposalPopup.java:829) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$24(CompletionProposalPopup.java:819) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$3.handleEvent(CompletionProposalPopup.java:583) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Table.checkData(Table.java:1166) at org.eclipse.swt.widgets.Table.wmNotifyChild(Table.java:6595) at org.eclipse.swt.widgets.Control.wmNotify(Control.java:5096) at org.eclipse.swt.widgets.Composite.wmNotify(Composite.java:1887) at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:4726) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4215) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598) at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2362) at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:564) at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:430) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4251) at org.eclipse.swt.widgets.Table.windowProc(Table.java:5779) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2362) at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:564) at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:430) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4251) at org.eclipse.swt.widgets.Table.windowProc(Table.java:5779) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2362) at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:564) at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:430) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4251) at org.eclipse.swt.widgets.Table.windowProc(Table.java:5779) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873) at org.eclipse.swt.internal.win32.OS.SendMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.SendMessage(OS.java:3156) at org.eclipse.swt.widgets.Table.setItemCount(Table.java:4612) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.setProposals(CompletionProposalPopup.java:1109) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.handleRepeatedInvocation(CompletionProposalPopup.java:542) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:506) at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1660) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:182) at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268) at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4160) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) (In reply to comment #14) > Hello all > (Sorry for my bad english I'm french... :) ) > I up this bug because I've it.. > > Win7 64bits > > In fact ,at start , completion appear and when i try to change line whith > arrows > > this warning appears: > > java.lang.ArrayIndexOutOfBoundsException: -1 Hi, I think this is a duplicate of bug 320167 and was fixed for 3.7 Which build are you using? Can you please try the 3.7 build? (In reply to comment #15) > Hi, I think this is a duplicate of bug 320167 and was fixed for 3.7 > Which build are you using? Can you please try the 3.7 build? oops sorry for duplicate! Exact I used an old old version thnx for your answer. It seems fixed. have a good day. |