This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245456 - NullPointerException for code completion at @MimeRegistration(mimeType - at org.netbeans.modules.apisupport.project.layers.LayerUtils.getEffectiveSystemFilesystem
Summary: NullPointerException for code completion at @MimeRegistration(mimeType - at ...
Status: REOPENED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Martin Kozeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-07 21:13 UTC by Revivius
Modified: 2016-02-04 20:36 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 210587


Attachments
stacktrace (2.64 KB, text/plain)
2014-07-07 21:13 UTC, Revivius
Details
Shows the issue, editor-mimelookup is a dependency (402.99 KB, image/png)
2016-02-04 20:31 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Revivius 2014-07-07 21:13:34 UTC
Build: NetBeans IDE 8.0 (Build 201403101706)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.0-b70, Java(TM) SE Runtime Environment, 1.8.0-b132
OS: Windows 7

User Comments:
revivius: No idea. Just noticed the notification




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.apisupport.project.layers.LayerUtils.getEffectiveSystemFilesystem(LayerUtils.java:387)
   at org.netbeans.modules.apisupport.project.layers.PathCompletions.getCompletions(PathCompletions.java:138)
   at org.netbeans.modules.editor.mimelookup.CreateRegistrationProcessor.completeMimePath(CreateRegistrationProcessor.java:307)
   at org.netbeans.modules.editor.mimelookup.CreateRegistrationProcessor.getCompletions(CreateRegistrationProcessor.java:227)
   at org.netbeans.api.java.source.SourceUtils.getAttributeValueCompletions(SourceUtils.java:263)
   at org.netbeans.modules.editor.java.JavaCompletionProvider$JavaCompletionQuery.addAttributeValues(JavaCompletionProvider.java:3966)
Comment 1 Revivius 2014-07-07 21:13:37 UTC
Created attachment 147924 [details]
stacktrace
Comment 2 Martin Kozeny 2014-07-09 08:41:17 UTC
You are probably missing editor.mimelookup module in your platform and when using code completion for mimeType property of @MimeRegistration(mimeType = "text/html", service = ...) annotation, project owner of MimeRegistration interface is not found.
Comment 3 markiewb 2016-02-04 20:31:55 UTC
Created attachment 158381 [details]
Shows the issue, editor-mimelookup is a dependency
Comment 4 markiewb 2016-02-04 20:35:26 UTC
(In reply to Martin Kozeny from comment #2)
> You are probably missing editor.mimelookup module in your platform and when
> using code completion for mimeType property of @MimeRegistration(mimeType =
> "text/html", service = ...) annotation, project owner of MimeRegistration
> interface is not found.

Reopen.

See https://netbeans.org/bugzilla/attachment.cgi?id=158381
A screenshot from a simple maven-based nbm module with a dependency to editor-mimelookup. But the completion does not work. 

The code in LayerUtils.getEffectiveSystemFilesystem should be at least NPE-safe. No code completion items for code like

// caret at |
@MimeRegistration(mimeType = "text/x|", service = CompletionProvider.class)

would be OK, if there is no dependency. But not a NPE.