Skip to main content



      Home
Home » Modeling » TMF (Xtext) » NPE in GlobalURIEditorOpener(An IResourceUIServiceProvider that lacks an IURIEditorOpener causes NPE)
NPE in GlobalURIEditorOpener [message #1385898] Thu, 12 June 2014 03:56 Go to next message
Eclipse UserFriend
The Geppetto IDE for the puppet language performs cross referencing to artifacts found in ruby files. We have a headless runtime module for ruby that registers the language and the 'rb' extension but it does not register an editor. Instead we would like to use the default. I've had some problems getting this working.

The first problem is that in the GlobalURIEditorOpener, it's assumed that a IResourceServiceUIProvider will return an IURIEditorOpener. If it doesn't, the code will NPE in both open() methods. The LanguageSpecificURIEditorOpener declares it's injected IURIEditorOpener as optional so this seems to be a bug.

The second problem is that if I bind a LanguageSpecificURIEditorOpener then it assumes that the editorID to use is equal to the language. We don't register any editor for the ruby language.

My current workaround is to bind a subclass of the GlobalURIEditorOpener as the IURIEditorOpener for ruby. In this subclass I override both open() methods to simply dispatch to openDefaultEditor(). This works but would not be needed if the original methods checked for null return on the IResourceUIServiceProvider.getURIEditorOpener() method and used the default when that happened.

Since I'm fairly new to xtext I wonder if I'm doing something wrong here or if I should report a bug.
Re: NPE in GlobalURIEditorOpener [message #1386002 is a reply to message #1385898] Thu, 12 June 2014 16:25 Go to previous messageGo to next message
Eclipse UserFriend
yes please file a bug
Re: NPE in GlobalURIEditorOpener [message #1386248 is a reply to message #1386002] Mon, 16 June 2014 02:43 Go to previous message
Eclipse UserFriend
I filed https://bugs.eclipse.org/bugs/show_bug.cgi?id=437497
Previous Topic:[SOLVED] Generics in Xtext
Next Topic:[Solved] How2 access top AST from Validator,Quickfix,Proposal
Goto Forum:
  


Current Time: Sun Jul 27 11:49:08 EDT 2025

Powered by FUDForum. Page generated in 0.07636 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top