Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Detail Formatter null value
Detail Formatter null value [message #1778372] Wed, 13 December 2017 14:26 Go to next message
Nikita Dümmel is currently offline Nikita DümmelFriend
Messages: 12
Registered: September 2017
Junior Member
Hi,

I'm writing a DSL which has "undefined" instead of "null" for null references as it is supposedly better understandable for beginners.
The DSL code is then generated to Java which is executed.
So my problem is that when debugging through my DSL code undefined variables have naturally null values in the variables view in the debugger as seen in the image in the attachment.

Is there a way using the detail formatter to replace null values with "undefined"?

Best regards,
Nikita.
Re: Detail Formatter null value [message #1778376 is a reply to message #1778372] Wed, 13 December 2017 14:54 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5929
Registered: July 2009
Senior Member
Hi

Be careful about pandering to beginner's perceived problems; you can easily create new inconsistent terminology problems and just defer acquisition of an understanding.

"undefined" means that no assignment/initialization has occurred AND that an assignment/initialization is required.

"null" means that no assignment/initialization has occurred OR that a deliberate not-a-value is in use.

If you really mean to provide an SSA-like (Static Single Assignment) behaviour with no not-a-value then you do not need to display null at all.

If you have exceptions then it is tempting to categorize these too as "undefined" creating even greater confusion.

Regards

Ed Willink
Re: Detail Formatter null value [message #1778453 is a reply to message #1778376] Thu, 14 December 2017 10:35 Go to previous messageGo to next message
Nikita Dümmel is currently offline Nikita DümmelFriend
Messages: 12
Registered: September 2017
Junior Member
Hi,

thank you for the feedback, that is definately something to think about.
As it is the decision is far from final and must be discussed with colleagues, the points you mentioned will be definately helpful.

Regards,
Nikita.

Re: Detail Formatter null value [message #1778488 is a reply to message #1778453] Thu, 14 December 2017 19:30 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1602
Registered: July 2009
Senior Member
Quote:
Is there a way using the detail formatter to replace null values with "undefined"?


Have you tried it?
As you mention detail formatters I assume you've seen the preference for Java > Debug > Detail Formatters?
Re: Detail Formatter null value [message #1778504 is a reply to message #1778488] Fri, 15 December 2017 09:24 Go to previous message
Nikita Dümmel is currently offline Nikita DümmelFriend
Messages: 12
Registered: September 2017
Junior Member
Stephan Herrmann wrote on Thu, 14 December 2017 19:30
Quote:
Is there a way using the detail formatter to replace null values with "undefined"?


Have you tried it?
As you mention detail formatters I assume you've seen the preference for Java > Debug > Detail Formatters?


Yes, thanks to Detail Formatter the value of my variables is set to toString representation and I've managed to create a new Detail Formatter for ArrayLists. However I couldn't find a way to create a new detail formatter for null values.
Previous Topic:Eclipse Oxygen - Debugging Issue
Next Topic:Blockchain API pom.xml edit.
Goto Forum:
  


Current Time: Thu Jun 21 06:51:01 GMT 2018

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

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

Back to the top