Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext 2.0] Bug in PreferenceStoreAccessImpl?
[Xtext 2.0] Bug in PreferenceStoreAccessImpl? [message #677526] Wed, 08 June 2011 18:20 Go to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Greetings,

(Before posting this question, I did search for an existing bug in the bug database, but I didn't find anything)

I'm trying to fix a bug in my Xtext 2-based editor. When changing preferences for a particular project, the changes get saved to all the projects in the workspace.

After some debugging, I think the problem is in PreferenceStoreAccessImpl, in the method getWritablePreferenceStore(Object), line 59:

	public IPreferenceStore getWritablePreferenceStore(Object context) {
		lazyInitialize();
		if (context instanceof IFileEditorInput) {
			context = ((IFileEditorInput) context).getFile().getProject();
		}
		if (context instanceof IProject) {
			ProjectScope projectScope = new ProjectScope((IProject) context);
			ScopedPreferenceStore result = new ScopedPreferenceStore(projectScope, getQualifier());
			result.setSearchContexts(new IScopeContext[] {
				projectScope,
				new InstanceScope(),
				new ConfigurationScope()
			});
		}
		return getWritablePreferenceStore();
	}


when the context is a IProject, this method creates a ScopedPreferenceStore using the passed IProject as one of the scopes. I think the problem is, the created ScopedPreferenceStore is never returned, instead, this method always returns the one from getWritablePreferenceStore().

I'm so sorry that at this point I can't confirm this bug (by actually changing Xtext's code and running my project again.) Does anybody know if this is a known bug?

Many thanks in advance,
-Alex
(no subject) [message #677569 is a reply to message #677526] Wed, 08 June 2011 18:57 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Alex,

this is not a know bug. Please file a ticket. Thanks.
Workaround: Bind your own subtype of PreferenceStoreAccessImpl for your
language.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 08.06.11 20:20, schrieb Alex Ruiz:
> Greetings,
>
> (Before posting this question, I did search for an existing bug in the
> bug database, but I didn't find anything)
>
> I'm trying to fix a bug in my Xtext 2-based editor. When changing
> preferences for a particular project, the changes get saved to all the
> projects in the workspace.
>
> After some debugging, I think the problem is in
> PreferenceStoreAccessImpl, in the method
> getWritablePreferenceStore(Object), line 59:
>
>
> public IPreferenceStore getWritablePreferenceStore(Object context) {
> lazyInitialize();
> if (context instanceof IFileEditorInput) {
> context = ((IFileEditorInput) context).getFile().getProject();
> }
> if (context instanceof IProject) {
> ProjectScope projectScope = new ProjectScope((IProject) context);
> ScopedPreferenceStore result = new ScopedPreferenceStore(projectScope,
> getQualifier());
> result.setSearchContexts(new IScopeContext[] {
> projectScope,
> new InstanceScope(),
> new ConfigurationScope()
> });
> }
> return getWritablePreferenceStore();
> }
>
>
> when the context is a IProject, this method creates a
> ScopedPreferenceStore using the passed IProject as one of the scopes. I
> think the problem is, the created ScopedPreferenceStore is never
> returned, instead, this method always returns the one from
> getWritablePreferenceStore().
>
> I'm so sorry that at this point I can't confirm this bug (by actually
> changing Xtext's code and running my project again.) Does anybody know
> if this is a known bug?
> Many thanks in advance,
> -Alex
Re: (no subject) [message #677591 is a reply to message #677569] Wed, 08 June 2011 21:48 Go to previous messageGo to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Thanks Sebastian,

I did something similar to what you described, and yes, it confirms the bug is there.

Cheers,
-Alex
(no subject) [message #677595 is a reply to message #677569] Wed, 08 June 2011 21:48 Go to previous messageGo to next message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Thanks Sebastian,

I did something similar to what you described, and yes, it confirms the bug is there.

Cheers,
-Alex
Re: (no subject) [message #677693 is a reply to message #677591] Thu, 09 June 2011 07:17 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Alex,

could you please file a ticket? Thanks.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 08.06.11 23:48, schrieb Alex Ruiz:
> Thanks Sebastian,
>
> I did something similar to what you described, and yes, it confirms the
> bug is there.
>
> Cheers,
> -Alex
Re: (no subject) [message #684616 is a reply to message #677693] Wed, 15 June 2011 23:31 Go to previous message
Alex Ruiz is currently offline Alex RuizFriend
Messages: 103
Registered: March 2011
Senior Member
Hi Sebastian,

Sorry for the delay. I went for vacation before I had a chance to file the bug.

The bug report can be found at https://bugs.eclipse.org/bugs/show_bug.cgi?id=349511 .

Thanks,
-Alex
Previous Topic:[Xtend2] Difference between val and var ?
Next Topic:Running workflow for several languages
Goto Forum:
  


Current Time: Fri Apr 19 20:33:02 GMT 2024

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

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

Back to the top