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

Bug 465898

Summary: [subwords] Add completion kinds uncovered by SubwordsSessionProcessor.computeCompletionIdentifier
Product: z_Archived Reporter: EPP Error Reports <error-reports-inbox>
Component: RecommendersAssignee: Andreas Sewe <sewe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: marcel.bruch, robert.munteanu, schierlm, sewe
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/#/c/46865/
https://git.eclipse.org/r/48762
https://git.eclipse.org/r/#/c/51226/
Whiteboard: Fixed in Code Recommenders v2.2.1. Please update using project update site hosted at http://download.eclipse.org/recommenders/updates/stable/
Bug Depends on:    
Bug Blocks: 466909    

Description EPP Error Reports CLA 2015-04-30 05:21:48 EDT
The following incident was reported via the automated error reporting:

The user provided the following details for this incident:
Triggered completion in a method Javadoc:

/**
     * Looks up the ProjectC|<ctrl+space>oordinate
     * @param dependencyInfo
     * @return
     */
    @Override
    public Optional<ProjectCoordinate> suggest(DependencyInfo dependencyInfo) {
... 
   }



    code:                   2
    plugin:                 org.eclipse.recommenders.subwords.rcp_2.2.0.v20150423-1844
    message:                Found uncovered lazy completion proposal of type ‘class org.eclipse.jdt.internal.ui.text.javadoc.JavadocLinkTypeCompletionProposal’. Please file a bug for the Code Recommenders project.
    fingerprint:            06684f72
    exception class:        org.eclipse.recommenders.utils.Logs$LogTraceException
    exception message:      -
    number of children:     0
    
    org.eclipse.recommenders.utils.Logs$LogTraceException: null
    at org.eclipse.recommenders.utils.Logs$LogTraceException.newTrace(Logs.java:381)
    at org.eclipse.recommenders.utils.Logs.log(Logs.java:134)
    at org.eclipse.recommenders.internal.subwords.rcp.SubwordsSessionProcessor.computeCompletionIdentifier(SubwordsSessionProcessor.java:240)
    at org.eclipse.recommenders.internal.subwords.rcp.SubwordsSessionProcessor.testAndInsertNewProposals(SubwordsSessionProcessor.java:201)
    at org.eclipse.recommenders.internal.subwords.rcp.SubwordsSessionProcessor.initializeContext(SubwordsSessionProcessor.java:129)
    at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.fireInitializeContext(IntelligentCompletionProposalComputer.java:240)
    at org.eclipse.recommenders.completion.rcp.processable.IntelligentCompletionProposalComputer.computeCompletionProposals(IntelligentCompletionProposalComputer.java:135)
    at org.eclipse.jdt.internal.ui.text.java.CompletionProposalComputerDescriptor.computeCompletionProposals(CompletionProposalComputerDescriptor.java:333)
    at org.eclipse.jdt.internal.ui.text.java.CompletionProposalCategory.computeCompletionProposals(CompletionProposalCategory.java:337)
    at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.collectProposals(ContentAssistProcessor.java:322)
    at org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor.computeCompletionProposals(ContentAssistProcessor.java:279)
    at org.eclipse.jface.text.contentassist.ContentAssistant$5.run(ContentAssistant.java:1904)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1902)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:573)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$16(CompletionProposalPopup.java:570)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:505)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:499)
    at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1720)
    at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:180)
    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:473)
    at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:122)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
    at sun.reflect.GeneratedMethodAccessor201.invoke(null:-1)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:247)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:229)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324)
    at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1098)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4198)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1467)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1490)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1475)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1504)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1500)
    at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:496)
    at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1060)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5757)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(OS.java:-2)
    at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68)
    at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:594)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5667)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(OS.java:-2)
    at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:221)
    at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2105)
    at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2337)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5729)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(OS.java:-2)
    at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5166)
    at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5315)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(OS.java:-2)
    at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3669)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1112)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:993)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
   
  

General Information:

    reported-by:      Marcel Bruch (M6, Recommenders)
    anonymous-id:     f8087d7b-9d38-4c73-aeb1-6991603c2a84
    eclipse-build-id: 4.5.0.I20150320-0800
    eclipse-product:  org.eclipse.epp.package.committers.product
    operating system: MacOSX 10.10.3 (x86_64) - cocoa
    jre-version:      1.8.0_40-b25

The following plug-ins were present on the execution stack (*):
    1. org.eclipse.core.commands_3.6.100.v20150311-0214
    2. org.eclipse.core.databinding.observable_1.4.1.v20150311-0218
    3. org.eclipse.core.databinding_1.4.100.v20150311-0216
    4. org.eclipse.core.runtime_3.11.0.v20150316-1241
    5. org.eclipse.e4.core.commands_0.10.2.v20150313-1340
    6. org.eclipse.e4.core.contexts_1.3.100.v20150316-1240
    7. org.eclipse.e4.core.di_1.4.0.v20150316-1236
    8. org.eclipse.e4.ui.bindings_0.10.200.v20150313-1340
    9. org.eclipse.e4.ui.workbench_1.3.0.v20150316-1403
    10. org.eclipse.e4.ui.workbench.swt_0.12.100.v20150316-1403
    11. org.eclipse.equinox.app_1.3.200.v20130910-1609
    12. org.eclipse.equinox.launcher_1.3.0.v20140415-2008
    13. org.eclipse.jdt.ui_3.11.0.v20150316-2042
    14. org.eclipse.jdt_3.11.0.v20150320-0800
    15. org.eclipse.jface_3.11.0.v20150313-1544
    16. org.eclipse.jface.text_3.10.0.v20150112-1146
    17. org.eclipse.recommenders.completion.rcp_2.2.0.v20150429-1402
    18. org.eclipse.recommenders.subwords.rcp_2.2.0.v20150423-1844
    19. org.eclipse.recommenders.utils_2.2.0.v20150428-1804
    20. org.eclipse.swt_3.104.0.v20150319-1901
    21. org.eclipse.ui_3.107.0.v20150315-0703
    22. org.eclipse.ui.ide.application_1.0.600.v20150315-1254
    23. org.eclipse.ui.ide_3.11.0.v20150309-2044

Please note that:
* Messages, stacktraces, and nested status objects may be shortened.
* Bug fields like status, resolution, and whiteboard are sent
  back to reporters.
* The list of present bundles and their respective versions was
  calculated by package naming heuristics. This may or may not reflect reality.

Other Resources:
* Report: https://dev.eclipse.org/recommenders/committers/confess/#/problems/5541f404e4b04acfc3d241f7  
* Manual: https://dev.eclipse.org/recommenders/community/confess/#/guide


Thank you for your assistance.
Your friendly error-reports-inbox.
Comment 1 Marcel Bruch CLA 2015-05-01 01:07:01 EDT
Change has been merged. There is an issue with the highlighting of {@link and {@value proposals. See Bug 466002 for details.
Comment 2 Marcel Bruch CLA 2015-05-09 04:52:03 EDT
Got this error in:

public class MergeProblemFunction implements BiConsumer<Problem, Problem> {

    /**
     * @pa|<>
     */
    @Override
    public void accept(Problem from, Problem to) {
...
    }
}

Param completions are not yet supported
Comment 4 Andreas Sewe CLA 2015-05-27 08:55:59 EDT
(In reply to Marcel Bruch from comment #2)
> Got this error in:
> 
> public class MergeProblemFunction implements BiConsumer<Problem, Problem> {
> 
>     /**
>      * @pa|<>
>      */
>     @Override
>     public void accept(Problem from, Problem to) {
> ...
>     }
> }
> 
> Param completions are not yet supported

I cannot reproduce the error as state, i.e., completing "@pa" to "@param". I can, however, reproduce the error when triggering in the following circumstances:

>     /**
>      * @param |<>
>      */
Comment 5 Andreas Sewe CLA 2015-05-27 08:58:40 EDT
(In reply to Andreas Sewe from comment #4)
> I cannot reproduce the error as state, i.e., completing "@pa" to "@param". I
> can, however, reproduce the error when triggering in the following
> circumstances:
> 
> >     /**
> >      * @param |<>
> >      */

The unsupported CompletionProposal kind in question is #18 aka JAVADOC_PARAM_REF.
Comment 6 Andreas Sewe CLA 2015-05-27 09:15:42 EDT
Fix for the problem reported ib comment 2 is in Gerrit [1]

[1] <https://git.eclipse.org/r/48762>
Comment 7 Marcel Bruch CLA 2015-05-27 09:53:26 EDT
Change is merged. Will reopen if a new problem comes along.
Comment 8 Andreas Sewe CLA 2015-05-27 11:45:38 EDT
*** Bug 466681 has been marked as a duplicate of this bug. ***
Comment 9 Andreas Sewe CLA 2015-06-01 10:09:18 EDT
*** Bug 467169 has been marked as a duplicate of this bug. ***
Comment 10 Andreas Sewe CLA 2015-07-02 04:57:14 EDT
There is another proposal kind we do not cover: METHOD_REF_WITH_CASTED_RECEIVER (proposal kind 24) [1].


Proposals of this kind are created in the following situation

  public void method(Object arg) {
    if (arg instanceof File) {
      arg.ca$
    }
  }

This proposes methods like File.canExecute.

Interestingly, the prefix we get from JDT varies between the initial triggering and when the user types in additional characters later.

In the above, the prefix will start out as "ca", but if the user types an a additional 'c', then the prefix will be "arg.cae". We have to account for this JDT weirdness in our fix.

[1] <https://dev.eclipse.org/recommenders/committers/confess/#/problems/5541f404e4b04acfc3d241f7/similar>
Comment 11 Andreas Sewe CLA 2015-07-02 05:00:07 EDT
(In reply to Andreas Sewe from comment #10)
> In the above, the prefix will start out as "ca", but if the user types an a
> additional 'c', then the prefix will be "arg.cae". We have to account for
> this JDT weirdness in our fix.

Fix doing that is in Gerrit: <https://git.eclipse.org/r/#/c/51226/>
Comment 12 Andreas Sewe CLA 2015-07-02 11:25:40 EDT
(In reply to Andreas Sewe from comment #11)
> (In reply to Andreas Sewe from comment #10)
> > In the above, the prefix will start out as "ca", but if the user types an a
> > additional 'c', then the prefix will be "arg.cae". We have to account for
> > this JDT weirdness in our fix.
> 
> Fix doing that is in Gerrit: <https://git.eclipse.org/r/#/c/51226/>

Fix has been merged.
Comment 13 Michael Schierl CLA 2015-07-25 15:05:18 EDT
I don't know if it is relevant.

Eclipse Mars (Build id: 20150621-1200) popped up a dialog three times today (without me noticing anything that went wrong before) that contained a link to this bug report and suggested me to update to Code Recommenders 2.2.1. "Check for updates" does not find any updates though. Probably normal (perhaps the error reporting assumes I'm on an unreleased build?), but I guess I'm not the only one that is confused by this...
Comment 14 Marcel Bruch CLA 2015-07-25 16:54:20 EDT
Thanks Michael. The simultaneous release repository is updated only for SR1/SR2. Until then users have to use the project update sites to fetch the latest stable bits. Recommenders stable update site is hosted at [1].

I updated the message so that others will get a better message in future.


[1] http://download.eclipse.org/recommenders/updates/stable/
Comment 15 Andreas Sewe CLA 2015-08-17 05:49:49 EDT
*** Bug 473753 has been marked as a duplicate of this bug. ***