GenerateToString broken in 3260?
I just installed the GenerateToString plugin, restarted IDEA then tried to
generate a toString() method but received the following exception:
No message
java.lang.NullPointerException
at org.intellij.idea.plugin.tostring.template.TemplateResource.getMethodBody(TemplateResource.java:68)
at org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.displayMememberChooser(GenerateToStringActionHandler.java:205)
at org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.doExecuteAction(GenerateToStringActionHandler.java:132)
at org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.executeWriteAction(GenerateToStringActionHandler.java:68)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler$1.run(EditorWriteActionHandler.java:39)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:371)
at com.intellij.openapi.editor.actionSystem.EditorWriteActionHandler.execute(EditorWriteActionHandler.java:23)
at com.intellij.openapi.editor.actionSystem.EditorAction$1.run(EditorAction.java:40)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:113)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:77)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:46)
at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:31)
at com.intellij.openapi.actionSystem.ex.ActionListPopup$1.run(ActionListPopup.java:6)
at com.intellij.ui.ListPopup.closePopup(ListPopup.java:9)
at com.intellij.ui.ListPopup$2.keyTyped(ListPopup.java:1)
at java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:182)
at java.awt.Component.processKeyEvent(Component.java:5055)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2388)
at java.awt.Component.processEvent(Component.java:4909)
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.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1713)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:627)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:831)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:741)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:592)
at java.awt.Component.dispatchEventImpl(Component.java:3506)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
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.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:88)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:64)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:31)
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)
Please sign in to leave a comment.
I had same problem(exception) in one of the previous builds, it's your toString template problem, see this thread for more info:
http://www.intellij.net/forums/thread.jsp?forum=18&thread=128896&tstart=45&trange=15
Yeah I am sure it's the same problem.
This non compatible template adjustments was made to prepare for future features such as generation of other methods than just toString().
Currently it's possible to generate eg. a
public int compareTo(Object o)
method.
Anyone got good idea's for other useful method?
readObject() and writeObject() seem like obvious choices.
--Dave Griffith