Bug 564534

Summary: NullPointerException when opening .sh file
Product: [Technology] MPC Reporter: Jens Reimann <jreimann>
Component: InstallAssignee: Project Inbox <mpc.install-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: leif.geiger, mag, reckord, rolf.theunissen, romain.bioteau
Version: unspecified   
Target Milestone: 1.8.4   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/c/mpc/org.eclipse.epp.mpc.git/commit/?id=f300da5635b1fadc0759b53a9bb770960bf51cab
Whiteboard:

Description Jens Reimann CLA 2020-06-22 08:04:52 EDT
Starting 2020-06 I get a NPE when opening a shell script in Eclipse. It still opens the system editor, but a dialog pops up and the following exception is logged:

~~~
java.lang.NullPointerException
	at org.eclipse.epp.internal.mpc.ui.discovery.DiscoverFileSupportJob.orderNodesByTagSubExtensionCount(DiscoverFileSupportJob.java:126)
	at org.eclipse.epp.internal.mpc.ui.discovery.DiscoverFileSupportJob.run(DiscoverFileSupportJob.java:87)
	at org.eclipse.epp.internal.mpc.ui.discovery.DiscoverFileSupportJob.run(DiscoverFileSupportJob.java:70)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
~~~
Comment 1 Romain Bioteau CLA 2020-07-05 04:52:31 EDT
Same error when trying o open a .spec file.
Comment 2 Carsten Reckord CLA 2020-07-05 07:38:11 EDT
Thanks for the report. Does this happen for any file with those extensions? Could you give me a concrete file name?

It looks like we get search results from the server that have no tags at all, let alone the ones indicating .sh/.spec editor capabilities.

In any case, I can see where the NPE happens and will have a fix in one of the upcoming builds.
Comment 3 Carsten Reckord CLA 2020-07-05 08:12:07 EDT
As a workaround until a fix is available, you can set an editor association explicitly to suppress the Marketplace lookup for the affected file type:

- Right-click on a file with the affected extension in the Project/Package Explorer
- Choose "Open with... / Other..."
- Select an editor to use
- Check the "Use it for all *.ext files" or "Use this editor for all Name.ext files"
Comment 4 Rolf Theunissen CLA 2020-07-13 03:20:27 EDT
*** Bug 565161 has been marked as a duplicate of this bug. ***
Comment 5 Carsten Reckord CLA 2020-07-16 11:16:53 EDT
FYI: MPC 1.8.4 with the fix has been released. You should be able to get the update via the Marketplace Client UI's update banner.