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

Summary: NullPointerException for code completion at @MimeRegistration(mimeType - at org.netbeans.modules.apisupport.project.layers.LayerUtils.getEffectiveSystemFilesystem
Product: apisupport Reporter: Revivius
Component: ProjectAssignee: Martin Kozeny <mkozeny>
Status: REOPENED ---    
Severity: normal CC: markiewb
Priority: P3    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 210587
Attachments: stacktrace
Shows the issue, editor-mimelookup is a dependency

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.