Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ISourceProvider variable that can be null
ISourceProvider variable that can be null [message #336694] Sun, 28 June 2009 18:44 Go to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member

I want to provide my own variable by using ISourceProvider. The problem is that this variable can
also be null. It seems that this is not supported (I get an exception then, telling me that this
variable is not defined).
Is there a reason why null variables are not supported?
Ok, I can simply wrap it in a list, but wonder why I have to.

Re: ISourceProvider variable that can be null [message #336720 is a reply to message #336694] Mon, 29 June 2009 14:44 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

It was set up to return null if the context doesn't know about the
variable at all, so it is API. The solution is to set it to
org.eclipse.core.expressions.IEvaluationContext.UNDEFINED_VA RIABLE when
you want it to be null. That way it won't kill expressions (which throw
an Undefined Variable exception of some kind).


Paul Webster e.platform.doc.isv/guide/workbench.htm

Previous Topic:Track not active selection with Command Core Expressions
Next Topic:Migration to eclipse galileo ,Unable to see error log
Goto Forum:

Current Time: Fri Apr 20 20:33:36 GMT 2018

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

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