Bug 123514 - [1.5] [assist]ArrayStoreException in content assist for malformed field
Summary: [1.5] [assist]ArrayStoreException in content assist for malformed field
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-11 17:49 EST by msridhar CLA
Modified: 2006-02-15 04:38 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description msridhar CLA 2006-01-11 17:49:24 EST
I get the following error when using content assist on this test case:

Content Assist: Disabling the "org.eclipse.jdt.ui.JavaNoTypeCompletionProposalComputer" (org.eclipse.jdt.ui.JavaNoTypeCompletionProposalComputer) extension to the "javaCompletionProposalComputer" extension point. Reason: The extension has thrown a runtime exception.

Here is the test case:

import java.util.HashMap;

public class Test1 {

	<T> HashMap
}

To reproduce, place the cursor after HashMap, invoke Content Assist (CTRL+SPACE), and choose the first suggestion.  There is an exception thrown in 3.1.1 as well, but the error message is different.
Comment 1 msridhar CLA 2006-01-11 17:50:21 EST
Oops, forgot to say I'm using version 3.2M4 (I20051215-1506) with GTK2.
Comment 2 Tom Hofmann CLA 2006-01-12 02:29:04 EST
We will yet change the way we react to a failure in a completion proposal computer.

The underlying exception is in jdt-core, see below; moving to jdt-core.

===

java.lang.ArrayStoreException
	at java.lang.System.arraycopy(Native Method)
	at org.eclipse.jdt.internal.compiler.parser.Parser.getTypeReferenceForGenericType(Parser.java:7988)
	at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.getTypeReferenceForGenericType(CompletionParser.java:3300)
	at org.eclipse.jdt.internal.compiler.parser.Parser.getTypeReference(Parser.java:7943)
	at org.eclipse.jdt.internal.codeassist.impl.AssistParser.getTypeReference(AssistParser.java:808)
	at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.attachOrphanCompletionNode(CompletionParser.java:353)
	at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.updateRecoveryState(CompletionParser.java:3687)
	at org.eclipse.jdt.internal.compiler.parser.Parser.resumeOnSyntaxError(Parser.java:9333)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8511)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8730)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8695)
	at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:7488)
	at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.dietParse(CompletionParser.java:3283)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1596)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:125)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:324)
	at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:317)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.internalComputeCompletionProposals(JavaCompletionProposalComputer.java:215)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.addContextInformations(JavaCompletionProposalComputer.java:158)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProposalComputer.computeContextInformation(JavaCompletionProposalComputer.java:182)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeContextInformation(CompletionProposalComputerDescriptor.java:324)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeContextInformation(CompletionProposalCategory.java:277)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectContextInformation(ContentAssistProcessor.java:223)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeContextInformation(ContentAssistProcessor.java:205)
	at org.eclipse.jface.text.contentassist.ContentAssistant.computeContextInformation(ContentAssistant.java:1591)
	at org.eclipse.jface.text.contentassist.ContentAssistSubjectControlAdapter.computeContextInformation(ContentAssistSubjectControlAdapter.java:387)
	at org.eclipse.jface.text.contentassist.ContextInformationPopup.computeContextInformation(ContextInformationPopup.java:389)
	at org.eclipse.jface.text.contentassist.ContextInformationPopup.access$1(ContextInformationPopup.java:388)
	at org.eclipse.jface.text.contentassist.ContextInformationPopup$1.run(ContextInformationPopup.java:186)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.jface.text.contentassist.ContextInformationPopup.showContextProposals(ContextInformationPopup.java:181)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showContextInformation(ContentAssistant.java:1441)
	at org.eclipse.jface.text.source.SourceViewer.doOperation(SourceViewer.java:735)
	at org.eclipse.jface.text.source.projection.ProjectionViewer.doOperation(ProjectionViewer.java:1516)
	at org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.doOperation(JavaSourceViewer.java:177)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:213)
	at org.eclipse.jface.text.link.LinkedModeUI.triggerContextInfo(LinkedModeUI.java:808)
	at org.eclipse.jface.text.link.LinkedModeUI.switchPosition(LinkedModeUI.java:857)
	at org.eclipse.jface.text.link.LinkedModeUI.next(LinkedModeUI.java:790)
	at org.eclipse.jface.text.link.LinkedModeUI.enter(LinkedModeUI.java:709)
	at org.eclipse.jdt.internal.ui.text.java.GenericJavaTypeProposal.installLinkedMode(GenericJavaTypeProposal.java:691)
	at org.eclipse.jdt.internal.ui.text.java.GenericJavaTypeProposal.apply(GenericJavaTypeProposal.java:207)
	at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.apply(AbstractJavaCompletionProposal.java:353)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:682)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.completeCommonPrefix(CompletionProposalPopup.java:1377)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$34(CompletionProposalPopup.java:1301)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$11.run(CompletionProposalPopup.java:1275)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup.incrementalComplete(CompletionProposalPopup.java:1258)
	at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1413)
	at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:190)
	at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:492)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:182)
	at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:341)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:415)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:796)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:843)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:565)
	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:66)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1247)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1083)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1068)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1095)
	at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:649)
	at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2017)
	at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:601)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1407)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3698)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:5027)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1062)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1344)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2741)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1790)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1754)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:403)
	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:381)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:585)
	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)
Comment 3 David Audel CLA 2006-01-18 09:03:28 EST
Fixed and test added
  GenericsCompletionParserTest#test0205()

CompletionParser must override consumeTypeParameter1() and not consumeTypeParameters1()
Comment 4 Frederic Fusier CLA 2006-02-15 04:38:35 EST
Verified for 3.2 M5 using build I20060215-0010.