In Eclipse, when a variable is inspected and Eclipse is able to show its value, it does so by calling toString().
IntelliJ IDEA does not do it. Can it be told to?
Thanks.
In Eclipse, when a variable is inspected and Eclipse is able to show its value, it does so by calling toString().
IntelliJ IDEA does not do it. Can it be told to?
Thanks.
Settings
| Debugger
| Data Views
:
Using IDEA 13.1:
Preferences -> Debugger -> Data Type Renderers
+(add) new renderer, give it a name
On 'When rendering the node' select option 'Use following expression', type in 'toString()'.
This seems to give me Eclipse-like behaviour.
I'd paste a picture... but don't have enough points. :P
By default Intellij Idea does display the toString() of objects in debug view, unless you explicitly tell it not to in the dialog pointed by CrazyCoder above.
The problem that I have found is that for some crooked reason which only the folks at JetBrains understand, IntelliJ Idea (still as of version 13) will silently ignore the above setting and it will not invoke toString() on classes which do not override the toString() method. Even adding your class in the 'For classes from the list:' will not result in invocation of toString() unless your class explicitly overrides it. So, it appears that IntelliJ Idea will never ever invoke the default toString() method of class Object. I suppose it must be allergic to it.
Right click the variable in the Debug window, and choose "view text". It will open a window showing "toString"