Skip to main content



      Home
Home » Modeling » TMF (Xtext) » NPE at PreferenceStoreWhitespaceInformationProvider.getLineSeparatorPreference()(Happens when I'm serializing an object)
NPE at PreferenceStoreWhitespaceInformationProvider.getLineSeparatorPreference() [message #1592004] Thu, 29 January 2015 16:45 Go to next message
Eclipse UserFriend
I've been running into this strange problem where, if I try to use the content assist feature, I start getting NPE's. Any idea why these are appearing, and what I can do to resolve them?

As far as I can tell, it's coming from the getLineSeparator() method of PreferenceStoreWhitespaceInformationProvider line 66. Specifically, the URI appears to be null.

I've appended the stacktrace, but how can the URI be null, and why is it trying to use a URI in the first place. This is test code, so I'm basically making sure the content assist works, and I'm building everything on the fly.

Note: I very recently upgraded from Xtext 2.1 to 2.8, as a result of moving from Eclipse 3.7 to 4.4, which is when the problems started appearing.

In some of the cases, I also see this message in the logs:
!MESSAGE org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider - Error in polymorphic dispatcher : null

NPE at:
PreferenceStoreWhitespaceInformationProvider.getLineSeparatorPreference(URI) line: 66
PreferenceStoreWhitespaceInformationProvider.getLineSeparatorInformation(URI) line: 56
FormatterImpl(AbstractDeclarativeFormatter).getLineSeparatorInfo() line: 114
FormatterImpl(AbstractDeclarativeFormatter).createFormattingConfig() line: 81
FormatterImpl(AbstractDeclarativeFormatter).getConfig() line: 92
FormatterImpl(AbstractDeclarativeFormatter).createFormatterStream(EObject, String, ITokenStream, boolean) line: 75
Serializer.serialize(EObject, ITokenStream, SaveOptions) line: 104
Serializer.serialize(EObject, SaveOptions) line: 124
Serializer.serialize(EObject) line: 52

Thanks for your advice!

[Updated on: Thu, 29 January 2015 16:45] by Moderator

Re: NPE at PreferenceStoreWhitespaceInformationProvider.getLineSeparatorPreference() [message #1592567 is a reply to message #1592004] Fri, 30 January 2015 00:22 Go to previous message
Eclipse UserFriend
Regarding PreferenceStoreWhitespaceInformationProvider Which Xtext Version do you use?

for org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider - Error in polymorphic dispatcher : null
make sure your code in the proposal provider is nullsafe
Previous Topic:Method createSequence is exceeding the 65535 bytes limit
Next Topic:Xtext and SVN - recovering from missing files when Xtext regenerates the src-gen folder
Goto Forum:
  


Current Time: Tue Jul 01 17:05:50 EDT 2025

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

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

Back to the top