Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » QualifiedNameProvider-Question(Perhaps a kind of bug? )
QualifiedNameProvider-Question [message #1021922] Wed, 20 March 2013 23:40 Go to next message
Annika Wießgügel is currently offline Annika WießgügelFriend
Messages: 11
Registered: January 2013
Junior Member
I'm just writing an own QualifiedNameProvider (extending DefaultDeclarativeQualifiedNameProvider) and a corresponding LinkingProvider (and i'm quite new to xtext). I nearly finished them both, when i discovered an error, telling me the method QualifiedName.create (org.eclipse.xtext.naming.QualifiedName.create(String singleSegment)) is throwing IllegalArgumentExceptions when the segment to be created is null.
We used this option for our defaultpackage (which doesn't have a name) but did first not notice that it doesn't work. Now i'm reworking the two classes, and with lots of printouts, i noticed that when only the QualifiedNameProvider is registered in the runtime, it neighter works nor does it throw Exceptions when providing "null" to the create method. There is no feedback telling me it doesn't work.
Only if i activate the LinkingProvider and inject the qualifiedNameProvider the exception is thrown.

Did i make a mistake or is there really no error telling me i'm feeding the create method a null?




PS: Is there any possibility to debug except System.out.println? It's quite time-consuming and annoying to start an eclipse application every time....
Re: QualifiedNameProvider-Question [message #1022033 is a reply to message #1021922] Thu, 21 March 2013 06:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30810
Registered: July 2009
Senior Member
Annika,

Comments below.
On 21/03/2013 12:40 AM, Annika Wießgügel wrote:
> I'm just writing an own QualifiedNameProvider (extending
> DefaultDeclarativeQualifiedNameProvider) and a corresponding
> LinkingProvider (and i'm quite new to xtext). I nearly finished them
> both, when i discovered an error, telling me the method
> QualifiedName.create
> (org.eclipse.xtext.naming.QualifiedName.create(String singleSegment))
> is throwing IllegalArgumentExceptions when the segment to be created
> is null. We used this option for our defaultpackage (which doesn't
> have a name) but did first not notice that it doesn't work.
Yes, better to use an empty string.
> Now i'm reworking the two classes, and with lots of printouts, i
> noticed that when only the QualifiedNameProvider is registered in the
> runtime, it neighter works nor does it throw Exceptions when providing
> "null" to the create method.
Perhaps something is catching the exception and logging it or even just
ignoring it.
> There is no feedback telling me it doesn't work.
> Only if i activate the LinkingProvider and inject the
> qualifiedNameProvider the exception is thrown.
> Did i make a mistake or is there really no error telling me i'm
> feeding the create method a null?
It's hard to say...
>
>
>
> PS: Is there any possibility to debug except System.out.println?
The debugger is definitely your best friend. It has handy things like
exception breakpoints (see the toolbar in the title area of the
Breakpoint view), so you can set a breaking whenever a
NullPointerException is thrown. That will help you determine what's on
the call stack and how that exception is being handled by the things on
the call stack.
> It's quite time-consuming and annoying to start an eclipse application
> every time....
The debugger supports hot replace so often you can change the code and
keep running...
Previous Topic:JvmType, add additional Types, that will be generated, but are not there YET
Next Topic:Editor Plugin fails to start
Goto Forum:
  


Current Time: Tue Jan 21 17:19:52 GMT 2020

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

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

Back to the top