Generate to String 3.22 is broken
Any ideas? This worked before I upgraded today. I am using IJ 5.1.1. I am
also using the default template for JDK 5
Everytime I run it I get:
2006-04-24 15:58:51,093 ERROR - tostring.GenerateToStringUtils -
org.intellij.idea.plugin.tostring.exception.GenerateCodeException:
Encountered "" at line 32, column 12.
Was expecting one of:
"(" ...
...
...
]]> ...
"
" ...
"
" ...
...
...
"*#" ...
"*#" ...
...
...
"if" ...
"elseif" ...
...
"stop" ...
...
...
...
...
"{" ...
"}" ...
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.velocityGenerateCode(GenerateToStringActionHandler.java:521)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.createToStringMethod(GenerateToStringActionHandler.java:346)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.executeGenerateAction(GenerateToStringActionHandler.java:260)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.access$100(GenerateToStringActionHandler.java:44)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler$2$1.run(GenerateToStringActionHandler.java:280)
at
com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:174)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler$2.run(GenerateToStringActionHandler.java:277)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:39)
at
com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:70)
at
org.intellij.idea.plugin.tostring.psi.PsiAdapter.executeCommand(PsiAdapter.java:625)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.executeGenerateActionLater(GenerateToStringActionHandler.java:289)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.access$000(GenerateToStringActionHandler.java:44)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler$1.run(GenerateToStringActionHandler.java:167)
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:18)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:51)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:143)
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)
Caused by: org.apache.velocity.exception.ParseErrorException: Encountered
"" at line 32, column 12.
Was expecting one of:
"(" ...
...
...
]]> ...
"
" ...
"
" ...
...
...
"*#" ...
"*#" ...
...
...
"if" ...
"elseif" ...
...
"stop" ...
...
...
...
]]> ...
"{" ...
"}" ...
at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:328)
at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:252)
at
org.intellij.idea.plugin.tostring.GenerateToStringActionHandler.velocityGenerateCode(GenerateToStringActionHandler.java:507)
... 22 more
请先登录再写评论。
Am I the only one having this problem?
"Grant Gochnauer" <grant.gochnauer@vodori.com> wrote in message
news:e2jeb7$ecn$1@is.intellij.net...
>
>
>
>
>
Grant.
I'll look into it when I come home from work.
/Claus
Just to be 100% sure. Can you post the template you use?
Sure -- I am activating the built in template without any changes.. Using
the validate button in the plugin says the template is VALID.
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("$classname");
#set ($i = 0)
#foreach ($member in $members)
#if (!$member.modifierStatic)
#if ($i == 0)
sb.append("{##
#else
sb.append(", ##
#end
#if ($member.string)
$member.name='")##
#else
$member.name=")##
#end
#if ($member.primitiveArray)
.append($member.name == null ? "null" : "");
for (int i = 0; $member.name != null && i < $member.name .length; ++i)
sb.append(i == 0 ? "" : ", ").append($member.name+);
#elseif ($member.objectArray)
.append($member.name == null ? "null" :
Arrays.asList($member.name).toString());
#elseif ($member.string)
.append($member.accessor).append('\'');
#else
.append($member.accessor);
#end
#set ($i = $i + 1)
#end
#end
#if ($members.size() == 0)
sb.append("{}");
#else
sb.append('}');
#end
return sb.toString();
}
"Claus Ibsen" <cib_rejse@yahoo.dk> wrote in message
news:9346818.1146054853500.JavaMail.itn@is.intellij.net...
I had a blow-up last night also. With the same template I have been
using for months.
Grant Gochnauer wrote:
>
>
>
>
>> Just to be 100% sure. Can you post the template you use?
>>
>
>
On 2006-04-25 20:21:25 +0200, "Grant Gochnauer"
<grant.gochnauer@vodori.com> said:
no, same here...
I went back to the old version and it's working fine now...
If anyone wants me to host the old version, I'd be more than happy to.
--Grant
"Norris Shelton" <nunya@nunya.net> wrote in message news:444F78EB.7030505@nunya.net...
I had a blow-up last night also. With the same template I have been using for months.
Grant Gochnauer wrote:
Sure -- I am activating the built in template without any changes.. Using
the validate button in the plugin says the template is VALID.
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("$classname");
#set ($i = 0)
#foreach ($member in $members)
#if (!$member.modifierStatic)
#if ($i == 0)
sb.append("{##
#else
sb.append(", ##
#end
#if ($member.string)
$member.name='")##
#else
$member.name=")##
#end
#if ($member.primitiveArray)
.append($member.name == null ? "null" : "");
for (int i = 0; $member.name != null && i < $member.name .length; ++i)
sb.append(i == 0 ? "" : ", ").append($member.name+);
#elseif ($member.objectArray)
.append($member.name == null ? "null" :
Arrays.asList($member.name).toString());
#elseif ($member.string)
.append($member.accessor).append('\'');
#else
.append($member.accessor);
#end
#set ($i = $i + 1)
#end
#end
#if ($members.size() == 0)
sb.append("{}");
#else
sb.append('}');
#end
return sb.toString();
}
"Claus Ibsen" <cib_rejse@yahoo.dk> wrote in message
news:9346818.1146054853500.JavaMail.itn@is.intellij.net...
Just to be 100% sure. Can you post the template you use?
I think a workaround in 2.22 is to add javadoc in the template
Sorry I haven't had time to fix it yet, will do it in the weekend (promise).
Also I think old versions can be downloaded using the web interface for the plugin central. There is a "version" button somewhere you can click to find older versions.
Damm
I had a computer break down at home last weekend.
It will setback the fix a few days before I have time and will use the company laptop.
/Claus
I tried adding:
/**
Hello World
*/
above the template and I still get the same error. I'll try to roll back to an earlier version.
hmmm I don't see how you can get access to previous plugin versions using the plugins interface in IDEA. Am I missing the obvious?
I'm about to release v3.23 that works.
v3.23 is released with a fix. Sorry for the problems with v3.22.