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?

Brian

7 comments

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:
lax.stderr.redirect=
lax.stdin.redirect=
lax.stdout.redirect=

Change to:
lax.stderr.redirect=console
lax.stdin.redirect=console
lax.stdout.redirect=console

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

0

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.

0

Claus,

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.

-Brian


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 -
java.lang.NullPointerException
at org.intellij.idea.plugin.tostring.GenerateToStringAction$GenerateToStringHandler.executeWriteAction(GenerateToStringAction.java:106)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java)
at com.intellij.openapi.application.a.b.runWriteAction(b.java:299)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.execute(EditorWriteActionHandler.java:5)
at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java)
at com.intellij.openapi.command.impl.a.executeCommand(a.java:94)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:19)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:24)
at com.intellij.openapi.actionSystem.b.n$b_.actionPerformed(n$b_.java:13)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at com.intellij.openapi.actionSystem.b.n.fireActionPerformed(n.java:55)
at com.intellij.ui.b.a.h.doClick(h.java:157)
at com.intellij.ui.b.a.h.access$300(h.java:124)
at com.intellij.ui.b.a.h$a_.mouseReleased(h$a_.java:3)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at com.intellij.ide.q.b(q.java:36)
at com.intellij.ide.q.a(q.java:34)
at com.intellij.ide.q.dispatchEvent(q.java:48)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

0

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.


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.


/Claus

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.

0

Ups you already are on v2.10

0

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

/Claus

0

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

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

0

Please sign in to leave a comment.