Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338594

Summary: The "Problem During Content Assist" dialog pops up whenever contents assist is invoked.
Product: z_Archived Reporter: Antonel Ernest Pazargic <antonel.pazargic>
Component: RecommendersAssignee: Marcel Bruch <marcel.bruch>
Status: CLOSED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: stefan.henss
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Some handcrafted templates none

Description Antonel Ernest Pazargic CLA 2011-03-01 17:01:11 EST
Eclipse SDK - 3.6.2
Eclipse Code Recommenders - 0.2.0.v20110301-1050-b249 

Whenever I am using the content assist (CTRL-SPACE) in Eclipse SDK, the content assist problem dialog is shown, and the following warning message is added in Error log.

==========================================================
Message: 

The 'Code Recommenders Calls Proposals' proposal computer from the 'org.eclipse.recommenders.rcp.codecompletion.calls' plug-in did not complete normally. The extension has thrown a runtime exception.

Exception Stack Trace:


smile.SMILEException: SMILE error -2 in function ClearEvidence
	at smile.Network.clearEvidence(Native Method)
	at org.eclipse.recommenders.internal.rcp.codecompletion.calls.net.AbstractNode.clearEvidence(AbstractNode.java:68)
	at org.eclipse.recommenders.internal.rcp.codecompletion.calls.net.ContextNode.setContext(ContextNode.java:82)
	at org.eclipse.recommenders.internal.rcp.codecompletion.calls.net.ObjectMethodCallsNet.setMethodContext(ObjectMethodCallsNet.java:139)
	at org.eclipse.recommenders.internal.rcp.codecompletion.calls.CallsCompletionProposalComputer.findRecommendations(CallsCompletionProposalComputer.java:160)
	at org.eclipse.recommenders.internal.rcp.codecompletion.calls.CallsCompletionProposalComputer.computeProposals(CallsCompletionProposalComputer.java:118)
	at org.eclipse.recommenders.internal.rcp.codecompletion.calls.CallsCompletionProposalComputer.computeCompletionProposals(CallsCompletionProposalComputer.java:98)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:316)
	at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:264)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:286)
	at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:246)
	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.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:4270)
	at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4162)
	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:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	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:620)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Comment 1 Marcel Bruch CLA 2011-03-02 01:50:18 EST
*** Bug 338613 has been marked as a duplicate of this bug. ***
Comment 2 Marcel Bruch CLA 2011-03-02 04:52:53 EST
We failed to reproduce this on mac32/64 and win64. Could you provide some additional information?
If you could attache an example code snippet or even better and an example project this may enable us to reproduce.

However, to eliminate these popups we added an additional catch clause to clearEvidence(). At least the popup should be gone now. This emergency fix is available on the update site. 

Thanks for reporting thanks for helping us to hunt this bug down.
Marcel
Comment 3 Antonel Ernest Pazargic CLA 2011-03-02 05:28:08 EST
Unfortunately I didn't managed to reproduce it again.
Yesterday I've been playing with Content Assist preferences in order to address the issue, and I've been managed to get rid of the error pop-up by opt-out Code Recommenders Proposal. But also I've been playing with other recommenders content assist options, in terms of activating some of them in default section and others in cycling content assist section.

To make the long story short I can tell you that checking back the Code Recommenders Proposal option doesn't lead to the error popup issue.

I think I should use a clean workspace (and without importing my useful preferences, which BTW could contain a certain content assist preferences).

I will keep an eye on this useful project. I really like the the new template feature (I remember that once I've been hand-crafting a lot of useful templates starting from SWT once. It was very time consuming but I really need those templates).

I will put a useful comment (with reproducible steps, installation details and .log) as soon as I manage to reproduce the issue.
Comment 4 Marcel Bruch CLA 2011-03-02 06:37:31 EST
Hi Antonel,

ok. I will close this bug until we are able to reproduce it. Just reopen it if it pops up again.


May I ask you a few questions regarding your needs for the templates engine?

1. You say you handcrafted a lot of them. Would you mind sharing them with us for research purpose? They could provide us some insights what kind of templates developers are using, and thus may allow us to design the template engine more properly according to your/a developer's need. 

2. What would be needed so that you wouldn't deinstall code recommenders? :-) The aim of this question is to figure out what features we should concentrate on most for next two releases.

3. There is one team member that will continue work on template completion engine. So far we planned to design a "community template store" that enables developers to search and share such code templates easily. This store then would be a mixture of mined and  hand-crafted templates and tightly integrated into code completion. How do you feel? Would _you_  share some of your code snippets with the community if sharing would be pretty simple? Or do you have any concerns about this? The aim of this questions is to figure out whether we should rely on mined templates only of provide means for sharing them from your IDE.


Thanks,
Marcel
Comment 5 Antonel Ernest Pazargic CLA 2011-03-02 19:17:11 EST
Hi Marcel.

I will try to give short answers in order to not pollute this issue with irrelevant comments. So please see my inlined comments. Also if there is an issue (or more) where we could make suggestions and add wish-list please let me know.

Regards, jtonic


May I ask you a few questions regarding your needs for the templates engine?

1. You say you handcrafted a lot of them. Would you mind sharing them with us
for research purpose? They could provide us some insights what kind of
templates developers are using, and thus may allow us to design the template
engine more properly according to your/a developer's need. 

jtonic >> See the attachment some_templates.zip. They are pretty specialized (ANTLR and JOBS related). 
Note: It seems that, in order to use some public API, the developer needs to read javadoc/tutorials and then author the client code. And sometimes this involves a significant bunch of  types and methods + a certain calls order). Many times I'm asking myself where do I wrote a correct piece of APi client code, and then dive into my old code and/or Eclipse code, in order to find it and use it again. That's why I was flooded with relief as I've heard the EC Recomenders latest release announcement (TEMPLATE).

2. What would be needed so that you wouldn't deinstall code recommenders? :-)
The aim of this question is to figure out what features we should concentrate
on most for next two releases.

jtonic >> 
a. I really would like Code Recommenders not degrade the overall eclipse performance (taken into account that content assist is one of the most used eclipse functionality. And also there is a builder involved);
b. I really like to easily create a template from previous authored code;
c. I would like to let user be in control. IMO is it frustrating to have a content assist polluted with tens (maybe hundreds) of useless proposals;
d. Innovations ;) 

3. There is one team member that will continue work on template completion
engine. So far we planned to design a "community template store" that enables
developers to search and share such code templates easily. This store then
would be a mixture of mined and  hand-crafted templates and tightly integrated
into code completion. How do you feel? Would _you_  share some of your code
snippets with the community if sharing would be pretty simple? Or do you have
any concerns about this? The aim of this questions is to figure out whether we
should rely on mined templates only of provide means for sharing them from your
IDE.

jtonic >>
I like the "community template store" idea. I didn't develop with IntelliJ Idea for a long time, but if I remember right they provide a good template authoring support. It seems that Eclipse doesn't provide a powerful template authoring support. :(

Thanks,
Marcel
Comment 6 Antonel Ernest Pazargic CLA 2011-03-02 19:27:36 EST
Created attachment 190221 [details]
Some handcrafted templates

In order to simplify the repeated use of some ANTLR and Eclipse Jobs client APIs I've been handcrafted some templates, starting from SWT ones. See the attachment (which encompasses some exported templates).

It would be nice if authoring TEMPLATES will become much easier. :)