Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317889 - [cdt] Autocomplete doesn't work on return value type for static typedef
Summary: [cdt] Autocomplete doesn't work on return value type for static typedef
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 3.4   Edit
Hardware: All Linux
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Shawn Minto CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-24 18:07 EDT by Nathan Baker CLA
Modified: 2010-07-12 13:26 EDT (History)
1 user (show)

See Also:


Attachments
Screenshot of the problem (101.48 KB, image/png)
2010-06-24 18:07 EDT, Nathan Baker CLA
no flags Details
Log file for parser (97.02 KB, application/octet-stream)
2010-06-25 10:00 EDT, Nathan Baker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Baker CLA 2010-06-24 18:07:05 EDT
Build Identifier: 20100617-1415

I created an enum called 'bar_t'. Then I created a static function foo, returning a bar_t. When I tried to set the return type, I typed 'bar' and pressed Ctrl+Space, but the popup said that nothing was found, and the status bar at the bottom said "java.lang.ArrayIndexOutOfBoundsException: 0".



Reproducible: Always

Steps to Reproduce:
See above
Comment 1 Nathan Baker CLA 2010-06-24 18:07:41 EDT
Created attachment 172694 [details]
Screenshot of the problem
Comment 2 Markus Schorn CLA 2010-06-25 04:18:20 EDT
I cannot reproduce the problem with the following code:
  typedef enum {a, b, c,} rid_data_status_t;
  static rid

Please provide the following things:
* The stack-trace for the exception if it can be found in the log-file
* A sample source file with which you can reproduce the issue.
* A parser log for the file (context menu of file in project explorer - Index - 
  Create Parser Log File)
Comment 3 Nathan Baker CLA 2010-06-25 10:00:30 EDT
Created attachment 172753 [details]
Log file for parser
Comment 4 Nathan Baker CLA 2010-06-25 10:00:53 EDT
Sorry for not providing enough information yesterday.

Log/stack trace:
ava.lang.ArrayIndexOutOfBoundsException: 0
at org.eclipse.mylyn.internal.cdt.ui.contentassist.DOMCompletionProposalComputer.getCElement(DOMCompletionProposalComputer.java:577)
at org.eclipse.mylyn.internal.cdt.ui.contentassist.DOMCompletionProposalComputer.handleBinding(DOMCompletionProposalComputer.java:307)
at org.eclipse.mylyn.internal.cdt.ui.contentassist.DOMCompletionProposalComputer.computeCompletionProposals(DOMCompletionProposalComputer.java:142)
at org.eclipse.cdt.internal.ui.text.contentassist.ParsingBasedProposalComputer.computeCompletionProposals(ParsingBasedProposalComputer.java:55)
at org.eclipse.mylyn.internal.cdt.ui.contentassist.FocusedDOMCompletionProposalComputer.computeCompletionProposals(FocusedDOMCompletionProposalComputer.java:38)
at org.eclipse.cdt.internal.ui.text.contentassist.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:300)
at org.eclipse.cdt.internal.ui.text.contentassist.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:261)
at org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:267)
at org.eclipse.cdt.internal.ui.text.contentassist.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:220)
at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1834)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:556)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:553)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup$14.run(CompletionProposalPopup.java:1542)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.incrementalComplete(CompletionProposalPopup.java:1536)
at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1659)
at org.eclipse.cdt.internal.ui.editor.CEditor$AdaptedSourceViewer.doOperation(CEditor.java:328)
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:1525)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1257)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1294)
at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.java:730)
at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control.java:2839)
at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Composite.java:734)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1743)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4794)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4372)
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:8163)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1239)
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:2224)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3169)
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(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
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)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

Session Data:
eclipse.buildId=I20100608-0911
java.version=1.6.0_17
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.cpp.product
Command-line arguments:  -data /u/nathanb/src/workspaces/sj -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.cpp.product

This is a continuation of log file /u/nathanb/src/workspaces/sj/.metadata/.bak_0.log
Created Time: 2010-06-24 17:57:56.577

I will add the parser log as an attachment.
Comment 5 Markus Schorn CLA 2010-06-28 11:05:11 EDT
Pretty obvious bug in org.eclipse.mylyn.internal.cdt.ui.contentassist.DOMCompletionProposalComputer
Comment 6 Shawn Minto CLA 2010-07-07 11:28:23 EDT
Hi Nathan,  I was unable to actually reproduce the problem, but found the the cause of this problem.  I will backport this change to Mylyn 3.4.1 so that other users do not run into this problem.  I will let you know when the build is available to confirm.
Comment 7 Shawn Minto CLA 2010-07-07 11:30:24 EDT
This has now been backported to the Mylyn 3.4.1 branch.
Comment 8 Nathan Baker CLA 2010-07-12 10:48:08 EDT
I don't see it showing up as an available update. Is there something I need to do to get this fix?
Comment 9 Shawn Minto CLA 2010-07-12 11:12:48 EDT
Hi Nathan,  We haven't released a weekly update with this fix yet to my knowledege and I can let you know when it is available.
Comment 10 Steffen Pingel CLA 2010-07-12 13:19:39 EDT
I have published an updated build that is now available from the maintenance update site: http://download.eclipse.org/tools/mylyn/update/maintenance . Please let us know if that resolves the described problem.
Comment 11 Nathan Baker CLA 2010-07-12 13:26:54 EDT
I do not observe the problem any more.

Thanks!

Nathan