Bug 473257 - NullPointerException in ProcessableJavaMethodCompletionProposal.createRequiredTypeCompletionProposal (72)
Summary: NullPointerException in ProcessableJavaMethodCompletionProposal.createRequire...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Recommenders (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2015-07-22 03:49 EDT by EPP Error Reports CLA
Modified: 2019-07-24 14:35 EDT (History)
2 users (show)

See Also:


Attachments
Screenshot of content assist page, as requested. (588.81 KB, image/png)
2017-09-09 13:33 EDT, Gordan Krešić CLA
no flags Details
Eclipse configuration details, as requested. (1.39 MB, text/plain)
2017-11-07 10:28 EST, Gordan Krešić CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description EPP Error Reports CLA 2015-07-22 03:49:57 EDT
The following incident was reported via the automated error reporting:


    code:                   0
    plugin:                 org.eclipse.ui_3.107.0.v20150507-1945
    message:                Unhandled event loop exception
    fingerprint:            0255b882
    exception class:        java.lang.NullPointerException
    exception message:      -
    number of children:     0
    
    java.lang.NullPointerException: null
    at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:57)
    at sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFieldAccessorImpl.java:36)
    at java.lang.reflect.Field.get(Field.java:393)
    at org.eclipse.recommenders.completion.rcp.processable.ProcessableJavaMethodCompletionProposal.createRequiredTypeCompletionProposal(ProcessableJavaMethodCompletionProposal.java:72)
    at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.apply(AbstractJavaCompletionProposal.java:340)
    at org.eclipse.jdt.internal.ui.text.java.JavaMethodCompletionProposal.apply(JavaMethodCompletionProposal.java:58)
    at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.apply(AbstractJavaCompletionProposal.java:504)
    at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.apply(LazyJavaCompletionProposal.java:489)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:963)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:914)
    at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1358)
    at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:814)
    at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:493)
    at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:66)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122)
    at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:788)
    at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5990)
    at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5682)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1137)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1122)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1164)
    at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1160)
    at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1581)
    at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4781)
    at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:343)
    at org.eclipse.swt.widgets.Control.windowProc(Control.java:4662)
    at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5050)
    at org.eclipse.swt.internal.win32.OS.DispatchMessageW(OS.java:-2)
    at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3767)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    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:139)
    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:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
   
  

General Information:

    reported-by:      
    anonymous-id:     05d5c818-330e-4d59-a550-a03894146d66
    eclipse-build-id: 4.5.0.I20150603-2000
    eclipse-product:  org.eclipse.epp.package.java.product
    operating system: Windows7 6.1.0 (x86_64) - win32
    jre-version:      1.8.0_45-b15

The following plug-ins were present on the execution stack (*):
    1. org.eclipse.core.databinding.observable_1.5.0.v20150422-0725
    2. org.eclipse.core.databinding_1.5.0.v20150422-0725
    3. org.eclipse.core.runtime_3.11.0.v20150405-1723
    4. org.eclipse.e4.ui.workbench_1.3.0.v20150531-1948
    5. org.eclipse.e4.ui.workbench.swt_0.13.0.v20150504-0621
    6. org.eclipse.equinox.app_1.3.300.v20150423-1356
    7. org.eclipse.equinox.launcher_1.3.100.v20150511-1540
    8. org.eclipse.jdt.ui_3.11.0.v20150527-0925
    9. org.eclipse.jdt_3.11.0.v20150603-2000
    10. org.eclipse.jface.text_3.10.0.v20150603-1752
    11. org.eclipse.jface_3.11.0.v20150602-1400
    12. org.eclipse.recommenders.completion.rcp_2.2.0.v20150609-1848
    13. org.eclipse.swt_3.104.0.v20150528-0211
    14. org.eclipse.ui_3.107.0.v20150507-1945
    15. org.eclipse.ui.ide.application_1.1.0.v20150422-0725
    16. org.eclipse.ui.ide_3.11.0.v20150510-1749

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/55ae36c5e4b0577cce8f4b90  
* Manual: https://dev.eclipse.org/recommenders/community/confess/#/guide


Thank you for your assistance.
Your friendly error-reports-inbox.

This bug was created on behalf of andreas.sewe@codetrails.com.
Comment 1 Andreas Sewe CLA 2015-07-22 03:58:30 EDT
Looking at the code

  CompletionProposalCollector collector = (CompletionProposalCollector) JAVA_CONTENT_ASSIST_INVOCATION_CONTEXT_F_COLLECTOR.get(invocationContext);
  CompletionContext newCoreContext = (CompletionContext) COMPLETION_PROPOSAL_COLLECTOR_F_CONTEXT.get(collector); // line 72

it seems that collector is null. COMPLETION_PROPOSAL_COLLECTOR_F_CONTEXT cannot be null at this point, due to an earlier check.

I wonder how this happens, as I haven't encountered this during any of my tests.

It would be great if the original reporter could share with us how his or her Java > Editor > Content Assist > Advanced preferences look like (an attached screenshot would be fine).
Comment 2 Gordan Krešić CLA 2017-09-09 13:33:55 EDT
Created attachment 270133 [details]
Screenshot of content assist page, as requested.
Comment 3 Andreas Sewe CLA 2017-09-12 03:10:12 EDT
(In reply to Gordan Krešić from comment #2)
> Created attachment 270133 [details]
> Screenshot of content assist page, as requested.

Thanks. That is helpful.

Do you know by any chance which plug-in contributes the icon-less "Basic Proposals" entry? This is the only entry that I don't have here myself and my be what causes things to de-rail.

Also, could you please provide me with a list of installed features (About Eclipse > Installation Details > Configuration)? If you don't know what Basic Proposals is, I could try to track it down.

But a reproducible scenario, i.e., a short piece of code where you trigger content assist and the NPE happens would be must helpful.
Comment 4 Gordan Krešić CLA 2017-11-07 10:28:12 EST
I tried to make a repro case, but couldn't. I noticed that upon Eclipse startup, everything works fine. It crashes later at some point, but couldn't pinpoint exactly when.

What I did notice however is that it crashes when I ask for constructor proposals, e.g.:

List<Foo> a;

a = ArrayList<>();

If I place cursor between "ArrayList" and "<>" and ask for proposals, I either get this error or don't get proposals for class "ArrayList". If it provides any clue, after initial Eclipse honeymoon (when everything works) has passed, I don't even get proposals just for type (java.util.ArrayList), but just for constructors (java.util.ArrayList()) which doesn't work (choosing that proposal does nothing, just inserts newline in source).

I'm not sure about "Basic proposals", but if I turn that off, I don't get contructors proposals (and maybe something else).

I'm attaching configuration details.
Comment 5 Gordan Krešić CLA 2017-11-07 10:28:51 EST
Created attachment 271361 [details]
Eclipse configuration details, as requested.