Generate ToString plugin exception

Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at
com.intellij.psi.formatter.newXmlFormatter.java.SynteticCodeBlock.getFirstTreeNode(SynteticCodeBlock.java:18)
at
com.intellij.psi.formatter.newXmlFormatter.java.AbstractJavaBlock.getTreeNode(AbstractJavaBlock.java:124)
at
com.intellij.psi.formatter.newXmlFormatter.java.AbstractJavaBlock.getSpaceProperty(AbstractJavaBlock.java:198)
at
com.intellij.newCodeFormatting.impl.InitialInfoBuilder.a(InitialInfoBuilder.java:56)
at
com.intellij.newCodeFormatting.impl.InitialInfoBuilder.a(InitialInfoBuilder.java:16)
at
com.intellij.newCodeFormatting.impl.InitialInfoBuilder.buildBlocks(InitialInfoBuilder.java:66)
at
com.intellij.newCodeFormatting.impl.FormatProcessor.]]>(FormatProcessor.java:170)
at
com.intellij.newCodeFormatting.impl.FormatterImpl.format(FormatterImpl.java:36)
at
com.intellij.psi.impl.source.codeStyle.CodeFormatterFacade.processRange(CodeFormatterFacade.java:138)
at
com.intellij.psi.impl.source.codeStyle.CodeFormatterFacade.process(CodeFormatterFacade.java:158)
at
com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformat(CodeStyleManagerImpl.java:59)
at
org.intellij.idea.plugin.tostring.psi.PsiAdapter.addOrReplaceJavadoc(PsiAdapter.java:767)
at
org.intellij.idea.plugin.tostring.config.DuplicatePolicy.applyJavaDoc(DuplicatePolicy.java:57)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.createToStringMethod(GenerateToStringActionHandler.java:348)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.executeGenerateAction(GenerateToStringActionHandler.java:243)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.access$400(GenerateToStringActionHandler.java:40)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler$3.run(GenerateToStringActionHandler.java:260)
at
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:314)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler$2.run(GenerateToStringActionHandler.java:257)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:69)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:51)
at
org.intellij.idea.plugin.tostring.psi.idea4.PsiAdapterIdea4.executeCommand(PsiAdapterIdea4.java:124)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.executeGenerateActionLater(GenerateToStringActionHandler.java:269)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.access$000(GenerateToStringActionHandler.java:40)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler$1.run(GenerateToStringActionHandler.java:153)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:148)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:71)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:98)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

3 comments
Comment actions Permalink

Can you supply the version numbers of IDEA and the plugin you are using?

What are the steps you do to trigger this bug?

Try using a template without any javadoc comments, maybe it works then - Guessing from the stacktrace.

/Claus

0
Comment actions Permalink

3.14 and 3326

It works without the javadoc.

Here is what I had to remove from the top of the template:
/**

  • The current value of this $classname object.

  • @return a string representation of the $classname object.

*/


Claus Ibsen wrote:

>Can you supply the version numbers of IDEA and the plugin you are using?
>
>What are the steps you do to trigger this bug?
>
>Try using a template without any javadoc comments, maybe it works then - Guessing from the stacktrace.
>
>/Claus

>

0
Comment actions Permalink

Okay I got it sorted now for build 3326.

I'll upload a v3.15 that works with javadoc.

0

Please sign in to leave a comment.