Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 21:45 Go to next message
Akash Peri is currently offline Akash PeriFriend
Messages: 2
Registered: January 2015
Junior Member
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 21:45]

Report message to a moderator

Re: NPE at PreferenceStoreWhitespaceInformationProvider.getLineSeparatorPreference() [message #1592567 is a reply to message #1592004] Fri, 30 January 2015 05:22 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14668
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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: Fri Apr 26 18:21:23 GMT 2024

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

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

Back to the top