GenerateToString not working

I just updated to Build #1179.

In doing so the "Generate toString()" plugin which I had installed went away, so I redownloaded and installed it.

The "Generate toString()" item now appears on the menus but nothing happens when I invoke it. No code gets generated.

What's wrong?


Comment actions Permalink

Damm I am only using build 1168 at the moment.

I am working on v2.11 - I will try to fix it to work with the newest build.

You do not even get an Exception? Or any dialog displaying there is something wrong with the plugin?

You could start IDEA with console enabled to see if any java errors are outputted.

go to IDEA_HOME\bin
change the file idea.lax

Change from:

Change to:

When you start IDEA there is a seperate window with the console. Here you can see any errors being logged.

PS: What version of the plugin are you using? Sadly it is listed in two categories, with different version v2.00 and v2.10. Only the v2.10 is the version I continue to develop.

I will ask JetBrains to delete the v2.00 version.

/Claus, the author of the plugin

Comment actions Permalink

Don't panic - It has started working again for me.

I speculate the problem may have been related to the fact that I'd made some custom edits to the default velocity template (those edit worked prior to the IDEA upgrade from the 4.0 release to the current release #1179 and the reinstallation of the plugin)

It appeared what got it to start working again was just by going File|Settings|GenerateToString and editing the template and hitting OK.

My custom toString template is gone, no big deal, I can write it again, and I don't know if that's supposed to be a feature yet or not, but it'd be nice if the plugin retained personal custom velocity templates between updates of either IDEA or the plugin.

Comment actions Permalink


FYI I looked in the IDEA log file and there are lot of exceptions generated by the GenerateToString plugin. I've pasted an example one below, if you care. Looks like a NullPointerException :(.

The version is 2.10.

Very handy plug in by the way.


ERROR - mand.impl.CommandProcessorImpl - IntelliJ IDEA 4.0 Build #1179
2004-03-23 16:25:43,971 ERROR - mand.impl.CommandProcessorImpl - JDK: 1.4.2_03
2004-03-23 16:25:43,971 ERROR - mand.impl.CommandProcessorImpl - VM: Java HotSpot(TM) Client VM
2004-03-23 16:25:43,971 ERROR - mand.impl.CommandProcessorImpl - Vendor: Sun Microsystems Inc.
2004-03-23 16:25:43,971 ERROR - mand.impl.CommandProcessorImpl - OS: Windows XP
2004-03-23 16:25:43,971 ERROR - mand.impl.CommandProcessorImpl - Last Action: Actions.ActionsPlugin.GenerateToString
2004-03-23 16:25:43,971 ERROR - mand.impl.CommandProcessorImpl - Current Command: Generate toString()
2004-03-23 16:25:43,971 ERROR - mand.impl.CommandProcessorImpl -
at org.intellij.idea.plugin.tostring.GenerateToStringAction$GenerateToStringHandler.executeWriteAction(
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$
at com.intellij.openapi.application.a.b.runWriteAction(
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.execute(
at com.intellij.openapi.editor.actionSystem.EditorAction$
at com.intellij.openapi.command.impl.a.executeCommand(
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(
at com.intellij.openapi.actionSystem.b.n$b_.actionPerformed(n$
at javax.swing.AbstractButton.fireActionPerformed(
at com.intellij.openapi.actionSystem.b.n.fireActionPerformed(
at com.intellij.ui.b.a.h.doClick(
at com.intellij.ui.b.a.h.access$300(
at com.intellij.ui.b.a.h$a_.mouseReleased(h$
at java.awt.Component.processMouseEvent(
at java.awt.Component.processEvent(
at java.awt.Container.processEvent(
at java.awt.Component.dispatchEventImpl(
at java.awt.Container.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.LightweightDispatcher.retargetMouseEvent(
at java.awt.LightweightDispatcher.processMouseEvent(
at java.awt.LightweightDispatcher.dispatchEvent(
at java.awt.Container.dispatchEventImpl(
at java.awt.Window.dispatchEventImpl(
at java.awt.Component.dispatchEvent(
at java.awt.EventQueue.dispatchEvent(
at com.intellij.ide.q.b(
at com.intellij.ide.q.a(
at com.intellij.ide.q.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

Comment actions Permalink

My custom toString template is gone, no big deal, I
can write it again, and I don't know if that's
supposed to be a feature yet or not, but it'd be nice
if the plugin retained personal custom velocity
templates between updates of either IDEA or the

Brian. Yes that was unfortunately not a feature in v2.00 and below. I have integrated an autosave function in v2.10 that always stores your custom template in the
IDEA_HOME\plugins\tostring-plugin folder with a prefix of the plugin version number.

See the plugin homepage for additional information about this feature.

So do not panic in future upgrades from v2.10 since the autosave function is there.


PS: You should upgrade to v2.10 as it is the one I continue to develop. The v2.00 is in a wrong category due some problems with the plugin manager from JetBrains.

Comment actions Permalink

Ups you already are on v2.10

Comment actions Permalink

Thanks for the trace. I will take a look tonight.


Comment actions Permalink

I found the bug and it is fixed for v2.11:

- Fixed NPE when the Config.class is null and invoking the action.


Please sign in to leave a comment.